Commit Graph

30 Commits

Author SHA1 Message Date
Daniel Pfeifer 5d0d980d99 Use string(APPEND) in Modules
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'
2016-07-28 00:41:13 +02:00
Robert Maynard 15a6c9502d WCDH: Add Intel to list of supported compilers 2016-04-28 09:16:36 -04:00
Brad King 65e6b1152f WCDH: Fix condition when variables named "FILE" or "PREFIX" are defined
Reported-by: Kevin Godby <godbyk@gmail.com>
2015-05-07 09:00:45 -04:00
Roman Wüger f9d0962689 WCDH: Fix cxx_nullptr workaround for pre-C++11 compilers
Use just '0' instead of 'static_cast<void*>(0)' because the latter
will not automatically convert to pointers to other types.
2015-03-17 13:46:43 -04:00
Robert Maynard d3489bdb0b Features: Record for MSVC 2010-2015
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>
2015-01-30 09:57:33 -05:00
Stephen Kelly bcb04783f7 Features: Record for SolarisStudio 12.4.
It has similar C++11 capabilities compared to GCC 4.8.
2015-01-17 14:48:28 +01:00
Stephen Kelly 54156d723a WCDH: Generate per-language files in multi-file mode.
Otherwise we generate defines for C/CXX features unguarded by the presence of
the __cplusplus macro and available to the wrong compiler.
2015-01-17 14:48:27 +01:00
Stephen Kelly d84d6ed409 WCDH: Allow compilers to specify features for one language but not the other. 2015-01-17 14:48:27 +01:00
Stephen Kelly 7dcdfec97f WCDH: Find a language-specific DetermineCompiler.cmake if present.
The SolarisStudio compiler module uses language specific files.
2015-01-17 14:48:27 +01:00
Brad King 101a62aacb Merge topic 'revert-feature_record_msvc'
4ce110bb Tests: Revert workaround for COMPILE_FEATURES genex bug
0b7e7e27 Revert topic 'feature_record_msvc'
2015-01-15 09:53:47 -05:00
Brad King 0b7e7e277c Revert topic 'feature_record_msvc'
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.
2015-01-14 13:35:58 -05:00
Brad King 775fb2e0b0 Merge topic 'feature_record_msvc'
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.
2015-01-11 12:00:24 -05:00
Robert Maynard f73718c9b8 Features: Enable writing of MSVC compiler feature header.
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.
2015-01-11 11:32:36 -05:00
Stephen Kelly 998e9c1094 WCDH: Add feature portability for thread_local.
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.
2015-01-01 18:20:10 +01:00
Stephen Kelly bd6b42c186 Features: Record for AppleClang 5.1
Apple's Clang 5.1 already supports most of the C and C++ features CMake
enumerates.
2014-12-22 10:44:41 -05:00
Brad King 6b93953615 Merge topic 'WCDH-multi-file'
4cf5179c WCDH: Make it possible to generate multiple files.
2014-11-26 10:37:49 -05:00
Stephen Kelly 4cf5179c77 WCDH: Make it possible to generate multiple files.
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.
2014-11-24 21:54:41 +01:00
Stephen Kelly 0db3db41d4 WCDH: Don't imply that MSVC is supported by the module.
Remove the mention of it from the docs.
2014-11-23 10:12:49 +01:00
Stephen Kelly b47c125ff7 WCDH: Ensure that the prefix argument to the macro is valid.
The prefix must be a C-identifier because it is written as the
prefix of preprocessor macros and possibly structs.
2014-07-02 19:37:04 +02:00
Stephen Kelly f0a0f3dcb4 WCDH: Fix compiler id test for compatibility macros.
Enable the alignment features for Clang.
2014-06-13 18:50:10 +02:00
Stephen Kelly bc950169c7 WCDH: Remove noise from generated defines.
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.
2014-06-13 18:50:10 +02:00
Stephen Kelly 34f95bcfff WCDH: Document the alignof and alignas wrapper macros. 2014-06-10 18:07:32 +02:00
Brad King 487b6ccdcd Merge topic 'WriteCompilerDetectionHeader-compiler-versions'
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.
2014-06-10 09:17:43 -04:00
Stephen Kelly ddec418a8f Features: Add compiler version support to WriteCompilerDetectionHeader. 2014-06-09 23:42:20 +02:00
Stephen Kelly 62863106f0 WCDH: Add compatibility defines for deprecation. 2014-06-09 10:28:24 -04:00
Stephen Kelly 567af1a596 WCDH: Issue a better message for version compatibility. 2014-06-05 13:58:27 +02:00
Stephen Kelly ca5d990f02 Help: Add a manual for compiler feature control.
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.
2014-05-27 09:35:00 -04:00
Stephen Kelly cda233194f Features: Record for Clang 3.4
Clang 3.4 supports all features currently known to CMake.
2014-05-20 16:03:48 +02:00
Stephen Kelly e0890d03a4 Features: Extend concept to C language.
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.
2014-05-15 00:15:18 +02:00
Stephen Kelly 62a4a67dc5 Add the WriteCompilerDetectionHeader module.
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.
2014-05-14 13:57:30 -04:00