diff options
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ninja/Ninja.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 456eb27..be8e303 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -1311,6 +1311,7 @@ namespace backend case LibraryType::EXECUTABLE: { vector<ninja::NinjaArg> buildExeArgs; + vector<ninja::NinjaArg> lastBuildExeArgs; string executableName = config.getPackageName(); if(isSamePlatformFamily(config.platform, PLATFORM_WIN)) executableName += ".exe"; @@ -1381,7 +1382,7 @@ namespace backend #else if(!isSamePlatformFamily(config.platform, PLATFORM_WIN)) { - buildExeArgs.insert(buildExeArgs.end(), { + lastBuildExeArgs.insert(lastBuildExeArgs.end(), { ninja::NinjaArg::createRaw("-ldl"), ninja::NinjaArg::createRaw("-lm") }); @@ -1424,6 +1425,8 @@ namespace backend if (!allLinkerFlags.empty()) buildExeArgs.push_back(ninja::NinjaArg::createRaw(allLinkerFlags)); + buildExeArgs.insert(buildExeArgs.end(), lastBuildExeArgs.begin(), lastBuildExeArgs.end()); + buildExeArgs.push_back(ninja::NinjaArg::createRaw(packagingFlags)); if(config.getCompiler() == Compiler::MINGW_W64) { @@ -1533,6 +1536,7 @@ namespace backend case LibraryType::DYNAMIC: { vector<ninja::NinjaArg> buildDynamicArgs; + vector<ninja::NinjaArg> lastBuildDynamicArgs; string generatedFile; switch (config.getCompiler()) { @@ -1613,7 +1617,7 @@ namespace backend #else if(!isSamePlatformFamily(config.platform, PLATFORM_WIN)) { - buildDynamicArgs.insert(buildDynamicArgs.end(), { + lastBuildDynamicArgs.insert(lastBuildDynamicArgs.end(), { ninja::NinjaArg::createRaw("-ldl"), ninja::NinjaArg::createRaw("-lm") }); @@ -1655,6 +1659,8 @@ namespace backend if (!allLinkerFlags.empty()) buildDynamicArgs.push_back(ninja::NinjaArg::createRaw(allLinkerFlags)); + buildDynamicArgs.insert(buildDynamicArgs.end(), lastBuildDynamicArgs.begin(), lastBuildDynamicArgs.end()); + buildDynamicArgs.push_back(ninja::NinjaArg::createRaw(packagingFlags)); if(config.getCompiler() == Compiler::MINGW_W64) { |