summaryrefslogtreecommitdiffstats
path: root/Modules/WriteCompilerDetectionHeader.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Modules: Update documentation formattingBartosz Kosiorek2019-04-081-1/+1
|
* Help: Remove duplication of function name.Joachim Wuttke (l)2018-11-121-5/+4
|
* Help: Convert remaining modules to block-style commentsKitware Robot2018-10-221-230/+231
|
* WCDH: introduce BARE_FEATURESRolf Eike Beer2018-04-031-33/+83
| | | | | | 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.
* WCDH: use better fallback value for nullptr with old gcc versionsRolf Eike Beer2018-03-201-1/+12
| | | | | | | GCC supports the __null builtin basically forever (since at least 2.95), which behaves very much like nullptr later does. Use this instead of plain "0" as fallback value, otherwise passing the define to functions annotated with __attribute__((sentinel)) will result in a compiler warning.
* Use string(APPEND) in ModulesDaniel Pfeifer2017-05-171-3/+3
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_\$\{\}]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* WriteCompilerDetectionHeader: fix STATIC_ASSERTDaniel Pfeifer2017-03-061-4/+13
| | | | fixes #16185
* WCDH: optionally omit error code for unknown compilers or compiler versionsRolf Eike Beer2017-01-301-10/+24
| | | | | | 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.
* WCDH: add macro to write simple replacement definesRolf Eike Beer2017-01-301-70/+20
|
* Don't include CMakeParseArgumentsDaniel Pfeifer2017-01-111-1/+0
| | | | | | | | | | | | The cmake_parse_arguments command is builtin with version 3.5. The CMakeParseArguments module is empty and exists for backwards compatibility with CMake 3.4 and lower. Remove the includes of CMakeParseArguments from CMake's modules. The modules are always used with the current version of CMake. Leave the includes in the tests, as the tests may be run with an older version of CMake.
* WCDH: Ignore language standard meta-featuresBrad King2016-11-021-1/+6
| | | | | | The `{c,cxx}_std_*` features are meant for use with `target_compile_features` but do not make sense for use with WriteCompilerDetectionHeader. Filter them out of any requested list.
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Use string(APPEND) in ModulesDaniel Pfeifer2016-07-271-28/+28
| | | | | | | Automate with: find Modules -type f -print0 | xargs -0 perl -i -0pe \ 's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
* WCDH: Add Intel to list of supported compilersRobert Maynard2016-04-281-2/+3
|
* WCDH: Fix condition when variables named "FILE" or "PREFIX" are definedBrad King2015-05-071-2/+2
| | | | Reported-by: Kevin Godby <godbyk@gmail.com>
* WCDH: Fix cxx_nullptr workaround for pre-C++11 compilersRoman Wüger2015-03-171-1/+1
| | | | | Use just '0' instead of 'static_cast<void*>(0)' because the latter will not automatically convert to pointers to other types.
* Features: Record for MSVC 2010-2015Robert Maynard2015-01-301-2/+7
| | | | | | | 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: Record for SolarisStudio 12.4.Stephen Kelly2015-01-171-0/+1
| | | | It has similar C++11 capabilities compared to GCC 4.8.
* WCDH: Generate per-language files in multi-file mode.Stephen Kelly2015-01-171-12/+16
| | | | | Otherwise we generate defines for C/CXX features unguarded by the presence of the __cplusplus macro and available to the wrong compiler.
* WCDH: Allow compilers to specify features for one language but not the other.Stephen Kelly2015-01-171-2/+8
|
* WCDH: Find a language-specific DetermineCompiler.cmake if present.Stephen Kelly2015-01-171-1/+5
| | | | The SolarisStudio compiler module uses language specific files.
* Merge topic 'revert-feature_record_msvc'Brad King2015-01-151-3/+2
|\ | | | | | | | | | | 4ce110bb Tests: Revert workaround for COMPILE_FEATURES genex bug 0b7e7e27 Revert topic 'feature_record_msvc'
| * Revert topic 'feature_record_msvc'Brad King2015-01-141-3/+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.
* | Merge topic 'feature_record_msvc'Brad King2015-01-111-2/+3
|\ \ | |/ | | | | | | | | | | | | 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.
| * Features: Enable writing of MSVC compiler feature header.Robert Maynard2015-01-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | WCDH: Add feature portability for thread_local.Stephen Kelly2015-01-011-0/+15
|/ | | | | | | | | | | | | | | | | AppleClang does not support the cxx_thread_local feature, even though it is based on a Clang version which does support the feature. http://stackoverflow.com/a/23850891/2428389 A possible reason for that is that thread_local might be used as a variable in existing Apple SDK headers. Extend the WriteCompilerDetectionHeader module to generate a define for that feature with portability fallbacks. For the avoidance of making it easy to write code which looks correct but which has odd runtime behavior, don't set the define symbol at all if no equivalent keyword is known.
* Features: Record for AppleClang 5.1Stephen Kelly2014-12-221-3/+4
| | | | | Apple's Clang 5.1 already supports most of the C and C++ features CMake enumerates.
* Merge topic 'WCDH-multi-file'Brad King2014-11-261-4/+97
|\ | | | | | | | | 4cf5179c WCDH: Make it possible to generate multiple files.
| * WCDH: Make it possible to generate multiple files.Stephen Kelly2014-11-241-4/+97
| | | | | | | | | | | | 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: Don't imply that MSVC is supported by the module.Stephen Kelly2014-11-231-1/+1
|/ | | | Remove the mention of it from the docs.
* WCDH: Ensure that the prefix argument to the macro is valid.Stephen Kelly2014-07-021-0/+8
| | | | | The prefix must be a C-identifier because it is written as the prefix of preprocessor macros and possibly structs.
* WCDH: Fix compiler id test for compatibility macros.Stephen Kelly2014-06-131-4/+4
| | | | Enable the alignment features for Clang.
* WCDH: Remove noise from generated defines.Stephen Kelly2014-06-131-7/+7
| | | | | | The DECL part is redundant, and the language part is not needed. The source language and context already determines the language, so there is no need to repeat it in the define name.
* WCDH: Document the alignof and alignas wrapper macros.Stephen Kelly2014-06-101-0/+10
|
* Merge topic 'WriteCompilerDetectionHeader-compiler-versions'Brad King2014-06-101-3/+57
|\ | | | | | | | | | | | | | | ddec418a Features: Add compiler version support to WriteCompilerDetectionHeader. b7029576 Project: Add configurable name for version computation macros. 78acaafe Project: Separate simulated compiler id from version detection. 567af1a5 WCDH: Issue a better message for version compatibility.
| * Features: Add compiler version support to WriteCompilerDetectionHeader.Stephen Kelly2014-06-091-1/+50
| |
| * WCDH: Issue a better message for version compatibility.Stephen Kelly2014-06-051-2/+7
| |
* | WCDH: Add compatibility defines for deprecation.Stephen Kelly2014-06-091-10/+52
|/
* Help: Add a manual for compiler feature control.Stephen Kelly2014-05-271-0/+3
| | | | | | | | Link to it from the documentation of related properties, variables and commands. Extend the cmake-developer(7) documentation with notes on extending feature support for compilers.
* Features: Record for Clang 3.4Stephen Kelly2014-05-201-0/+1
| | | | Clang 3.4 supports all features currently known to CMake.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-4/+20
| | | | | | | | | | | 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-141-0/+401
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.