aboutsummaryrefslogtreecommitdiff
path: root/backend/ninja
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-02-10 14:17:09 +0100
committerdec05eba <dec05eba@protonmail.com>2021-02-10 14:17:09 +0100
commite59d08b33daca53a53e44e0705db3e5d2fcc2817 (patch)
tree741ee31d691ad2769905d20ad782b188cfc7b187 /backend/ninja
parentf4d083bf64d1a2b4f603d0f5fa96f3ac4e7db1fe (diff)
Disable flto by default and add --flto to enable it
Diffstat (limited to 'backend/ninja')
-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"));
}