diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-05 07:15:55 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | 45e00fd7c7695adb9d69e8621ab76fdfa085900b (patch) | |
tree | 167d2a660db7bc4bdc199a438b8255ffc8b45cca /backend | |
parent | 5250cb90406693163763a214af95f670e0e3a4e0 (diff) |
Fix for windows & mingw
Diffstat (limited to 'backend')
-rw-r--r-- | backend/ninja/Ninja.cpp | 42 |
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: |