summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmLocalGenerator.cxx6
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW-empty.cmake4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake3
3 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index fb269b2..b2b724a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2677,8 +2677,10 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
bool editAndContinueDebugInfo = false;
bool programDatabaseDebugInfo = false;
- if (cm::optional<std::string> msvcDebugInformationFormat =
- this->GetMSVCDebugFormatName(config, target)) {
+ cm::optional<std::string> msvcDebugInformationFormat =
+ this->GetMSVCDebugFormatName(config, target);
+ if (msvcDebugInformationFormat &&
+ !msvcDebugInformationFormat->empty()) {
editAndContinueDebugInfo =
*msvcDebugInformationFormat == "EditAndContinue";
programDatabaseDebugInfo =
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW-empty.cmake b/Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW-empty.cmake
new file mode 100644
index 0000000..41c7d22
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFrom-CMP0141-NEW-empty.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0141 NEW)
+set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "")
+string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -Zi")
+include(PchReuseFrom-common.cmake)
diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
index 687fc0e..b163369 100644
--- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
@@ -17,6 +17,9 @@ run_test(SkipPrecompileHeaders)
run_test(CXXnotC)
run_test(PchReuseFrom-CMP0141-OLD)
run_test(PchReuseFrom-CMP0141-NEW)
+if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+ run_test(PchReuseFrom-CMP0141-NEW-empty)
+endif()
run_test(PchReuseFromPrefixed)
run_test(PchReuseFromSubdir)
run_cmake(PchMultilanguage)