mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-01-26 11:04:33 +00:00
PrecompileHeaders: downgrade REUSE_FROM without a PCH to a warning
Prior to f9bc615d (pchreuse: ban PCH reuse from targets which disable PCH, 2025-06-15), using a target without PCH as a `REUSE_FROM` target was not an error. Some projects had been doing this unknowingly. Downgrade the fatal error into a warning so that such projects can at least continue to build. Fixes: #27316
This commit is contained in:
parent
4b5233e3e7
commit
cb6423703a
@ -2906,10 +2906,10 @@ cmGeneratorTarget const* cmGeneratorTarget::GetPchReuseTarget() const
|
||||
if (generatorTarget) {
|
||||
if (generatorTarget->GetPropertyAsBool("DISABLE_PRECOMPILE_HEADERS")) {
|
||||
this->Makefile->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
MessageType::WARNING,
|
||||
cmStrCat(
|
||||
"Target \"", *pchReuseFrom, "\" for the \"", this->GetName(),
|
||||
R"(" target's "PRECOMPILE_HEADERS_REUSE_FROM" property has set "DISABLE_PRECOMPILE_HEADERS".)"));
|
||||
R"(" target's "PRECOMPILE_HEADERS_REUSE_FROM" property has set "DISABLE_PRECOMPILE_HEADERS"; ignoring.)"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -2959,10 +2959,10 @@ cmGeneratorTarget* cmGeneratorTarget::GetPchReuseTarget()
|
||||
if (generatorTarget) {
|
||||
if (generatorTarget->GetPropertyAsBool("DISABLE_PRECOMPILE_HEADERS")) {
|
||||
this->Makefile->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
MessageType::WARNING,
|
||||
cmStrCat(
|
||||
"Target \"", *pchReuseFrom, "\" for the \"", this->GetName(),
|
||||
R"(" target's "PRECOMPILE_HEADERS_REUSE_FROM" property has set "DISABLE_PRECOMPILE_HEADERS".)"));
|
||||
R"(" target's "PRECOMPILE_HEADERS_REUSE_FROM" property has set "DISABLE_PRECOMPILE_HEADERS"; ignoring.)"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
1
|
||||
@ -1,4 +1,4 @@
|
||||
CMake Error in CMakeLists\.txt:
|
||||
CMake Warning in CMakeLists\.txt:
|
||||
Target "pch-generator" for the "reuse_from_nopch" target's
|
||||
"PRECOMPILE_HEADERS_REUSE_FROM" property has set
|
||||
"DISABLE_PRECOMPILE_HEADERS".
|
||||
"DISABLE_PRECOMPILE_HEADERS"; ignoring.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user