aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-05-14 17:14:48 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:58 +0200
commitd0aad1c2cf1c734c650d277d4ad61b3e593a9d01 (patch)
treea66af9046fcb056c602b49ee359e9938328db3d1 /backend
parent75b961eb9572606e3cea2e5f649d47b5dd2207af (diff)
Only statically link to libc++ if there are c++ files in the project
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 68b3d05..7bdcbaa 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -1273,7 +1273,12 @@ namespace backend
case Compiler::MINGW_W64:
case Compiler::GCC:
{
- packagingFlags = "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic";
+ if(usesCFiles) {
+ packagingFlags += " -static-libgcc";
+ }
+ if(usesCppFiles) {
+ packagingFlags += " -static-libstdc++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic";
+ }
break;
}
case Compiler::MSVC:
@@ -1287,7 +1292,12 @@ namespace backend
{
if(config.getCompiler() == Compiler::MINGW_W64)
{
- packagingFlags = "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic";
+ if(usesCFiles) {
+ packagingFlags += " -static-libgcc";
+ }
+ if(usesCppFiles) {
+ packagingFlags += " -static-libstdc++ -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic";
+ }
}
}