diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-11-13 13:58:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-11-15 14:47:56 (GMT) |
commit | bb4c2781ced335c81b3c9307069792dba66d5062 (patch) | |
tree | ea358abcc1a7c33124e161225c339eaf32b67977 /Source/cmGeneratorTarget.cxx | |
parent | 28bc41ca62b00d5c265c83436f317f970a4b9a93 (diff) | |
download | CMake-bb4c2781ced335c81b3c9307069792dba66d5062.zip CMake-bb4c2781ced335c81b3c9307069792dba66d5062.tar.gz CMake-bb4c2781ced335c81b3c9307069792dba66d5062.tar.bz2 |
PCH: Do not issue an error on duplicate target_precompile_headers call
Fixes: #19970
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 d38e9e1..171c3ed 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3344,19 +3344,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); |