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 | 6cb9867ba3054ea4fbafa7ee60485db4d6266354 (patch) | |
tree | fb624526a0dc065f41af9397eff3a3f0426e46e4 /Source | |
parent | fc4f00cbf64c6f192b36e7b9187fc26a1f51a4b4 (diff) | |
parent | bb4c2781ced335c81b3c9307069792dba66d5062 (diff) | |
download | CMake-6cb9867ba3054ea4fbafa7ee60485db4d6266354.zip CMake-6cb9867ba3054ea4fbafa7ee60485db4d6266354.tar.gz CMake-6cb9867ba3054ea4fbafa7ee60485db4d6266354.tar.bz2 |
Merge topic 'pch-reuse-no-prop' into release-3.16
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')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 9 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 7 |
2 files changed, 7 insertions, 9 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); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 99c16f2..2db89de 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1288,11 +1288,8 @@ void cmTarget::SetProperty(const std::string& prop, const char* value) reusedTarget->SetProperty("COMPILE_PDB_OUTPUT_DIRECTORY", cmStrCat(reusedFrom, ".dir/").c_str()); - for (auto p : { "COMPILE_PDB_NAME", "PRECOMPILE_HEADERS", - "INTERFACE_PRECOMPILE_HEADERS" }) { - this->SetProperty(p, reusedTarget->GetProperty(p)); - } - + this->SetProperty("COMPILE_PDB_NAME", + reusedTarget->GetProperty("COMPILE_PDB_NAME")); this->AddUtility(reusedFrom, impl->Makefile); } else { impl->Properties.SetProperty(prop, value); |