diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-08-15 13:20:18 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2018-08-15 13:20:18 (GMT) |
commit | 974de0e19932d27576a5c7661905f75b2b8daaa9 (patch) | |
tree | 4d66d41907b6425c789e8b4fce64e52290817e0e /Source/cmGeneratorTarget.cxx | |
parent | 349f8bfb25349892fb2c4e5a9942e4bd63f86f49 (diff) | |
download | CMake-974de0e19932d27576a5c7661905f75b2b8daaa9.zip CMake-974de0e19932d27576a5c7661905f75b2b8daaa9.tar.gz CMake-974de0e19932d27576a5c7661905f75b2b8daaa9.tar.bz2 |
static library: add property STATIC_LIBRARY_OPTIONS
issue: #18251
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 1548374..0b3a945 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3018,6 +3018,47 @@ void cmGeneratorTarget::GetLinkOptions(std::vector<std::string>& result, } namespace { +void processStaticLibraryLinkOptions( + cmGeneratorTarget const* tgt, + const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, + std::vector<std::string>& options, + std::unordered_set<std::string>& uniqueOptions, + cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config, + std::string const& language) +{ + processOptionsInternal(tgt, entries, options, uniqueOptions, dagChecker, + config, false, "static library link options", + language, OptionsParse::Shell); +} +} + +void cmGeneratorTarget::GetStaticLibraryLinkOptions( + std::vector<std::string>& result, const std::string& config, + const std::string& language) const +{ + std::vector<cmGeneratorTarget::TargetPropertyEntry*> entries; + std::unordered_set<std::string> uniqueOptions; + + cmGeneratorExpressionDAGChecker dagChecker( + this->GetName(), "STATIC_LIBRARY_OPTIONS", nullptr, nullptr); + + if (const char* linkOptions = this->GetProperty("STATIC_LIBRARY_OPTIONS")) { + std::vector<std::string> options; + cmGeneratorExpression ge; + cmSystemTools::ExpandListArgument(linkOptions, options); + for (const auto& option : options) { + std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(option); + entries.push_back( + new cmGeneratorTarget::TargetPropertyEntry(std::move(cge))); + } + } + processStaticLibraryLinkOptions(this, entries, result, uniqueOptions, + &dagChecker, config, language); + + cmDeleteAll(entries); +} + +namespace { void processLinkDepends( cmGeneratorTarget const* tgt, const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries, |