aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index fad1d35..34fe6e7 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -458,9 +458,10 @@ namespace backend
}
case OPT_LEV_RELEASE:
{
- return {
- ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG -flto")
- };
+ if(config.use_flto)
+ return { ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG -flto") };
+ else
+ return {};
}
}
break;
@@ -1410,7 +1411,7 @@ namespace backend
buildExeArgs.push_back(ninja::NinjaArg::createRaw("-s"));
}
- if(config.getOptimizationLevel() == OPT_LEV_RELEASE)
+ if(config.getOptimizationLevel() == OPT_LEV_RELEASE && config.use_flto)
{
buildExeArgs.push_back(ninja::NinjaArg::createRaw("-flto"));
}
@@ -1638,7 +1639,7 @@ namespace backend
if(sanitizeFlag.type != ninja::NinjaArg::Type::NONE)
buildDynamicArgs.push_back(std::move(sanitizeFlag));
- if(config.getOptimizationLevel() == OPT_LEV_RELEASE)
+ if(config.getOptimizationLevel() == OPT_LEV_RELEASE && config.use_flto)
{
buildDynamicArgs.push_back(ninja::NinjaArg::createRaw("-flto"));
}