aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index ace95d9..ea3d96f 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -448,20 +448,23 @@ namespace backend
case OPT_LEV_DEBUG:
{
// TODO: Add _GLIBCXX_DEBUG
- return {
+ std::vector<ninja::NinjaArg> result = {
ninja::NinjaArg::createRaw("-O0 -g3"),
ninja::NinjaArg::createRaw("-D_GLIBCXX_ASSERTIONS"),
ninja::NinjaArg::createRaw("-fasynchronous-unwind-tables"),
ninja::NinjaArg::createRaw("-D_DEBUG"),
ninja::NinjaArg::createRaw("-fno-omit-frame-pointer"),
};
+ if(config.use_lto)
+ result.push_back(ninja::NinjaArg::createRaw("-flto"));
+ return result;
}
case OPT_LEV_RELEASE:
{
- if(config.use_flto)
- return { ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG -flto") };
- else
- return { ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG") };
+ std::vector<ninja::NinjaArg> result = { ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG") };
+ if(config.use_lto)
+ result.push_back(ninja::NinjaArg::createRaw("-flto"));
+ return result;
}
}
break;
@@ -1411,7 +1414,7 @@ namespace backend
buildExeArgs.push_back(ninja::NinjaArg::createRaw("-s"));
}
- if(config.getOptimizationLevel() == OPT_LEV_RELEASE && config.use_flto)
+ if(config.use_lto)
{
buildExeArgs.push_back(ninja::NinjaArg::createRaw("-flto"));
}
@@ -1639,7 +1642,7 @@ namespace backend
if(sanitizeFlag.type != ninja::NinjaArg::Type::NONE)
buildDynamicArgs.push_back(std::move(sanitizeFlag));
- if(config.getOptimizationLevel() == OPT_LEV_RELEASE && config.use_flto)
+ if(config.use_lto)
{
buildDynamicArgs.push_back(ninja::NinjaArg::createRaw("-flto"));
}