Apply the change from commit 937f454fb9 (VS: Remove C++ module CompileAs
flag table entries for v142 and v143, 2021-07-26, v3.21.1~3^2) to the
v145 flag table.
Apply the change from commit 919fc7fd5f (VS: Remove broken EnableASAN
entry from flag table for v143, 2021-07-14, v3.21.1~29^2~2) to the v145
flag table. Extend it to the fuzzer variant too.
Apply the change from commit 3f9ef3703a (VS: Fix /reference and
/headerUnit flag table entries for v142 and v143, 2021-08-10,
v3.21.2~11^2) to the v145 flag table.
Apply the change from commit 20cd951c9f (VS: Add compiler flag table
entry for -FI followed by separate argument, 2022-04-01,
v3.24.0-rc1~351^2) to the v145 flag table.
Apply the change from commit a070d87e08 (VS: Populate `-Qspectre-` flag
table entry for v143, 2021-07-14, v3.21.1~29^2~7) to the v145 flag
table. Sort the longer options before the shorter ones. Remove the
default variant with an empty switch.
Apply the pattern from commit 1ac1436b25 (VS: Fix `/sourceDependencies`
flag table entries for v143, 2021-07-14, v3.21.1~29^2~1) to the v145
flag table.
Also map `/sourceDependencies:directives` to `/scanDependencies` as we
do for the v142 and v143 toolsets.
Apply the change from commit 0031d5effa (VS: Add `/arch:NotSet` flag
table entries for v14x toolsets, 2023-09-27, v3.28.0-rc1~36^2) to the
v145 flag table.
Run the commands
python3 Source/cmConvertMSBuildXMLToJSON.py -t v145 \
'c:/.../18/Insiders/MSBuild/Microsoft/VC/v180/1033/cl.xml'
python3 Source/cmConvertMSBuildXMLToJSON.py -t v145 \
'c:/.../18/Insiders/MSBuild/Microsoft/VC/v180/1033/cl.xml'
To generate `Templates/MSBuild/FlagTables/v143_{CL,Link}.json`.
We can reuse `Templates/MSBuild/FlagTables/v14_LIB.json`.
While the flag tables for C and C++ were generated from MSBuild `.xml`
files, the CSharp flag tables were written by hand. Copy the `v143`
flag table to use for the `v145` toolset.
Although there is no `cl -std:c23` flag, the underlying Clang compiler
does have a C23 mode we can activate by passing `-std=c23` through a
`clang-cl` wrapper flag.
Also port the fix from commit 30139913e9 (VS: Restore support for mixing
C++23 and C in one target with clang-cl, 2024-12-09, v3.31.3~10^2).
Fixes: #27038
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Brad King <brad.king@kitware.com>
As of VS 17.6, MSBuild maps `ModuleDependenciesFile` to this flag
instead of the older `-sourceDependencies:directives` flag.
Map both flags to `ModuleDependenciesFile` for compatibility.
The Ninja and Makefile generators honor `target_compile_options` and
friends for ASM_NASM `.asm` sources. Teach the VS generator to
honor them too for consistency.
Issue: #24289
The Ninja and Makefile generators honor `target_compile_options` and
friends for ASM_MARMMASM `.asm` sources. Teach the VS generator to
honor them too for consistency.
Issue: #24289
The C# flag table added by commit 9b06c22648 (VS: Add flag tables for
C#, 2016-12-01, v3.8.0-rc1~230^2) and preserved by commit 6e947179a8
(Add json flag tables for C#, 2018-11-21, v3.14.0-rc1~282^2~27) was
written by hand. Fix the entry name for the `NoStdLib` property.
Fixes: #24077
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
Apply the change from commit db35e3cfd6 (VS: Fix support for '/guard:cf'
linker flag for v142, 2019-01-24, v3.14.0-rc1~74^2~2) to the v143 flag
table.
The entry for `LinkControlFlowGuard` in `v143_Link.json` does not work
when used in a `.vcxproj` file. Drop our link flag table entries for
this toolset so that the flag will be passed via `AdditionalOptions`.
Also add a test case.
The `CompileAs` entry in a `.vcxproj` file with values:
* `CompileAsCppModule` for `-interface`
* `CompileAsCppModuleInternalPartition` for `-internalPartition`
* `CompileAsHeaderUnit` for `-exportHeader`
does not cause the corresponding flag to be added to the command line.
Drop the flag table entries so that the flags go to `AdditionalOptions`.
Fixes: #22477
Revise the `/sourceDependencies[:directives]` table entries to properly
distinguish the two options (because one is a prefix of the other), and
to populate both `Generate*Dependencies` and `*DependenciesFile`.
This is the manual update mentioned in commit 887e9df0c7 (VS: Update
v142 CL flag table for VS 16.10, 2021-06-04, v3.21.0-rc1~77^2).
Apply the change from commit 7fce2d372e (VS: Revert "Add support for
ASAN -fsanitize=address flag", 2021-04-26, v3.21.0-rc1~270^2) to the
v143 flag table.
Issue: #21081
Apply the change from commit 43aa632f57 (VS: Populate `-Qspectre-` flag
table entry for v142, 2019-01-24, v3.14.0-rc1~74^2~7) to the v143 flag
table. Sort the longer options before the shorter ones. Remove the
default variant with an empty switch.