diff options
author | Justin Goshi <jgoshi@microsoft.com> | 2019-09-03 17:25:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-10 14:45:41 (GMT) |
commit | 4d5bbb7704a44e56f43585b3f811f37c5200bdd0 (patch) | |
tree | 22dbc7e80aff55c98e8705b19e4b145ff5c8a28b /Source/cmLocalGenerator.cxx | |
parent | 1f6a436bf4188007b87d2582367cde8f970d5e1f (diff) | |
download | CMake-4d5bbb7704a44e56f43585b3f811f37c5200bdd0.zip CMake-4d5bbb7704a44e56f43585b3f811f37c5200bdd0.tar.gz CMake-4d5bbb7704a44e56f43585b3f811f37c5200bdd0.tar.bz2 |
cmLocalGenerator: Add GetStaticLibraryFlags overload with backtraces
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 44ba79a..36e1115 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1148,8 +1148,18 @@ void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags, std::string const& linkLanguage, cmGeneratorTarget* target) { - std::string staticLibFlags; + std::vector<BT<std::string>> tmpFlags = + this->GetStaticLibraryFlags(config, linkLanguage, target); + this->AppendFlags(flags, tmpFlags); +} + +std::vector<BT<std::string>> cmLocalGenerator::GetStaticLibraryFlags( + std::string const& config, std::string const& linkLanguage, + cmGeneratorTarget* target) +{ + std::vector<BT<std::string>> flags; if (linkLanguage != "Swift") { + std::string staticLibFlags; this->AppendFlags( staticLibFlags, this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS")); @@ -1158,7 +1168,12 @@ void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags, this->AppendFlags(staticLibFlags, this->Makefile->GetSafeDefinition(name)); } + if (!staticLibFlags.empty()) { + flags.emplace_back(std::move(staticLibFlags)); + } } + + std::string staticLibFlags; this->AppendFlags(staticLibFlags, target->GetSafeProperty("STATIC_LIBRARY_FLAGS")); if (!config.empty()) { @@ -1166,12 +1181,16 @@ void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags, this->AppendFlags(staticLibFlags, target->GetSafeProperty(name)); } - flags = std::move(staticLibFlags); + if (!staticLibFlags.empty()) { + flags.emplace_back(std::move(staticLibFlags)); + } - std::vector<std::string> staticLibOpts; - target->GetStaticLibraryLinkOptions(staticLibOpts, config, linkLanguage); + std::vector<BT<std::string>> staticLibOpts = + target->GetStaticLibraryLinkOptions(config, linkLanguage); // STATIC_LIBRARY_OPTIONS are escaped. this->AppendCompileOptions(flags, staticLibOpts); + + return flags; } void cmLocalGenerator::GetTargetFlags( |