summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/CompileFeatures
Commit message (Collapse)AuthorAgeFilesLines
* Tests/RunCMake: Update cmake_minimum_required versionsBrad King2023-02-111-1/+1
| | | | | | | | For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
* Tests/CompileFeatures: Fix CMP0128OldSameStandard with default OFFRaul Tambre2022-06-041-5/+1
| | | | | | | | | With CMP0128 OLD compiler extensions are enabled by default regardless of the compiler's default. Fix the test to always check for the extension flag as it was intended to. Fixes: 4a0485be7f4ab06201c478f5a46111ab1e8e773e (cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic, 2021-04-29)
* Merge topic 'cmp0128_cuda'Brad King2022-01-2414-31/+46
|\ | | | | | | | | | | | | | | | | | | ee1396e29e CMP0128: Add flag in OLD mode even when standard matches the default b2c25de8e0 CMP0128: Avoid test code duplication 3a089cd256 CMP0128: Prefix test names with mode e13dd52535 XL: Detect default extensions mode for legacy compiler Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6890
| * CMP0128: Add flag in OLD mode even when standard matches the defaultRaul Tambre2022-01-233-0/+31
| | | | | | | | | | | | | | | | | | Commit 4a0485be (cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic, 2021-04-29) unintentionally changed the behavior by modifying the code to match a pre-existing comment. The resulting behavior change however matches the intentions of CMP0128, so we simply need to guard it. Fixes #23122.
| * CMP0128: Avoid test code duplicationRaul Tambre2022-01-237-26/+10
| |
| * CMP0128: Prefix test names with modeRaul Tambre2022-01-237-7/+7
| | | | | | | | Makes clear that these tests are for the NEW behaviour.
* | cmStandardLevelResolver: Better error message on unsupported language levelRobert Maynard2022-01-118-12/+8
|/ | | | Fixes #23079
* CMP0128: Enable/disable extensions if standard same as defaultRaul Tambre2021-11-115-5/+32
| | | | | | | | | | | This was intended to be part of the initial MR (!6177), but accidentally went missing when debugging nightly failures on less common systems. Noticed during !6711 review as the comment about this behaviour didn't match the code. Documentation for CMP0128 is updated to remove a false case and note the two cases related to this. Fixes #22224.
* cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logicRaul Tambre2021-09-2911-1/+201
| | | | | | | | | | | | | | | | | | The changes are part of CMP0128. When the standard level is unset: * Flags are added if extension mode doesn't match the compiler's default. Previously logic only worked if LANG_EXTENSIONS was ON. Fixes #22224. * The full flag is used. Previously CMAKE_LANG_EXTENSION_COMPILE_OPTION was used. This was only supported for IAR. Otherwise: * Avoid adding flags if not necessary per the detected compiler defaults. * Fixed check for when the requested standard is older. It now matches the nearby comments. I reworded the fallback comment as its logic was a bit difficult to wrap my head around.
* Tests: Simplify RunCMake.CompileFeatures introspectionRaul Tambre2021-09-283-59/+23
|
* CompileFeatures: Makes tests work with meta-feature onlyChuck Atkins2017-05-292-4/+6
|
* Features: Test cycle diagnostic with language standard meta-featureBrad King2016-11-022-3/+3
| | | | | | | 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 cyclic requirement of a feature requiring C++ 11, use the `std_cxx_11` meta-feature that has exactly this meaning.
* Revise C++ coding style using clang-formatKitware Robot2016-05-162-2/+2
| | | | | | | | | | | | | 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.
* Project: Determine default language dialect for the compiler.Stephen Kelly2015-09-181-1/+1
| | | | | | Use the __cplusplus and __STDC_VERSION__ macros to automatically determine the default dialect for the compiler while determining its id and version.
* Merge topic 'fix-crash-on-bad-LANG_STANDARD'Brad King2015-03-024-0/+9
|\ | | | | | | | | 00d66557 Diagnose invalid <LANG>_STANDARD value instead of crashing (#15426)
| * Diagnose invalid <LANG>_STANDARD value instead of crashing (#15426)Brad King2015-02-284-0/+9
| |
* | RunCMake: Remove unneeded files.Stephen Kelly2015-02-091-1/+0
|/ | | | | The default expectation of RunCMake tests is empty content, so there is no need to specify it.
* Features: Define meaning for no language standard defaultBrad King2015-01-292-15/+35
| | | | | | | | | | | | 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.
* Tests: Shorten paths in RunCMake.CompileFeaturesBrad King2015-01-264-2/+2
| | | | | Shorten the NotAFeature_OriginDebug_target_compile_features case name to avoid creating really long paths that fail with some tools on Windows.
* Features: Use a more-common feature in cycle-test.Stephen Kelly2015-01-181-2/+2
| | | | | | We require that the $<$<COMPILE_FEATURES:cxx_feature>:empty2> generates a '1' when CXX11 is enabled. GNU 4.4 does not support cxx_nullptr, but does support cxx_auto_type.
* Features: Update comment in test to match the code.Stephen Kelly2015-01-181-1/+1
| | | | | After commit f13a2eb1 (Features: Adjust the RunCMake test to use more-common features., 2015-01-15).
* Features: Adjust the RunCMake test to use more-common features.Stephen Kelly2015-01-162-6/+6
|
* Tests: Revert workaround for COMPILE_FEATURES genex bugBrad King2015-01-141-1/+1
| | | | | | | The second hunk of commit 07d1f6fc (Features: Properly evaluate if the compiler supports cxx_final, 2014-12-31) was a workaround for a bug in the COMPILE_FEATURES generator expression that caused it never to return 0. Revert the workaround so we can fix the bug instead.
* Revert topic 'feature_record_msvc'Brad King2015-01-141-7/+2
| | | | | | | | | | | Revert commits: 2d738ce3 Help: Add notes for topic 'feature_record_msvc' f73718c9 Features: Enable writing of MSVC compiler feature header. 64c30bdc Features: Record for MSVC C++ 2015 and MSVC C 2010-2015. 225c0ef8 Features: Record for MSVC 2010-2013. This topic was merged to master prematurely, so remove it.
* Features: Enable writing of MSVC compiler feature header.Robert Maynard2015-01-111-2/+7
| | | | | | | | | | | | | | | | | Notes: VS2015 and above are the only MSVC versions to support cxx_final, so remove usages from the tests, and instead only test for cxx_override. VS2012 and above to conform to cxx_decltype_incomplete_return_types proposal, but without support for auto return types the dcl.type.simple example in the proposal doesn't compile. VS2013 and above to conform to the updated cxx_contextual_conversions proposal, but VS2010 and above pass the test. Compilers such as MSVC have no explicit flags to enable C++11 mode, it just is always on. So only run the link tests with compilers that require a flag to specify the language version.
* Features: Properly evaluate if the compiler supports cxx_final.Robert Maynard2015-01-111-2/+2
| | | | | | Previously we expanded HAVE_FINAL to determine what the copied_file number would be, but when we don't have cxx_final than HAVE_FINAL is not defined. What we really want is to use expected_result.
* Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 caseBrad King2014-12-221-0/+2
| | | | | | | Mark the generated source file with the GENERATED property explicitly since it is not marked automatically as the output of any custom command. Mark both the 0 and 1 variants so it works no matter the outcome of the generator expression.
* Features: Enable compiler extensions by default.Stephen Kelly2014-05-318-4/+4
| | | | | | | | | | | Compilers enable their extensions by default, and disabling them implicitly can lead to results which are surprising or non-obvious to debug. http://public.kitware.com/pipermail/cmake-developers/2014-May/010575.html http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/10214 https://www.mail-archive.com/cmake-developers@cmake.org/msg10116.html (Compiler feature extensions by default, 29 May 2014)
* Features: Add COMPILE_FEATURES generator expression.Stephen Kelly2014-05-2113-0/+94
| | | | | | | | | | | | 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-159-0/+48
| | | | | | | | | | | 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.
* Tests: Make CompileFeatures feature list lang-specific.Stephen Kelly2014-05-102-4/+4
|
* Merge topic 'minor-cleanups'Brad King2014-05-082-2/+2
|\ | | | | | | | | | | | | 47795421 Fix whitespace in docs. aa283b6b Features: Fix test for GNU 4.8.1. bbfd4cd4 Features: Include the language of the compiler in error messages.
| * Features: Include the language of the compiler in error messages.Stephen Kelly2014-05-072-2/+2
| |
* | cmTarget: Add CXX_STANDARD_REQUIRED to control decay.Stephen Kelly2014-05-0726-0/+102
|/
* Features: FATAL_ERROR on compilers with no recorded features.Stephen Kelly2014-04-178-0/+37
| | | | | | Users of the new target_compile_features command are expected to check the existence of the CMAKE_CXX_COMPILE_FEATURES variable before attempting to use it to require features.
* Add target_compile_features command.Stephen Kelly2014-04-074-0/+11
| | | | | | | | | | | This can be used to set the compiler features required by particular targets. An error is issued at CMake time if the compiler does not support the required feature. If a language dialect flag is required by the features used, that will be added automatically. Base the target_compile_features command on cmTargetPropCommandBase. This gives us 'free' handling of IMPORTED, ALIAS, INTERFACE, non-compilable and missing targets.
* cmTarget: Transitively evaluate compiler features.Stephen Kelly2014-04-0713-0/+63
| | | | | | | | | | | 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-074-0/+7
| | | | | | Delay validation of the content as a feature if it contains a generator expression. It will be checked again at generate-time after evaluation.
* Features: Add cxx_auto_type.Stephen Kelly2014-04-076-0/+19
Record the availability of this feature for GNU 4.8 on (UNIX AND NOT APPLE) only. In the future, availability can be recorded for earlier GNU, for other platforms and for other compilers. Initially the affected configurations are as restricted as possible to allow for easy testing while extending the features vector in only one dimension. The error message when using the set_property API directly is not very good, but follow up commits will provide origin debugging of the property and a target_compile_features command which will provide a configure-time backtrace when possible.