summaryrefslogtreecommitdiffstats
path: root/Tests/Module/WriteCompilerDetectionHeader
Commit message (Collapse)AuthorAgeFilesLines
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-015-25/+25
| | | | | | | | | | | | 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.
* WCDH: introduce BARE_FEATURESRolf Eike Beer2018-04-032-1/+37
| | | | | | This allows defining compat versions of some C/C++ features with the name of the keyword itself, so all code can look as if it was written for the new language standard.
* CompileFeatures: Makes tests work with meta-feature onlyChuck Atkins2017-05-291-1/+12
|
* WriteCompilerDetectionHeader: fix STATIC_ASSERTDaniel Pfeifer2017-03-062-0/+6
| | | | fixes #16185
* Tests/Module/WCDH: only use -Werror=undef compiler flag if actually supportedRolf Eike Beer2017-02-021-1/+5
|
* Tests/Module/WCDH: write multi_file_compiler_detection.h before using itRolf Eike Beer2017-02-021-11/+11
| | | | | | | | This was broken in commit 98e6d1e5e426c491e04faa746c11746002e6a69d (Tests/Module/WCDH: make it work with only C features defined) when all C tests were made accessible even if no C++ features are available, but the header was only created if C++ features are available. Fix it by creating the header unconditionally before any checks on the available features.
* Tests/Module/WCDH: make it work with only C features definedRolf Eike Beer2017-01-301-51/+51
|
* WCDH: optionally omit error code for unknown compilers or compiler versionsRolf Eike Beer2017-01-301-1/+29
| | | | | | This allows one to generate a header that will basically always work. In case an unknown compiler or compiler version is encountered it simply falls back to the unsupported case.
* Revise C++ coding style using clang-formatKitware Robot2016-05-163-20/+24
| | | | | | | | | | | | | 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.
* WCDH: Add Intel to list of supported compilersRobert Maynard2016-04-281-5/+9
|
* Revert topic 'compiler-features-solaris'Brad King2015-10-081-2/+1
| | | | | | | | Revert commit v3.4.0-rc1~10^2~2 (Features: Disable support for Oracle SolarisStudio on non-Linux, 2015-09-29) and two follow-up commits. The support of compile features and language standards on Orcale SolarisStudio needs more investigation so for CMake 3.4 we should just act as 3.3 did.
* Tests: Suppress WriteCompilerDetectionHeader failure on SunProBrad King2015-09-301-1/+2
| | | | | | We do support SunPro 5.13 compiler features, but only on Linux. Suppress the portion of the test that fails on Solaris until the larger problem can be addressed.
* Features: Fix C90 feature detection.Stephen Kelly2015-02-043-0/+80
| | | | | | | | | | | | | | | 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-2/+13
| | | | | | | 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>
* WCDH: Test that no C compiler features are defined for CXX compiler.Stephen Kelly2015-01-192-0/+8
| | | | | This amends commit 54156d72 (WCDH: Generate per-language files in multi-file mode., 2015-01-17).
* WCDH: Fix the C_STANDARD property in the tests.Stephen Kelly2015-01-191-1/+1
| | | | | | | | | | The CXX_STANDARD property validates the values allowed for it, and '90' is not a valid value for it. However, the validation is only done for languages enabled for the target, and as C_undefined has no CXX files, that language is not enabled for it. This amends commit v3.1.0-rc3~23^2 (WCDH: Make the header -Wundef safe for the C language., 2014-11-24).
* Merge topic 'GNU-4.4-compile-features'Brad King2015-01-191-6/+8
|\ | | | | | | | | | | | | | | | | | | | | 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: Wrap failure-test in UNIX condition.Stephen Kelly2015-01-181-6/+8
| | | | | | | | | | The use of GNU on non-UNIX for 'compile features' is not tested and is not well defined.
* | Features: Record for SolarisStudio 12.4.Stephen Kelly2015-01-171-3/+4
|/ | | | It has similar C++11 capabilities compared to GCC 4.8.
* Revert topic 'feature_record_msvc'Brad King2015-01-141-14/+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/+14
| | | | | | | | | | | | | | | | | 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: Quote all compiler names when comparing with COMPILER_IDRobert Maynard2015-01-111-7/+7
| | | | | In preparation of adding MSVC support we need to quote all compiler names, as MSVC is also a CMake variable.
* Features: Record for AppleClang 5.1Stephen Kelly2014-12-221-4/+6
| | | | | Apple's Clang 5.1 already supports most of the C and C++ features CMake enumerates.
* Merge topic 'WCDH-multi-file'Brad King2014-11-264-23/+58
|\ | | | | | | | | 4cf5179c WCDH: Make it possible to generate multiple files.
| * WCDH: Make it possible to generate multiple files.Stephen Kelly2014-11-244-23/+58
| | | | | | | | | | | | Extend the write_compiler_detection_header interface to allow specifying a location for supplementary files, and getting the list of resulting files as a variable.
* | WCDH: Make the header -Wundef safe for the C language.Stephen Kelly2014-11-252-0/+14
|/ | | | | | | | | The __STDC_VERSION__ macro may be defined or not depending on the implementation dialect of C. Test that it is defined before testing its value. The CXX tests do not need such a change because they define __cplusplus in all dialects.
* Features: Add compiler version support to WriteCompilerDetectionHeader.Stephen Kelly2014-06-092-0/+19
|
* Features: Record for Clang 3.4Stephen Kelly2014-05-201-2/+3
| | | | Clang 3.4 supports all features currently known to CMake.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-2/+3
| | | | | | | | | | | 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.
* Add the WriteCompilerDetectionHeader module.Stephen Kelly2014-05-142-0/+98
Provide a function to write a portable header to detect compiler features. Generate a preprocessor #error for unknown compilers and compiler versions whose features are not yet recorded. This error condition might be relaxed in the future, but for now it is useful for verification of expectations.