diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-08-20 17:23:54 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-08-20 17:23:54 +0200 |
commit | 4aaeaea1d7c16fe12194c1d78214de34879645a4 (patch) | |
tree | 60dcf374a09fb916335cdc65d1bbc1f7c3292867 /src | |
parent | d580d6cd7d3ff24b820d9ea383cb9e766f4416f4 (diff) |
Add --debug-symbols to include debug symbols in release builds
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index a1136c4..5c3ad8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -136,7 +136,8 @@ static void usageBuild(bool run) printf(" --debug|--release Optimization level to build project and dependencies with (if not a system package) - Optional (default: --debug)\n"); printf(" --sanitize Add runtime address/undefined behavior sanitization. Program can be up to 3 times slower and use 10 times as much RAM. Ignored if compiler doesn't support sanitization - Optional (default: none)\n"); printf(" --platform The platform to build for - Optional (default: the running platform)\n"); - printf(" --lto Use link-time optimization. May increase compile times - Optional (default: false)\n"); + printf(" --lto Use link-time optimization. May increase compile times - Optional (default: not used)\n"); + printf(" --debug-symbols Include debug symbols in release mode - Optional (default: not used)\n"); printf("Examples:\n"); printf(" sibs %s\n", run ? "run" : "build"); if(run) @@ -492,6 +493,7 @@ static int buildProject(int argc, const _tinydir_char_t **argv, bool run) Sanitize sanitize = Sanitize::NONE; FileString platformName; bool use_lto = false; + bool include_debug_symbols_in_release = false; std::vector<FileString> run_args; for(int i = 0; i < argc; ++i) @@ -519,6 +521,10 @@ static int buildProject(int argc, const _tinydir_char_t **argv, bool run) { use_lto = true; } + else if(_tinydir_strcmp(arg, TINYDIR_STRING("--debug-symbols")) == 0) + { + include_debug_symbols_in_release = true; + } else if(_tinydir_strncmp(arg, TINYDIR_STRING("--sanitize="), 11) == 0) { sanitize = sanitize_string_to_type(arg + 11); @@ -627,6 +633,7 @@ static int buildProject(int argc, const _tinydir_char_t **argv, bool run) sibsConfig.platform = platform; sibsConfig.setSanitize(sanitize); sibsConfig.use_lto = use_lto; + sibsConfig.include_debug_symbols_in_release = include_debug_symbols_in_release; return buildProject(projectPath, projectConfFilePath, sibsConfig, run, run_args); } |