mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 19:19:41 +00:00
feat: add cross-compilation support with --target flag
- Updated build and run commands to accept a --target option for specifying target platforms. - Enhanced documentation to include cross-compilation usage and supported targets. - Modified configuration to allow target-specific settings and toolchains. - Introduced a new test command to run project tests with specified profiles and targets. - Improved handling of target directories and output structure for different platforms. - Added support for multiple targets in the configuration file. - Implemented inheritance for workspace and dependencies based on target and profile.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::core::builder::BuildContext;
|
||||
use crate::core::builder::common;
|
||||
use crate::core::builder::BuildContext;
|
||||
use crate::platform;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
@@ -66,8 +66,10 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||
for obj in &objects {
|
||||
cmd.arg(obj);
|
||||
}
|
||||
for flag in default_flags(ctx.profile) {
|
||||
cmd.arg(flag);
|
||||
if ctx.cflags.is_empty() {
|
||||
for flag in default_flags(ctx.profile) {
|
||||
cmd.arg(flag);
|
||||
}
|
||||
}
|
||||
for flag in ctx.cflags {
|
||||
cmd.arg(flag);
|
||||
@@ -217,8 +219,10 @@ fn build_objects(
|
||||
if let Some(flag) = msvc_arch_flag(ctx.platform) {
|
||||
cmd.arg(flag);
|
||||
}
|
||||
for flag in default_flags(ctx.profile) {
|
||||
cmd.arg(flag);
|
||||
if ctx.cflags.is_empty() {
|
||||
for flag in default_flags(ctx.profile) {
|
||||
cmd.arg(flag);
|
||||
}
|
||||
}
|
||||
for flag in ctx.cflags {
|
||||
cmd.arg(flag);
|
||||
|
||||
Reference in New Issue
Block a user