summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/VS10Project
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-04-01 20:37:08 (GMT)
committerBrad King <brad.king@kitware.com>2022-04-01 20:37:08 (GMT)
commit20cd951c9f4dff5230a9b22adbc6c4dbd0d6e233 (patch)
tree7369d72633ff22ef0fef377214fa8d0f65f426b1 /Tests/RunCMake/VS10Project
parent6e1be5dbefab3e7317502e3d0fe4b132d0162ae5 (diff)
downloadCMake-20cd951c9f4dff5230a9b22adbc6c4dbd0d6e233.zip
CMake-20cd951c9f4dff5230a9b22adbc6c4dbd0d6e233.tar.gz
CMake-20cd951c9f4dff5230a9b22adbc6c4dbd0d6e233.tar.bz2
VS: Add compiler flag table entry for -FI followed by separate argument
The MSVC `/FI` flag accepts an attached value or a following argument. Previously our flag tables only had entries for the former. Add the latter. Fixes: #23382
Diffstat (limited to 'Tests/RunCMake/VS10Project')
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/VS10Project/VsForceInclude-check.cmake18
-rw-r--r--Tests/RunCMake/VS10Project/VsForceInclude.cmake5
3 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index b19c1a8..273b9d5 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -35,6 +35,7 @@ run_cmake(VsProjectImport)
run_cmake(VsPackageReferences)
run_cmake(VsDpiAware)
run_cmake(VsDpiAwareBadParam)
+run_cmake(VsForceInclude)
run_cmake(VsPrecompileHeaders)
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
run_cmake(VsDeployEnabled)
diff --git a/Tests/RunCMake/VS10Project/VsForceInclude-check.cmake b/Tests/RunCMake/VS10Project/VsForceInclude-check.cmake
new file mode 100644
index 0000000..8906e92
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsForceInclude-check.cmake
@@ -0,0 +1,18 @@
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file does not exist:\n ${tgt_project}\n")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings REGEX ForcedIncludeFiles)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "<ForcedIncludeFiles>force_include_1.h;force_include_2.h</ForcedIncludeFiles>")
+ set(have_FI ON)
+ endif()
+endforeach()
+
+if (NOT have_FI)
+ set(RunCMake_TEST_FAILED "Generated project does not have expected ForcedIncludeFiles.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsForceInclude.cmake b/Tests/RunCMake/VS10Project/VsForceInclude.cmake
new file mode 100644
index 0000000..fa1f544
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsForceInclude.cmake
@@ -0,0 +1,5 @@
+enable_language(CXX)
+
+add_library(tgt STATIC empty.cxx)
+target_compile_options(tgt PRIVATE "SHELL:/FI force_include_1.h")
+target_compile_options(tgt PRIVATE "/FIforce_include_2.h")