aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-10-28 02:07:43 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:33 +0200
commit518407c80204dcaae91bb4afebea2355a589e595 (patch)
treee5b6b38f23d7248952a52b0959d49bdfcc06f184
parent33eb8101a25d41b9a19bdad45d109e55e0aa7ee2 (diff)
Fix system libraries wrong order mingw
-rw-r--r--backend/ninja/Ninja.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 0ba08ab..4162c58 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -1302,7 +1302,7 @@ namespace backend
{
if(config.getCompiler() == Compiler::MINGW_W64)
{
- packagingFlags = "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic";
+ packagingFlags = "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic";
}
}
@@ -1401,22 +1401,6 @@ namespace backend
});
}
#endif
- if(config.getCompiler() == Compiler::MINGW_W64)
- {
- buildExeArgs.insert(buildExeArgs.end(), {
- ninja::NinjaArg::createRaw("-lws2_32"),
- ninja::NinjaArg::createRaw("-lwldap32"),
- ninja::NinjaArg::createRaw("-lcrypt32"),
- ninja::NinjaArg::createRaw("-ladvapi32"),
- ninja::NinjaArg::createRaw("-lgdi32"),
- ninja::NinjaArg::createRaw("-luser32"),
- ninja::NinjaArg::createRaw("-luserenv"),
- ninja::NinjaArg::createRaw("-lopengl32"),
- ninja::NinjaArg::createRaw("-lglu32"),
- ninja::NinjaArg::createRaw("-lwinpthread"),
- ninja::NinjaArg::createRaw("-lshell32")
- });
- }
break;
}
case Compiler::MSVC:
@@ -1455,6 +1439,22 @@ namespace backend
buildExeArgs.push_back(ninja::NinjaArg::createRaw(allLinkerFlags));
buildExeArgs.push_back(ninja::NinjaArg::createRaw(packagingFlags));
+ if(config.getCompiler() == Compiler::MINGW_W64)
+ {
+ buildExeArgs.insert(buildExeArgs.end(), {
+ ninja::NinjaArg::createRaw("-lws2_32"),
+ ninja::NinjaArg::createRaw("-lwldap32"),
+ ninja::NinjaArg::createRaw("-lcrypt32"),
+ ninja::NinjaArg::createRaw("-ladvapi32"),
+ ninja::NinjaArg::createRaw("-lgdi32"),
+ ninja::NinjaArg::createRaw("-luser32"),
+ ninja::NinjaArg::createRaw("-luserenv"),
+ ninja::NinjaArg::createRaw("-lopengl32"),
+ ninja::NinjaArg::createRaw("-lglu32"),
+ ninja::NinjaArg::createRaw("-Wl,-Bstatic -lwinpthread"),
+ ninja::NinjaArg::createRaw("-lshell32")
+ });
+ }
ninja::NinjaRule *buildExeRule = ninjaBuildFile.createRule("build_exec", buildExeArgs);
buildExeRule->build(objectNames, executableName, {});
}
@@ -1616,22 +1616,6 @@ namespace backend
});
}
#endif
- if(config.getCompiler() == Compiler::MINGW_W64)
- {
- buildDynamicArgs.insert(buildDynamicArgs.end(), {
- ninja::NinjaArg::createRaw("-lws2_32"),
- ninja::NinjaArg::createRaw("-lwldap32"),
- ninja::NinjaArg::createRaw("-lcrypt32"),
- ninja::NinjaArg::createRaw("-ladvapi32"),
- ninja::NinjaArg::createRaw("-lgdi32"),
- ninja::NinjaArg::createRaw("-luser32"),
- ninja::NinjaArg::createRaw("-luserenv"),
- ninja::NinjaArg::createRaw("-lopengl32"),
- ninja::NinjaArg::createRaw("-lglu32"),
- ninja::NinjaArg::createRaw("-lwinpthread"),
- ninja::NinjaArg::createRaw("-lshell32")
- });
- }
break;
}
case Compiler::MSVC:
@@ -1669,6 +1653,22 @@ namespace backend
buildDynamicArgs.push_back(ninja::NinjaArg::createRaw(allLinkerFlags));
buildDynamicArgs.push_back(ninja::NinjaArg::createRaw(packagingFlags));
+ if(config.getCompiler() == Compiler::MINGW_W64)
+ {
+ buildDynamicArgs.insert(buildDynamicArgs.end(), {
+ ninja::NinjaArg::createRaw("-lws2_32"),
+ ninja::NinjaArg::createRaw("-lwldap32"),
+ ninja::NinjaArg::createRaw("-lcrypt32"),
+ ninja::NinjaArg::createRaw("-ladvapi32"),
+ ninja::NinjaArg::createRaw("-lgdi32"),
+ ninja::NinjaArg::createRaw("-luser32"),
+ ninja::NinjaArg::createRaw("-luserenv"),
+ ninja::NinjaArg::createRaw("-lopengl32"),
+ ninja::NinjaArg::createRaw("-lglu32"),
+ ninja::NinjaArg::createRaw("-Wl,-Bstatic -lwinpthread"),
+ ninja::NinjaArg::createRaw("-lshell32")
+ });
+ }
ninja::NinjaRule *buildDynamicRule = ninjaBuildFile.createRule("build_dynamic", buildDynamicArgs);
buildDynamicRule->build(objectNames, generatedFile, {});
}