mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 05:38:24 -05:00
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
This commit is contained in:
@@ -860,6 +860,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -923,6 +923,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -937,6 +937,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -972,6 +972,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1077,6 +1077,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1286,6 +1286,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1285,6 +1285,17 @@
|
|||||||
"value": "",
|
"value": "",
|
||||||
"flags": [
|
"flags": [
|
||||||
"UserValue",
|
"UserValue",
|
||||||
|
"UserRequired",
|
||||||
|
"SemicolonAppendable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ForcedIncludeFiles",
|
||||||
|
"switch": "FI",
|
||||||
|
"comment": "Forced Include File",
|
||||||
|
"value": "",
|
||||||
|
"flags": [
|
||||||
|
"UserFollowing",
|
||||||
"SemicolonAppendable"
|
"SemicolonAppendable"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ run_cmake(VsProjectImport)
|
|||||||
run_cmake(VsPackageReferences)
|
run_cmake(VsPackageReferences)
|
||||||
run_cmake(VsDpiAware)
|
run_cmake(VsDpiAware)
|
||||||
run_cmake(VsDpiAwareBadParam)
|
run_cmake(VsDpiAwareBadParam)
|
||||||
|
run_cmake(VsForceInclude)
|
||||||
run_cmake(VsPrecompileHeaders)
|
run_cmake(VsPrecompileHeaders)
|
||||||
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
|
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
|
||||||
run_cmake(VsDeployEnabled)
|
run_cmake(VsDeployEnabled)
|
||||||
|
|||||||
@@ -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()
|
||||||
@@ -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")
|
||||||
Reference in New Issue
Block a user