summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/MSVC-C.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Compile with explicit language flag when source LANGUAGE property is setBrad King2020-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This change was originally made by commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2), but it was reverted by commit 30aa715fac (Revert "specify language flag when source LANGUAGE property is set", 2020-11-19) to restore compatibility with pre-3.19 behavior. Implement the change again, but add policy CMP0119 to make this change while preserving compatibility with existing projects. Note that the `Compiler/{Clang,Intel,MSVC}-CXX` modules do not need to specify `-TP` for their MSVC-like variants because we already use the flag in `CMAKE_CXX_COMPILE_OBJECT`. Similarly for `Compiler/XL-CXX` and `Platform/Windows-Embarcadero`. Note also that this does not seem possible to implement for XL C. Even with `-qsourcetype=c`, `xlc` complains about an unknown suffix: `1501-218 (W) file /.../AltExtC.zzz contains an incorrect file suffix`. It returns non-zero even with `-qsuppress=1501-218`. Co-Author: Robert Maynard <robert.maynard@kitware.com> Fixes: #14516, #20716
* MSVC: Record support for c_static_assertRaul Tambre2020-08-201-0/+4
| | | | Supported since MSVC 19.28.29115 (VS 16.8.0 Preview 1.0).
* MSVC: Record support for C11 and c_restrictRaul Tambre2020-08-111-11/+31
| | | | | | | MSVC >=19.27 supports a C11 switch. The `c_restrict` feature has also been implemented. Fixes: #21069
* clang-tidy: Add driver mode argumentHanjiang Yu2020-01-271-0/+2
| | | | | | | `clang-tidy` does not infer driver mode if it is not provided with a JSON compilation database. This is exactly the way cmake launches it. Hence clang-tidy will only use the default driver mode. Add an explicit driver mode argument to avoid this.
* MSVC: Add support for /JMC (Just My Code)Luca Cappa2019-05-141-0/+5
|
* CompileFeatures: Fix hard-coded MSVC C featuresBrad King2019-04-221-2/+6
| | | | | | | | | | | | In commit 8e4899fd6c (CompileFeatures: Record which C features the MSVC compiler supports, 2019-04-12) our `cmake_record_c_compile_features` macro was accidentally left not setting the `_result` variable, which had previously been set by `_record_compiler_features`. The variable is expected by the call site in `cmake_determine_compile_features` and used to switch between "failed" and "done" reports. Set it now. Also record `c_variadic_macros` only for cl 14 (VS 2005) and higher because it is not supported before that version.
* CompileFeatures: Record which C features the MSVC compiler supportsRobert Maynard2019-04-121-3/+7
| | | | | | Use the infrastructure added by commit f92ccbc306c20554af (CompileFeatures: memoize C compilers with full language level support) to avoid using a `try_compile` to check for C 90/99/11 feature support when the running compiler is known to have a fixed set of feature support.
* Features: Record C features for MSVCBrad King2018-03-291-0/+25
The MSVC C compiler has no notion of C language standards or flags. Tell CMake to assume that all language standards are available. Record available C language features depending on the version of the compiler. Fixes: #17858