mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
Merge topic 'pch-warn-invalid'
2ce08e5489 PCH: add an option to disable `-Winvalid-pch`
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4499
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -368,6 +368,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
||||
initProp("DISABLE_PRECOMPILE_HEADERS");
|
||||
initProp("UNITY_BUILD");
|
||||
initPropValue("UNITY_BUILD_BATCH_SIZE", "8");
|
||||
initPropValue("PCH_WARN_INVALID", "ON");
|
||||
#ifdef __APPLE__
|
||||
if (this->GetGlobalGenerator()->IsXcode()) {
|
||||
initProp("XCODE_SCHEME_ADDRESS_SANITIZER");
|
||||
|
||||
Reference in New Issue
Block a user