summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-27 12:03:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-03-27 12:03:30 (GMT)
commitf6704357159366fc404491e02f1ea6cee87f0989 (patch)
treea75b6eb21ecb556276b2b4c09424ee1321d24b0c /Source/cmGeneratorTarget.cxx
parentcc1d5a436b4b2b7630b892890989d3b5ef59dba9 (diff)
parent2ce08e54891054aeba3f273f9970a7fe8fa8b66c (diff)
downloadCMake-f6704357159366fc404491e02f1ea6cee87f0989.zip
CMake-f6704357159366fc404491e02f1ea6cee87f0989.tar.gz
CMake-f6704357159366fc404491e02f1ea6cee87f0989.tar.bz2
Merge topic 'pch-warn-invalid'
2ce08e5489 PCH: add an option to disable `-Winvalid-pch` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4499
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index af95089..e722034 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3781,9 +3781,16 @@ std::string cmGeneratorTarget::GetPchCreateCompileOptions(
if (inserted.second) {
std::string& createOptionList = inserted.first->second;
+ if (this->GetPropertyAsBool("PCH_WARN_INVALID")) {
+ createOptionList = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_INVALID_PCH"));
+ }
+
const std::string createOptVar =
cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_CREATE_PCH");
- createOptionList = this->Makefile->GetSafeDefinition(createOptVar);
+
+ createOptionList = cmStrCat(
+ createOptionList, ";", this->Makefile->GetSafeDefinition(createOptVar));
const std::string pchHeader = this->GetPchHeader(config, language);
const std::string pchFile = this->GetPchFile(config, language);
@@ -3802,9 +3809,16 @@ std::string cmGeneratorTarget::GetPchUseCompileOptions(
if (inserted.second) {
std::string& useOptionList = inserted.first->second;
+ if (this->GetPropertyAsBool("PCH_WARN_INVALID")) {
+ useOptionList = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_INVALID_PCH"));
+ }
+
const std::string useOptVar =
cmStrCat("CMAKE_", language, "_COMPILE_OPTIONS_USE_PCH");
- useOptionList = this->Makefile->GetSafeDefinition(useOptVar);
+
+ useOptionList = cmStrCat(useOptionList, ";",
+ this->Makefile->GetSafeDefinition(useOptVar));
const std::string pchHeader = this->GetPchHeader(config, language);
const std::string pchFile = this->GetPchFile(config, language);