aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 044fb64..fb081de 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -411,23 +411,25 @@ namespace backend
allLinkerFlags += " ";
allLinkerFlags += binaryDependency;
}
-
+
+ string staticLinkerFlags;
if (!staticLinkerFlagCallbackFunc || libraryType == LibraryType::DYNAMIC)
{
- staticLinkerFlagCallbackFunc = [&allLinkerFlags](const string &linkerFlag)
+ staticLinkerFlagCallbackFunc = [&staticLinkerFlags](const string &linkerFlag)
{
- allLinkerFlags += " ";
- allLinkerFlags += linkerFlag;
+ staticLinkerFlags += " ";
+ staticLinkerFlags += linkerFlag;
};
}
+ string dynamicLinkerFlags;
// TODO: Do same for cmake
if (!sourceFiles.empty())
{
- dynamicLinkerFlagCallback = [&allLinkerFlags](const string &linkerFlag)
+ dynamicLinkerFlagCallback = [&dynamicLinkerFlags](const string &linkerFlag)
{
- allLinkerFlags += " ";
- allLinkerFlags += linkerFlag;
+ dynamicLinkerFlags += " ";
+ dynamicLinkerFlags += linkerFlag;
};
}
@@ -441,6 +443,8 @@ namespace backend
Result<bool> linkerFlags = getLinkerFlags(config, staticLinkerFlagCallbackFunc, dynamicLinkerFlagCallback, globalIncludeDirCallback, cflagsCallbackFunc);
if (linkerFlags.isErr())
return Result<bool>::Err(linkerFlags.getErrMsg());
+
+ allLinkerFlags += staticLinkerFlags + dynamicLinkerFlags;
result += dependencyExportIncludeDirs;
result += "\n\n";