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:
Brad King 2022-04-01 16:37:08 -04:00
parent 6e1be5dbef
commit 20cd951c9f
10 changed files with 101 additions and 0 deletions

View File

@ -860,6 +860,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -923,6 +923,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -937,6 +937,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -972,6 +972,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -1077,6 +1077,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -1286,6 +1286,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -1285,6 +1285,17 @@
"value": "",
"flags": [
"UserValue",
"UserRequired",
"SemicolonAppendable"
]
},
{
"name": "ForcedIncludeFiles",
"switch": "FI",
"comment": "Forced Include File",
"value": "",
"flags": [
"UserFollowing",
"SemicolonAppendable"
]
},

View File

@ -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)

View File

@ -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()

View File

@ -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")