From fbfd7c227a080537f498b51ec3de22053a32c599 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 1 Jan 2022 19:05:48 +0100 Subject: Move -ldl and -lm to end --- backend/ninja/Ninja.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'backend') 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 buildExeArgs; + vector 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 buildDynamicArgs; + vector 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) { -- cgit v1.2.3