diff options
author | Brad King <brad.king@kitware.com> | 2020-11-17 18:13:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-17 18:13:49 (GMT) |
commit | 0c0e7525c450a7fa70ca799dea033c6e08415bf8 (patch) | |
tree | 3587cdc836c6c7be4689e27cc4ca87c200556b88 | |
parent | cc80cc5116c7499d555ee8f3a12f90805c41bd60 (diff) | |
parent | 7524501d893ad4a768c104a3ac6c62ceacc6a7ab (diff) | |
download | CMake-0c0e7525c450a7fa70ca799dea033c6e08415bf8.zip CMake-0c0e7525c450a7fa70ca799dea033c6e08415bf8.tar.gz CMake-0c0e7525c450a7fa70ca799dea033c6e08415bf8.tar.bz2 |
Merge topic 'pch-header-not-generated'
7524501d89 PCH: Do not mark PCH-header as generated
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5510
-rw-r--r-- | Source/cmLocalGenerator.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2054200..8a3f285 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2607,14 +2607,16 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target) // Add pchHeader to source files, which will // be grouped as "Precompile Header File" auto pchHeader_sf = this->Makefile->GetOrCreateSource( - pchHeader, true, cmSourceFileLocationKind::Known); + pchHeader, false, cmSourceFileLocationKind::Known); std::string err; pchHeader_sf->ResolveFullPath(&err); - - // The pch file is generated, but mark it as not generated - // so that a clean operation will not remove it from disk - pchHeader_sf->SetProperty("GENERATED", "0"); - + if (!err.empty()) { + std::ostringstream msg; + msg << "Unable to resolve full path of PCH-header '" << pchHeader + << "' assigned to target " << target->GetName() + << ", although its path is supposed to be known!"; + this->IssueMessage(MessageType::FATAL_ERROR, msg.str()); + } target->AddSource(pchHeader); } } |