mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 20:19:40 +00:00
- Updated all relevant source files to include the new license header. - Changed the default license in the configuration from MIT to GPL-3.0-or-later.
52 lines
2.0 KiB
Rust
52 lines
2.0 KiB
Rust
// DCR — Cargo-like C/C++ project manager.
|
|
//
|
|
// Copyright (C) 2026 Dexoron (Bezotechestvo Vladimir) <main@dexoron.su>
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
pub fn bin_path(profile: &str, name: &str, target_dir: Option<&str>) -> String {
|
|
match target_dir {
|
|
Some(dir) => format!("{}/{}.exe", dir.trim_end_matches('/'), name),
|
|
None => format!("./target/{profile}/{name}.exe"),
|
|
}
|
|
}
|
|
|
|
pub fn lib_path(profile: &str, name: &str, target_dir: Option<&str>) -> String {
|
|
match target_dir {
|
|
Some(dir) => format!("{}/{}.lib", dir.trim_end_matches('/'), name),
|
|
None => format!("./target/{profile}/{name}.lib"),
|
|
}
|
|
}
|
|
|
|
pub fn elf_path(profile: &str, name: &str, target_dir: Option<&str>) -> String {
|
|
match target_dir {
|
|
Some(dir) => format!("{}/{}.exe", dir.trim_end_matches('/'), name),
|
|
None => format!("./target/{profile}/{name}.exe"),
|
|
}
|
|
}
|
|
|
|
pub fn efi_path(profile: &str, name: &str, target_dir: Option<&str>) -> String {
|
|
match target_dir {
|
|
Some(dir) => format!("{}/{}.efi", dir.trim_end_matches('/'), name),
|
|
None => format!("./target/{profile}/{name}.efi"),
|
|
}
|
|
}
|
|
|
|
pub fn shared_lib_path(profile: &str, name: &str, target_dir: Option<&str>) -> String {
|
|
match target_dir {
|
|
Some(dir) => format!("{}/{}.dll", dir.trim_end_matches('/'), name),
|
|
None => format!("./target/{profile}/{name}.dll"),
|
|
}
|
|
}
|