aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-08-20 17:23:54 +0200
committerdec05eba <dec05eba@protonmail.com>2021-08-20 17:23:54 +0200
commit4aaeaea1d7c16fe12194c1d78214de34879645a4 (patch)
tree60dcf374a09fb916335cdc65d1bbc1f7c3292867 /backend/ninja
parentd580d6cd7d3ff24b820d9ea383cb9e766f4416f4 (diff)
Add --debug-symbols to include debug symbols in release builds
Diffstat (limited to 'backend/ninja')
-rw-r--r--backend/ninja/Ninja.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index d2465b4..54b86d1 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -396,9 +396,10 @@ namespace backend
}
case OPT_LEV_RELEASE:
{
- std::vector<ninja::NinjaArg> result = { ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG") };
+ std::vector<ninja::NinjaArg> result = { ninja::NinjaArg::createRaw("-O3 -DNDEBUG") };
if(config.use_lto)
result.push_back(ninja::NinjaArg::createRaw("-flto"));
+ result.push_back(ninja::NinjaArg::createRaw(config.include_debug_symbols_in_release ? "-g3" : "-g0"));
return result;
}
}
@@ -1125,10 +1126,9 @@ namespace backend
if(config.getOptimizationLevel() == sibs::OPT_LEV_RELEASE)
{
// TODO: Specify a way to change these options, either in project.conf or argument to sibs build
- commonZigArgs.insert(commonZigArgs.end(), {
- ninja::NinjaArg::createRaw("--release-safe"),
- ninja::NinjaArg::createRaw("--strip")
- });
+ commonZigArgs.push_back(ninja::NinjaArg::createRaw("--release-safe"));
+ if(!config.include_debug_symbols_in_release)
+ commonZigArgs.push_back(ninja::NinjaArg::createRaw("--strip"));
}
zigTestArgs.insert(zigTestArgs.end(), commonZigArgs.begin(), commonZigArgs.end());
@@ -1356,7 +1356,8 @@ namespace backend
else if(config.getOptimizationLevel() == OPT_LEV_RELEASE)
{
// Strip binary
- buildExeArgs.push_back(ninja::NinjaArg::createRaw("-s"));
+ if(!config.include_debug_symbols_in_release)
+ buildExeArgs.push_back(ninja::NinjaArg::createRaw("-s"));
}
if(config.use_lto)