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>
b3f1c60aff MSVC: Use -std:c++23preview flag for C++23 when available
1b4a802413 MSVC: Split C++23 flag selection into dedicated block
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10462
Our development workflow tooling prevents trailing blank lines
from being added, but some such lines remain from before that
was enforced. Remove them to make it easier to rename files
without triggering enforcement.
The file was added by commit 3006560d86 (ENH: Add template of ctest
script, 2006-04-28, v2.6.0~3433), but we do not use it for anything.
Technically it was public-facing by being in the `Templates/` directory,
but was never documented.
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.
A C-style cast was added by commit 3f6ff4b5db (create_test_sourcelist:
add test driver option to run all tests, 2021-04-27, v3.21.0-rc1~257^2).
Use our `CM_CAST` macro to adapt based on the language.