diff options
-rw-r--r-- | backend/ninja/Ninja.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 943e090..653d14d 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -1082,13 +1082,14 @@ namespace backend objectNames.emplace_back(move(objectName)); } + string packagingFlags; if(config.packaging) { switch(config.getCompiler()) { case Compiler::GCC: { - allLinkerFlags += " -static-libgcc -static-libstdc++"; + packagingFlags = "-static-libgcc -static-libstdc++"; break; } case Compiler::MSVC: @@ -1219,6 +1220,7 @@ namespace backend if (!allLinkerFlags.empty()) buildExeArgs.push_back(ninja::NinjaArg::createRaw(allLinkerFlags)); + buildExeArgs.push_back(ninja::NinjaArg::createRaw(packagingFlags)); ninja::NinjaRule *buildExeRule = ninjaBuildFile.createRule("build_exec", buildExeArgs); buildExeRule->build(objectNames, executableName, {}); } @@ -1412,6 +1414,7 @@ namespace backend if (!allLinkerFlags.empty()) buildDynamicArgs.push_back(ninja::NinjaArg::createRaw(allLinkerFlags)); + buildDynamicArgs.push_back(ninja::NinjaArg::createRaw(packagingFlags)); ninja::NinjaRule *buildDynamicRule = ninjaBuildFile.createRule("build_dynamic", buildDynamicArgs); buildDynamicRule->build(objectNames, generatedFile, {}); } |