summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2019-07-19 02:48:17 (GMT)
committerSaleem Abdulrasool <compnerd@compnerd.org>2019-07-19 02:52:48 (GMT)
commit59f2aa63e4aeb99b3c51a0325cc5f622b126444c (patch)
tree18472673fdc2da814cde7d949f3dd647db0997bb /Source
parent744dd2cccb003628e6153d4bd9d9cf64bca56247 (diff)
downloadCMake-59f2aa63e4aeb99b3c51a0325cc5f622b126444c.zip
CMake-59f2aa63e4aeb99b3c51a0325cc5f622b126444c.tar.gz
CMake-59f2aa63e4aeb99b3c51a0325cc5f622b126444c.tar.bz2
Swift: fix static library handling
Handle static libraries similar to shared libraries. Do not pass along the shared library flags raw as that will pass flags for the linker to the driver which is incorrect.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 4ffd6e0..d177278 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1134,11 +1134,13 @@ void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags,
std::string const& linkLanguage,
cmGeneratorTarget* target)
{
- this->AppendFlags(
- flags, this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS"));
- if (!config.empty()) {
- std::string name = "CMAKE_STATIC_LINKER_FLAGS_" + config;
- this->AppendFlags(flags, this->Makefile->GetSafeDefinition(name));
+ if (linkLanguage != "Swift") {
+ this->AppendFlags(
+ flags, this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS"));
+ if (!config.empty()) {
+ std::string name = "CMAKE_STATIC_LINKER_FLAGS_" + config;
+ this->AppendFlags(flags, this->Makefile->GetSafeDefinition(name));
+ }
}
this->AppendFlags(flags, target->GetProperty("STATIC_LIBRARY_FLAGS"));
if (!config.empty()) {