diff options
author | Brad King <brad.king@kitware.com> | 2019-11-18 14:46:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-11-18 14:46:26 (GMT) |
commit | e14c9af013e8fe898a2cb46f4c1bd73dc72ff0a6 (patch) | |
tree | 82cb9367ece2db493129e2df10170d8a3e4ca8c7 /Source/cmGeneratorTarget.cxx | |
parent | f63d84c37c9ee1ea686369848b5bfc22916e1551 (diff) | |
parent | bb4c2781ced335c81b3c9307069792dba66d5062 (diff) | |
download | CMake-e14c9af013e8fe898a2cb46f4c1bd73dc72ff0a6.zip CMake-e14c9af013e8fe898a2cb46f4c1bd73dc72ff0a6.tar.gz CMake-e14c9af013e8fe898a2cb46f4c1bd73dc72ff0a6.tar.bz2 |
Merge topic 'pch-reuse-no-prop'
bb4c2781ce PCH: Do not issue an error on duplicate target_precompile_headers call
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4046
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 573ad4d..d0b5f9e 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3360,19 +3360,20 @@ std::string cmGeneratorTarget::GetPchHeader(const std::string& config, if (this->GetPropertyAsBool("DISABLE_PRECOMPILE_HEADERS")) { return std::string(); } + const cmGeneratorTarget* generatorTarget = this; + const char* pchReuseFrom = + generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM"); + const auto inserted = this->PchHeaders.insert(std::make_pair(language + config, "")); if (inserted.second) { const std::vector<BT<std::string>> headers = this->GetPrecompileHeaders(config, language); - if (headers.empty()) { + if (headers.empty() && !pchReuseFrom) { return std::string(); } std::string& filename = inserted.first->second; - const cmGeneratorTarget* generatorTarget = this; - const char* pchReuseFrom = - generatorTarget->GetProperty("PRECOMPILE_HEADERS_REUSE_FROM"); if (pchReuseFrom) { generatorTarget = this->GetGlobalGenerator()->FindGeneratorTarget(pchReuseFrom); |