mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 17:19:37 +00:00
- 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.
2.3 KiB
2.3 KiB
dcr build
Builds the project in debug or release profile.
Usage
dcr build
dcr build --debug
dcr build --release
dcr build --target linux --release
dcr build --release --force
dcr build --debug --clean
What build does
- Checks that
dcr.tomlexists and is valid. - Reads build settings from
[build]. - Resolves path dependencies from
[dependencies]. - Creates required output directories.
- Recursively compiles sources from
src/. - Links final artifact (binary or library).
Config values used
package.namebuild.compilerbuild.languagebuild.standardbuild.kindbuild.targetbuild.platformbuild.cflagsbuild.ldflagsbuild.debug/build.releasebuild.excludebuild.includebuild.pkg_configbuild.stepsbuild.post_stepsbuild.generatedbuild.expectbuild.clean
Source selection
language = "c"->*.clanguage = "c++" | "cpp" | "cxx"->*.cpp,*.cxx,*.cclanguage = "asm"->*.s,*.S,*.asm- Mixed languages are supported with arrays, for example
language = ["c", "asm"]. - By default sources are searched in
src/; usebuild.rootsandbuild.src_disableto override.
Notes
- Profile flag (
--debug/--release) can appear in any argument position (duplicates are rejected). - Unknown profile flags return an error.
--target <triple>builds for specified target (short names:linux,macos,windows).- If no
--target, builds forbuild.targetsor native. - Incremental rebuild checks source/object mtime and tracked header dependencies.
--forceskips build cache checks and recompiles.--cleanremovestarget/<profile>andbuild.cleanpaths before building.- Default GCC/Clang profile flags:
debug->-O0 -g -Wall -Wextra -fno-omit-frame-pointer -DDCR_DEBUG,release->-O3 -DNDEBUG. - For
language = "asm"withcompiler = "as"/"gas", use.sfiles (no preprocessing). For.S, usegccorclang. - In workspace root,
dcr buildbuilds all members in dependency order. build.excluderemoves paths from source/header collection;build.includere-allows matching paths and has priority overexclude.build.stepsrun before compilation;build.post_stepsrun after linking.build.generatedis cleaned whenbuild.stepsneed to rerun;build.expectis verified after post-steps.