From 4aaeaea1d7c16fe12194c1d78214de34879645a4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 20 Aug 2021 17:23:54 +0200 Subject: Add --debug-symbols to include debug symbols in release builds --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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 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); } -- cgit v1.2.3