aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp42
1 files changed, 39 insertions, 3 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 27608cc..bad224a 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -972,7 +972,12 @@ namespace backend
ninja::NinjaArg::createRaw("-pipe"),
ninja::NinjaArg::createRaw("-D_FILE_OFFSET_BITS=64"),
ninja::NinjaArg::createRaw("-Winvalid-pch"),
- ninja::NinjaArg::createRaw("-fstack-protector"),
+ });
+
+ if(config.getCompiler() != Compiler::MINGW_W64)
+ compileCCommand.push_back(ninja::NinjaArg::createRaw("-fstack-protector"));
+
+ compileCCommand.insert(compileCCommand.end(), {
ninja::NinjaArg::createRaw("-MMD"),
ninja::NinjaArg("-I" + config.getPackageName() + "@exe"),
ninja::NinjaArg::createRaw("$globalIncDir")
@@ -1243,10 +1248,9 @@ namespace backend
}
else
{
- // By statically compiling when using mingw w64, we dont have to bundle our application with several runtime dlls
if(config.getCompiler() == Compiler::MINGW_W64)
{
- packagingFlags = "-static -static-libgcc -static-libstdc++";
+ packagingFlags = "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic";
}
}
@@ -1346,6 +1350,22 @@ 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:
@@ -1546,6 +1566,22 @@ 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: