aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-01-01 19:05:48 +0100
committerdec05eba <dec05eba@protonmail.com>2022-01-01 19:05:48 +0100
commitfbfd7c227a080537f498b51ec3de22053a32c599 (patch)
tree720282b1a63018dc19be8500e34d0665fbf14549 /backend
parent37b23908f195d54844486552cc4359bf6f4a949c (diff)
Move -ldl and -lm to end
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp10
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)
{