diff options
-rw-r--r-- | backend/ninja/Ninja.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 99b276e..68b3d05 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -434,7 +434,7 @@ namespace backend case OPT_LEV_RELEASE: { return { - ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG") + ninja::NinjaArg::createRaw("-O3 -g0 -DNDEBUG -flto") }; } } @@ -1378,6 +1378,11 @@ namespace backend buildExeArgs.push_back(ninja::NinjaArg::createRaw("-s")); } + if(config.getOptimizationLevel() == OPT_LEV_RELEASE) + { + buildExeArgs.push_back(ninja::NinjaArg::createRaw("-flto")); + } + // TODO: Add flag to disable -ldl and -lm (dlopen, dlclose, floor, max, ...) #if OS_TYPE == OS_TYPE_OPENBSD || OS_TYPE == OS_TYPE_HAIKU buildExeArgs.insert(buildExeArgs.end(), { @@ -1602,6 +1607,11 @@ namespace backend buildDynamicArgs.push_back(ninja::NinjaArg::createRaw("-lasan -lubsan -llsan")); } + if(config.getOptimizationLevel() == OPT_LEV_RELEASE) + { + buildDynamicArgs.push_back(ninja::NinjaArg::createRaw("-flto")); + } + // TODO: Add flag to disable -ldl and -lm (dlopen, dlclose, floor, max, ...) #if OS_TYPE == OS_TYPE_OPENBSD || OS_TYPE == OS_TYPE_HAIKU buildDynamicArgs.insert(buildDynamicArgs.end(), { |