From c5c218fa0d00c0aa06bf51fafadd8e71f2c549fb Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 13 Dec 2019 01:12:15 +0100 Subject: PCH: Append pch header file to list of forced include files Fixes: #20088 --- Source/cmVisualStudio10TargetGenerator.cxx | 3 +++ Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 94b6495..ed09471 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2399,6 +2399,9 @@ void cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( clOptions.AppendFlag("DisableSpecificWarnings", "%(DisableSpecificWarnings)"); } + if (clOptions.HasFlag("ForcedIncludeFiles")) { + clOptions.AppendFlag("ForcedIncludeFiles", "%(ForcedIncludeFiles)"); + } if (configDependentDefines) { clOptions.AddDefines( genexInterpreter.Evaluate(configDefines, "COMPILE_DEFINITIONS")); diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake b/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake index 27842f9..91cea0e 100644 --- a/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake +++ b/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake @@ -31,7 +31,7 @@ foreach(line IN LISTS tgt_projects_strings) set(have_pch_header ON) endif() - if (line MATCHES ".*${pch_header}") + if (line MATCHES ".*${pch_header}.*") set(have_force_pch_header ON) endif() -- cgit v0.12