summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures/CMakeLists.txt
Commit message (Collapse)AuthorAgeFilesLines
* 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-021-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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-271-0/+2
| | | | | | | | 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 COMPILE_FEATURES genex for C++ 14 and 17 featuresBrad King2017-08-081-0/+8
| | | | | | 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.
* 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-111-0/+10
|
* 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-021-1/+2
| | | | 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: Record standards and features for Intel C on UNIXRobert Maynard2016-04-281-0/+10
| | | | | Record features for Intel C 12.1 and above. Skip this for now on Windows (where Intel C simulates MSVC).
* Features: Record standards and features for Intel C++ on UNIXLevi Morrison2016-04-281-0/+72
| | | | Skip this for now on Windows (where Intel C++ simulates MSVC).
* Features: Update MSVC features for VS 2015 RTMBrad King2015-07-211-6/+0
| | | | | VS 2015 RTM completed support for constexpr and attribute features. Update our feature table and test accordingly.
* Features: Fix C90 feature detection.Stephen Kelly2015-02-041-0/+32
| | | | | | | | | | | | | | | This bug caused c_function_prototypes to not be recorded at configure time when compiling with -std=gnu99 or similar. In the case of feature recording, that was not a problem, because the logic in CMakeDetermineCompileFeatures.cmake currently assumes that a feature present for an earlier standard is present for a later standard. However, the detection strings are also used in WriteCompilerDetectionHeader, so the feature macro has been defined to '0' when using a later language dialect. Fix that by not checking the existence of the __STDC_VERSION__ macro at all when detecting C90 features.
* Features: Record for MSVC 2010-2015Robert Maynard2015-01-301-0/+48
| | | | | | | Also, in WCDH add MSVC Compatibility for cxx_align{of,as}. Co-Author: Stephen Kelly <steveire@gmail.com> Co-Author: Brad King <brad.king@kitware.com>
* Features: Define meaning for no language standard defaultBrad King2015-01-291-16/+20
| | | | | | | | | | | | Define an empty string in CMAKE_<LANG>_STANDARD_DEFAULT to mean that the toolchain has no notion of lanuage standard levels. In this case the <LANG>_STANDARD[_REQUIRED] properties will have no effect. Update the RunCMake.CompileFeatures test to exclude the LinkImplementationFeatureCycle test when there is no standard default. It can never fail because no use of specific features will adjust the CXX_STANDARD level required for any target since the standard levels have no meaning in this case.
* Merge topic 'GNU-4.4-compile-features'Brad King2015-01-231-0/+8
|\ | | | | | | | | 374a66b5 Features: Blacklist raw string literals test for GNU 4.4
| * Features: Blacklist raw string literals test for GNU 4.4Brad King2015-01-221-0/+8
| | | | | | | | | | RedHat gcc 4.4.7-11 supports raw string literals, so simply blacklist the test for its rejection.
* | Merge topic 'GNU-4.4-compile-features'Brad King2015-01-221-1/+2
|\ \ | |/ | | | | | | | | | | 965a50dc Features: Fix GNU 4.4 and 4.5 C standard level flags 7f4154a4 Features: Fix CompileFeatures non-feature tests for space in path f40c19b5 Features: Fix CompileFeatures test for C non-features
| * Features: Fix CompileFeatures non-feature tests for space in pathBrad King2015-01-211-1/+2
| | | | | | | | | | | | Fix the <lang>_non_features try_compile calls to work correctly when there is a space in the path. Otherwise they all fail due to the space instead of the lack of a feature.
* | Merge topic 'GNU-4.4-compile-features'Brad King2015-01-191-3/+11
|\ \ | |/ | | | | | | | | | | | | | | | | | | 004e1540 Features: Record for GNU 4.4. 2a5ca650 Features: Wrap failure-test in UNIX condition. 1ae2c6b2 Features: Blacklist cxx_constexpr test for GNU 4.5. c66e3317 Features: Use a more-common feature in cycle-test. c43a6dc5 Features: Update comment in test to match the code. 78259135 Features: Test presence of cxx_auto_type with genex. 7b9fc88b Features: Remove outdated comment.
| * Features: Blacklist cxx_constexpr test for GNU 4.5.Stephen Kelly2015-01-181-0/+8
| |
| * Features: Test presence of cxx_auto_type with genex.Stephen Kelly2015-01-171-3/+3
| | | | | | | | | | | | The purpose of that test is to cover the case where the genex reports '1', and the feature is chosen to be present on all/most supported compilers. GNU 4.4 does not support cxx_nullptr.
* | Features: Record for SolarisStudio 12.4.Stephen Kelly2015-01-171-0/+18
|/ | | | It has similar C++11 capabilities compared to GCC 4.8.
* Features: Record for GNU 4.6.Stephen Kelly2015-01-151-2/+6
| | | | | Adjust the CompileFeatures genex_test for the expectation of the OVERRIDE_CONTROL feature group.
* Features: Extend the tests for the COMPILE_FEATURES genex.Stephen Kelly2015-01-151-0/+51
|
* Features: Record for historical Xcode clang versions.Stephen Kelly2015-01-111-0/+20
|
* Features: Quote all compiler names when comparing with COMPILER_IDRobert Maynard2015-01-111-3/+3
| | | | | In preparation of adding MSVC support we need to quote all compiler names, as MSVC is also a CMake variable.
* Features: Add a comment explaining part of test.Stephen Kelly2015-01-031-0/+2
|
* Features: Test nullptr as a side-effect activation of static_assert.Stephen Kelly2015-01-031-3/+12
| | | | | | Because not all compilers under test support the existing 'activation features', add another test to ensure that compilers which support both static_assert and nullptr behave as expected in this test.
* Features: Test feature propagation with more-common features.Stephen Kelly2015-01-031-4/+4
| | | | | | | | | The purpose of the feature listing in these tests is to make other features from the same feature set (eg "C++11 features") available. The compilers under test until now have supported these 'activation features', but MSVC does not. Use the cxx_static_assert feature instead to activate the feature set.
* Features: Test an expectation of whether OVERRIDE_CONTROL is expectedStephen Kelly2015-01-031-0/+2
| | | | | | | | | The tests below test the presence of both cxx_final and cxx_override, only one of which is supported by MSVC. The test is in part intended to verify that the COMPILE_FEATURES genex supports multiple arguments and allows users to define names for groups of features (Clang already calls cxx_final and cxx_override 'override control' as a group). Keep the test, and allow the expectation to be set as appropriate.
* Features: Fix the default C dialect for Clang and GNU.Stephen Kelly2014-11-201-0/+22
| | | | | | | | | | | | | | Clang 3.4 uses C99 by default, and Clang 3.6 uses C11 by default: http://thread.gmane.org/gmane.comp.compilers.clang.devel/39379 GNU 4.9 uses C90 by default, and GNU 5.0 uses C11 by default: https://gcc.gnu.org/gcc-5/changes.html Test that the default compiler settings result in the expected dialect macros being defined for both C and CXX. Remove the unused main.c file from the CompileFeatures unit test.
* Features: Test the CXX compiler only if it has features.Stephen Kelly2014-11-181-28/+30
| | | | | If using different C and CXX compilers, we might not have a feature-full CXX compiler at this point.
* Features: Add support for C++14 features.Stephen Kelly2014-05-221-1/+14
| | | | Record the features implemented by GNU 4.9 and Clang 3.4.
* Features: Add COMPILE_FEATURES generator expression.Stephen Kelly2014-05-211-0/+14
| | | | | | | | | | | | Allow setting build properties based on the features available for a target. The availability of features is determined at generate-time by evaluating the link implementation. Ensure that the <LANG>_STANDARD determined while evaluating COMPILE_FEATURES in the link implementation is not lower than that provided by the INTERFACE of the link implementation. This is similar to handling of transitive properties such as POSITION_INDEPENDENT_CODE.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-2/+8
| | | | | | | | | | | Add properties and variables corresponding to CXX equivalents. Add features for c_function_prototypes (C90), c_restrict (C99), c_variadic_macros (C99) and c_static_assert (C11). This feature set can be extended later. Add a <PREFIX>_RESTRICT symbol define to WriteCompilerDetectionHeader to conditionally represent the c_restrict feature.
* Test: Parameterize the language in the CompileFeature test.Stephen Kelly2014-05-091-19/+23
|
* Tests: Make CompileFeature tests use highest standard known.Stephen Kelly2014-05-091-3/+19
| | | | | | | | Remove the use of check_cxx_source_compiles which is now just getting in the way. Blacklist the cxx_alignof feature in the test with GNU 4.7. The test file compiles, but it is documented as available first in GNU 4.8.
* Merge topic 'GNU-4.7-features'Brad King2014-05-081-7/+18
|\ | | | | | | | | 9cbc63e4 Features: Record for GNU 4.7.
| * Features: Record for GNU 4.7.Stephen Kelly2014-05-071-7/+18
| | | | | | | | | | Update the CompileFeatures test to verify that unsupported features do not work.
* | cmTarget: Add CXX_STANDARD_REQUIRED to control decay.Stephen Kelly2014-05-071-0/+3
|/
* Features: Make CMAKE_CXX_KNOWN_FEATURES a property.Stephen Kelly2014-05-021-1/+2
| | | | | As a 'built-in' variable it imposes a cost on all variable lookups and it is expected to be rarely used.
* Tests: Execute compile features tests unconditionally.Stephen Kelly2014-04-171-0/+8
| | | | Conditionally create a dummy test if there are no known features.
* cmTarget: Transitively evaluate compiler features.Stephen Kelly2014-04-071-0/+7
| | | | | | | | | | | Extend the interface of the target_compile_features command with PUBLIC and INTERFACE keywords. Populate the INTERFACE_COMPILER_FEATURES target property if they are set. Consume the INTERFACE_COMPILER_FEATURES target property from linked dependent targets to determine the final required compiler features and the compile flag, if needed. Use the same pattern of origin-debugging which is used for other build properties.
* cmTarget: Allow populating COMPILE_FEATURES using generator expressions.Stephen Kelly2014-04-071-0/+5
| | | | | | Delay validation of the content as a feature if it contains a generator expression. It will be checked again at generate-time after evaluation.