mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 19:29:30 +00:00
Added:
- Toolchain overrides via `[toolchain]` and env (`DCR_*`) - ASM `.S` preprocessing via GCC/Clang (`-x assembler-with-cpp`)
This commit is contained in:
@@ -21,12 +21,13 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||
|
||||
if ctx.kind == "staticlib" {
|
||||
let lib_path = platform::lib_path(ctx.profile, ctx.project_name, ctx.target_dir);
|
||||
let mut cmd = Command::new(if cfg!(target_os = "windows") {
|
||||
let archiver = ctx.archiver.unwrap_or(if cfg!(target_os = "windows") {
|
||||
"lib"
|
||||
} else {
|
||||
"ar"
|
||||
});
|
||||
if cfg!(target_os = "windows") {
|
||||
let mut cmd = Command::new(archiver);
|
||||
if cfg!(target_os = "windows") && archiver == "lib" {
|
||||
cmd.arg("/nologo").arg(format!("/OUT:{lib_path}"));
|
||||
} else {
|
||||
cmd.arg("rcs").arg(&lib_path);
|
||||
@@ -44,7 +45,7 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||
}
|
||||
}
|
||||
|
||||
let mut cmd = Command::new("cc");
|
||||
let mut cmd = Command::new(ctx.linker.unwrap_or("cc"));
|
||||
if ctx.kind == "sharedlib" {
|
||||
if cfg!(target_os = "macos") {
|
||||
cmd.arg("-dynamiclib");
|
||||
|
||||
Reference in New Issue
Block a user