summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
Commit message (Collapse)AuthorAgeFilesLines
* clang-cl: Add support for C23Yonggang Luo2025-07-011-0/+9
| | | | | | | | | | | | | 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>
* Revise C++ coding style using clang-format with "east const"Kitware Robot2025-01-234-5/+5
| | | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`, now with "east const" enforcement. Use `clang-format` version 18. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. Issue: #26123
* CMP0057: Remove support for OLD behaviorBrad King2025-01-221-1/+0
|
* VS: Restore support for mixing C++23 and C in one target with clang-clBrad King2024-12-091-0/+6
| | | | | | | | | | | | Since commit 474eafe28c (clang-cl: Add support for C++23, 2024-09-13, v3.31.0-rc1~97^2) we use a Clang-specific flag to enable C++23 since `clang-cl` has no `-std:c++23` flag, and `-std:c++latest` may enable an even newer version of C++. However, in `.vcxproj` files there is no way to express a target-wide `-clang:-std=c++23` flag for only C++ sources when the target also has C sources. Add a special case to map back to `-std:c++latest` for targets with C++23 and C together. Fixes: #26508
* Tests: Update cmake_minimum_required versions to 3.10Brad King2024-10-031-1/+1
|
* Tests/CompileFeatures: Cover hip_std_## meta-featuresBrad King2024-05-288-1/+31
|
* Tests/CompileFeatures: Cover cuda_std_## meta-featuresBrad King2024-04-198-1/+31
|
* Tests/CompileFeatures: Fix c_std_23 case with Clang < 14Brad King2024-04-191-2/+1
| | | | | | | Generalize the `__STDC_VERSION__` exception previously added for AppleClang < 14 to also cover LLVM/Clang < 14. Although the two vendors do not follow the same version scheme, the major versions happen to match in this case.
* Tests/CompileFeatures: Cover CUDA default standard levelBrad King2024-04-182-0/+17
|
* C++26: Support detection as the default standardRaul Tambre2024-04-162-1/+6
| | | | | This was missed in commit f808d8afb9 (CMake: Support upcoming C++26 language level, 2022-08-19, v3.25.0-rc1~218^2).
* C++26: Fix C++/CUDA/HIP compile feature supportRaul Tambre2024-04-092-1/+5
| | | | | | | In commit f808d8afb9 (CMake: Support upcoming C++26 language level, 2022-08-19, v3.25.0-rc1~218^2) we forgot some necessary scaffolding. Fixes: #25819
* Clang: Fix detection of C++26 when targeting MSVC ABIBrad King2024-04-091-1/+5
| | | | `_MSVC_LANG` may not be defined higher than C++20, but `__cplusplus` is.
* ci: Record expected C and CXX language standard supportBrad King2024-04-051-1/+2
| | | | | | Explicitly enable standard levels in the `CompileFeatures` test that are expected to work in each job regardless of whether compiler inspection detects support.
* Tests/CompileFeatures: Cover c_std_## and cxx_std_## meta-featuresBrad King2024-04-0512-0/+58
|
* Tests/CompileFeatures: Factor out headers to compute C and C++ standard levelsBrad King2024-04-054-59/+60
|
* GNU: Fix detection of C++ 11 mode in GCC 4.{4,5,6}Brad King2024-04-051-0/+2
| | | | | | These versions of the compiler have experimental C++11 support and so do not define `__cplusplus` correctly, but do define a feature macro we can use to distinguish this mode.
* PGI: Fix detection of C++ 14/17 modesBrad King2024-04-051-1/+1
| | | | The PGI compiler is based on EDG. Share conditions with Intel Classic.
* NVHPC: Fix detection of C++ 20 mode on NVHPC < 22.7Brad King2024-04-051-0/+6
| | | | | This compiler does not always define `__cplusplus` correctly, but does define a feature macro that we can use to distinguish this mode.
* XL/XLClang: Fix detection of C++ 14 mode on LinuxBrad King2024-04-041-0/+6
| | | | | This compiler does not always define `__cplusplus` correctly, but does define a feature macro that we can use to distinguish this mode.
* Intel: Fix detection of C++ 14/17 modes on Linux/macOSBrad King2024-04-041-0/+8
| | | | | | The Intel Classic C++ compiler is based on EDG. It does not always define `__cplusplus` correctly, but does define feature macros that we can use to distinguish these modes.
* Intel: Fix detection of C++ 17/20 modes on WindowsBrad King2024-04-041-8/+13
| | | | | | The Intel Classic C++ compiler for Windows does not always define `_MSVC_LANG` correctly, but does define feature macros that we can use to distinguish these modes.
* CompilerId: Clarify C and C++ standard level detectionBrad King2024-04-042-14/+30
| | | | Use named constants. Regularize comparison patterns.
* Tests: Fix clang -Wstrict-prototypes warningsBrad King2023-10-263-3/+3
|
* OrangeC: Add support for OrangeC compilerDavid Lindauer2023-09-251-2/+2
| | | | | | | Add compiler information modules. Update the test suite. Fixes: #25032 Co-authored-by: Brad King <brad.king@kitware.com>
* Tests: Teach CompileFeatures to tolerate __STDC_VERSION__ on Intel ClassicBrad King2023-05-011-1/+2
|
* Revise C++ coding style using clang-format-15Kitware Robot2023-01-182-2/+5
| | | | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 15. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit. Fixes: #24315
* clang-format.bash: Use generic clang-format attributeBrad King2023-01-181-1/+1
| | | | | | | Specify the clang-format version in the attribute value instead of its name. Issue: #24315
* Place language standard flags just after CMAKE_<LANG>_FLAGSBrad King2022-11-182-0/+22
| | | | | | | | | | | | | | | | Previously we added the language standard flag near the end of all options, even after those added by `add_compile_options` and friends. However, on some compilers such as MSVC, the `-std` flag may reset defaults for flags that precede it on the command line. Move the language standard flag to before all other flags that CMake adds for other abstractions, and before those added by `add_compile_options`. `CMAKE_<LANG>_FLAGS` should still precede the language flags though, because they are meant to be treated as language-wide modifications to the compiler defaults, similar to `$CC $CFLAGS`. Fixes: #23860 Fixes: #24170
* CMake: Support upcoming C++26 language levelRobert Maynard2022-08-312-0/+4
|
* IBMClang: Add support for IBM Open XL C/C++Aaron Liu2022-01-271-2/+2
| | | | Fixes: #22929
* LCC: Add dedicated support for MCST LCC compilermakise-homura2021-10-151-2/+5
| | | | | | | | | | | | | | | | | | | | | Divert LCC compiler as a new one, instead of treating it as GNU. Since old times, Elbrus C/C++/Fortran Compiler (LCC) by MCST has been passing checks for GNU compilers, so it has been identified as GNU. Now, with intent of seriously upstreaming its support, it has been added as a separate LCC compiler, and its version displays not a supported GCC version, but LCC version itself (e.g. LCC 1.25.19 instead of GNU 7.3.0). This commit adds its support for detection, and also converts basically every check like 'is this compiler GNU?' to 'is this compiler GNU or LCC?'. The only places where this check is untouched, is where it regards other platforms where LCC is unavailable (primarily non-Linux), and where it REALLY differs from GNU compiler. Note: this transition may break software that are already ported to Elbrus, but hardly relies that LCC will be detected as GNU; still such software is not known.
* Tests: Fix warning clang-analyzer-cplusplus.NewDeleteLeaksnic-kaczinsky2021-04-161-1/+1
| | | | Fix the warning: `potential leak of memory pointed to by "vp"`.
* Tests: Update for the FujitsuClang compilerYuichiro Utsumi2021-03-311-2/+2
|
* Tests: Update for the Fujitsu compilerChuck Atkins2021-03-311-2/+2
|
* C23 supportRaul Tambre2021-02-252-1/+6
|
* C17 supportRaul Tambre2021-02-252-1/+6
| | | | Implements #17755.
* Tests: Update CompileFeatures test for IntelLLVMBrad King2021-01-281-2/+2
| | | | We do not have granular features for this compiler.
* Tests: Fix CMP0115 warnings in CompileFeatures testBrad King2021-01-281-1/+4
| | | | Pass source file extensions explicitly.
* Tests: Update tests for NVHPC compilerTin Huynh2021-01-271-2/+2
| | | | Treat it just like PGI.
* CUDA, CXX, OBJCXX: C++23 support with Clang 12Raul Tambre2020-12-083-1/+13
| | | | | Clang 12 landed initial support for C++23 language mode flag -std={c|gnu}++2b in commit 6627a3c2873fdf7ccba1a1573371079be48b36e8.
* Tests: Update CompileFeatures test for Intel 19 with VS 2015Brad King2019-10-101-0/+6
| | | | | Blacklist `cxx_relaxed_constexpr` for this case because the compiler does not advertise the support in this mode but compiles our example.
* Intel: Fix default C++ dialect detection on WindowsBrad King2019-10-101-1/+11
| | | | | | For the Intel Compiler for Windows we have some subtle preprocessor checks in compiler feature detection to detect C++11 and C++14 modes. Use these when detecting the default C++ dialect too.
* CompileFeatures: Relax cxx_relaxed_constexpr compiler requirementsRobert Maynard2019-05-131-1/+2
| | | | | This in effect means that cxx_relaxed_constexpr is now supported by MSVC and Intel 18.0-18.04.
* SunPro: Record support for C++14 features by SunPro 5.{14,15}Brad King2019-04-191-0/+10
| | | | | | | | | | | SunPro 5.15 supports `-std=c++14` and several C++14 features. SunPro 5.14 accepts `-std=c++14` but does not update its definition of `__cplusplus` or any other macro to distinguish it from `-std=c++11`, so we need to blacklist a couple features that do work but that we cannot report for that version. We can still support `cxx_std_14`. Co-Author: Robert Maynard <robert.maynard@kitware.com>
* CompileFeatures: Now able to presume full language level supportRobert Maynard2019-04-091-10/+14
| | | | | | | | | Previously compilers that only supported the meta-level flags would not have any of the granular features listed. Now we presume that they have full support and enable all the features. Update granular feature tests to skip the actual compilation checks for the presumed features.
* Tests: Remove outdated portion of CompileFeatures genex testBrad King2019-04-091-11/+0
| | | | | | The genex part of the test verifies that `$<COMPILE_FEATURES:...>` evaluates as expected. It does not need to actually try using code with the associated features, as that is tested separately.
* Features: Do not use a lower-than-default standard for requested featuresZsolt Parragi2019-02-262-4/+4
| | | | | | | | `AddRequiredTargetC(xx)` feature didn't take the default compiler standard into account, which possibly resulted in the use of an older standard when some features requested it. Fixes: #18686
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-019-95/+93
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* clang-format.bash: update to clang-format-6.0Brad King2018-06-011-1/+1
| | | | | | | | | | | | Update `.clang-format` with configuration to make the 6.0 format as close as possible to what 3.8 produced before. Then revise the style: * Indent preprocessor directives (a feature new since 3.8) * Add a newline and indentation before inheritance `:` and `,` Rename the Git attribute identifying the format to include the clang-format version number: `format.clang-format-6.0`. This will aid external infrastructure in knowing what version of the tool to run.
* Tests: Simplify CompileFeatures expectation logicBrad King2018-04-061-174/+44
| | | | | | Rather than repeating compiler version checks for feature availability, generate genex expectations using the detect list of features. We already separately verify that the list of features is correct.