summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Merge topic 'features-c++20'Brad King2018-04-022-1/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 8570dc7f64 Help: Update compiler versions in cmake-compile-features.7.rst 874d3d2948 Help: Add release note for C++ 20 support 7f295b1bd3 Features: Activate C++ 20 support for Clang 5.0+ 71cb8ce3a1 Features: Activate C++ 20 support for GNU 8.0+ 8f146c4508 Features: Activate C++ 20 support for MSVC 19.12.25835+ 7fe580a362 Features: Add infrastructure for C++ 20 language standard 1b328e09a3 Features: Use -std=c++17 for C++ 17 on Clang 5.0+ 0bc3e5788a Features: Use -std=c++17 for C++ 17 on GNU 8.0+ Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1892
| * Features: Add infrastructure for C++ 20 language standardBrad King2018-03-272-1/+7
| | | | | | | | Issue: #17849
* | Features: Record C features for MSVCBrad King2018-03-291-0/+5
| | | | | | | | | | | | | | | | | | 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
* | Features: Do not assume c_restrict support in CompileFeatures testBrad King2018-03-281-1/+11
| | | | | | | | Define `EXPECT_C_RESTRICT` separately for each compiler.
* | Features: Fix CompileFeatures test checks for CBrad King2018-03-281-3/+9
|/ | | | Compare the HAVE_ and EXPECT_ macros as we do for CXX.
* Features: Record initializer list support for Intel 14 and aboveBrad King2018-03-161-0/+6
| | | | | | | | | | | | | | | Features recorded by commit v3.6.0-rc1~120^2~5 (Features: Record standards and features for Intel C++ on UNIX, 2016-04-28) for the Intel compiler left out initializer list support because our test case in `Tests/CompileFeatures/cxx_generalized_initializers.cpp` caused an internal compiler error. It turns out this is because the Intel compiler asserts the `initializer_list` constructor signatures to verify that they match its own `<initializer_list>` header. It was our dummy implementation used to test the language feature without any headers that caused the ICE. Revise it to use a constructor signature accepted by the Intel compiler. Fixes: #17829
* Tests: Make CompileFeatures C dialect check consistent with implBrad King2018-02-211-1/+1
| | | | | | | | `Modules/CMakeCCompilerId.c.in` will report the C dialect as 11 whenever `__STDC_VERSION__` indicates *at least* C 11. Make the test consistent with this. We already do this for the C++ case. Fixes: #17740
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-303-11/+12
|
* Features: Fix COMPILE_FEATURES genex for C++ 14 and 17 featuresBrad King2017-08-082-0/+20
| | | | | | When `CXX_STANDARD` is not at least 14 or 17, features enabled by the compiler for those standards should not be reported as existing by the `COMPILE_FEATURES` genex. Fix the implementation and add a test.
* MSVC: Add flags for C++ language standardsBrad King2017-07-171-9/+14
| | | | | | | | | | | Visual Studio 2015 Update 3 introduced the notion of language standard levels to MSVC. The language standard level is defined in `_MSVC_LANG` instead of `__cplusplus`. It also added support for the `-std:c++14` and `-std:c++latest` flags, although the compiler defaults to its C++14 mode anyway. Visual Studio 2017 Update 3 will introduce support for the `-std:c++17` flag. Fixes: #16482
* CompileFeatures: Makes tests work with meta-feature onlyChuck Atkins2017-05-291-6/+17
|
* Features: Record features for SunPro C 5.13 and 5.14Brad King2017-05-112-1/+12
|
* clang-format.bash: Use Git attributes to mark files for formattingBrad King2017-02-221-0/+2
|
* CompileFeatures Test: make sure the target "CompileFeatures" is always definedRolf Eike Beer2017-01-301-10/+8
| | | | | | Everything in there guards against unsupported compilers already, so no need to skip the whole file if no features are defined. This in turn allows to have a simpler fallback in case there is no C++ auto_type feature available.
* Tests: use cxx_auto_type only if actually availableRolf Eike Beer2017-01-251-0/+3
| | | | | The presence of CMAKE_CXX_COMPILE_FEATURES doesn't mean cxx_auto_type is always available.
* Features: Add infrastructure for C++ 17 language standardBrad King2016-12-022-2/+7
| | | | Issue: #16468
* Features: Suppress c_static_assert test coverage on Intel <= 15Brad King2016-11-101-0/+9
| | | | It works on some pre-15.0.2 versions but not others.
* Features: Test feature propagation with language standard meta-featureBrad King2016-11-021-4/+4
| | | | | | | The `cxx_static_assert` feature may be available in C++ 98 mode of some compilers or not available at all in others. Intstead of using an individual feature to test propagation of a feature requiring C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning.
* Features: Add meta-features requesting awareness of a particular standardBrad King2016-11-021-0/+2
| | | | | | | | | | A common use case of `target_compile_features` is simply to specify that the compiler should be run in a mode that is aware of e.g. C++11. Some projects simply specify a particular C++11-only feature to request this. Provide a first-class way to do this by naming features after the corresponding language standard. Record them as always available in the corresponding standard level so that requesting them always ensures that standard (or higher) is used.
* Features: Fix cxx_right_angle_brackets compiler feature testAlex Wang2016-10-251-1/+3
| | | | | | | The clang-format pass in commit v3.6.0-rc1~54^2~1 (Revise C++ coding style using clang-format, 2016-05-16) changed the template right angle brackets from `>>` to `> >`, which defeats the purpose of this test. Change it back and exclude this content from formatting.
* Revise C++ coding style using clang-formatKitware Robot2016-05-1642-192/+243
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Tests: Protect unicode literals from clang-format Cpp03 formattingBrad King2016-05-111-0/+2
| | | | | | | | | | | Since CMake is written in C++98 any clang-format configuration must set `Standard` to `Cpp03` so that `A<A<int> >` is not rewritten as `A<A<int>>`. However, this will cause `U"foo"` to be rewritten as `U "foo"`. Add markup to turn clang-format off in the one place that the latter case occurs so that we do not need a separate `.clang-format` config file for it. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>