From 00cd5681c3a83c85d2a34fb2c4b6cfb691ef1b3d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 22 Apr 2021 19:32:57 +0200 Subject: rename flto option to lto --- backend/ninja/Ninja.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'backend') 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 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 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")); } -- cgit v1.2.3