1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-25 04:25:29 +08:00
Commit Graph

40 Commits

Author SHA1 Message Date
Alan Phipps
9ba0a54554 TIClang: Add support for TI Clang-based compilers, including tiarmclang
Add TIClang compiler ID and support in compiler modules.  Update
documentation.  Add rudimentary RunCMake test for TIClang to test
basic functionality.

Fixes: #24619
2024-02-09 15:54:40 -05:00
Brad King
914571a042 Place language standard flags just after CMAKE_<LANG>_FLAGS
Previously we added the language standard flag near the end of all
options, even after those added by `add_compile_options` and friends.
However, on some compilers such as MSVC, the `-std` flag may reset
defaults for flags that precede it on the command line.  Move the
language standard flag to before all other flags that CMake adds for
other abstractions, and before those added by `add_compile_options`.

`CMAKE_<LANG>_FLAGS` should still precede the language flags though,
because they are meant to be treated as language-wide modifications to
the compiler defaults, similar to `$CC $CFLAGS`.

Fixes: #23860
Fixes: #24170
2022-11-18 11:44:52 -05:00
Brad King
fbda79f39d Help: Document explicitly that 'cxx_std_##' features may not add a flag
This is commonly reported incorrectly as a bug, so call out this
behavior explicitly in the documentation.
2022-03-07 09:48:26 -05:00
Raul Tambre
e9976c8827 Help: Better explain CMAKE_<LANG>_EXTENSIONS_DEFAULT
Explain that this represents the compiler's default and mustn't be modified
by the user. Clarify when it's used as the default.

Additionally:
* Add a reference to it in cmake-compile-features in text explaining the
  feature.
* Add explanations for the default initialization by
  `CMAKE_<LANG>_EXTENSIONS_DEFAULT` to all `<LANG>_EXTENSIONS` pages and
  references to CMP0128.
* Slightly reduce the wordiness of the default initialization explanations by
  removing an unnecessary "it is".

Fixes #22828.
2021-11-02 17:58:21 +02:00
Raul Tambre
4a0485be7f cmStandardLevelResolver: Avoid unnecessary flags, fix unset level logic
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.
2021-09-29 22:28:40 +03:00
Brad King
8bc64a0c40 Merge topic 'doc-compile-features-wcdh'
1f4ec3f4a7 Help: Do not recommend WCDH in cmake-compile-features(7)
1cc63f2cd5 Help: Fix typos in cmake-compile-features(7)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6037
2021-04-26 11:27:17 -04:00
Brad King
1f4ec3f4a7 Help: Do not recommend WCDH in cmake-compile-features(7)
Since commit da7ad7997e (WriteCompilerDetectionHeader: Add policy to
remove module, 2020-12-04, v3.20.0-rc1~350^2), the WCDH module is
deprecated.  Update the `cmake-compile-features(7)` manual section that
previously recommended WCDH to make such detection the project's
responsibility instead.  Move the old content of the section over to the
WCDH module to preserve it.
2021-04-23 10:44:53 -04:00
Brad King
1cc63f2cd5 Help: Fix typos in cmake-compile-features(7) 2021-04-23 10:44:01 -04:00
Chuck Atkins
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode
Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
2021-03-30 10:32:53 -04:00
Robert Maynard
6bfb2c6175 HELP: Update compile-features documentation with missing compilers 2021-02-24 13:09:59 -05:00
Brad King
da7ad7997e WriteCompilerDetectionHeader: Add policy to remove module
See justification in the policy documentation.

Closes: #17842
2020-12-05 21:57:08 +11:00
Josef Angstenberger
fe9cddf181 Compiler/TI: Add std options for C++98
The TI compiler does not support C++98, only C++03
(based on manual of current version).

This change sets the C++98 option to C++03 based on the fact that it
is done this way for the SunPro compiler already.
2020-09-21 00:57:20 +02:00
Robert Maynard
2467a2b318 CUDA: Add cuda meta-features (e.g. `cuda_std_11`) support 2019-12-10 17:56:48 -05:00
Craig Scott
229f2cc5fd Help: Clarify compile features handling for OBJC and OBJCXX 2019-11-17 17:50:56 +11:00
Brad King
602189bb7b Merge branch 'clarify_compile_features_documentation' into release-3.16
Merge-request: !3988
2019-11-05 11:31:03 -05:00
Robert Maynard
53cd86ea78 Help: Clarify what 'aware' means as it relates to C++ standards 2019-11-04 17:16:57 -05:00
Robert Maynard
b7955bd931 Help: Remove out of date bounds on compile feature supported versions
The upper limits on what compiler CMake supports is always changing,
and the values inside cmake-compile-feature is always out of date.
So lets remove it.
2019-11-01 08:15:39 -04:00
Arnaud Gelas
9e27881bb1 TI: Add support for C language standards
Set C90 and C99 compile options for TI compiler.

Fixes: #18061
2018-06-04 10:48:02 -04:00
Brad King
8570dc7f64 Help: Update compiler versions in cmake-compile-features.7.rst 2018-03-27 07:42:07 -04:00
Brad King
4267960fc9 Features: Record for SunPro 5.15
Oracle Developer Studio 12.6 adds support for more C++ 11 features.
2018-03-20 11:48:22 -04:00
Brad King
c4610df03c Help: Document that VS 2017 compile features are recorded
They were recorded by commit v3.7.0-rc1~156^2~2 (Features: Record
features for VS 15 Preview 4, 2016-09-05).

Fixes: #16974
2017-06-15 10:11:09 -04:00
Brad King
69d50a7edb Help: Fix typo in Cray/PGI/XL compile features docs
Reported-by: Rolf Eike Beer <eike@sf-mail.de>
2017-06-15 10:08:59 -04:00
Chuck Atkins
28756437f2 Help: Add docs for new compilers supporting language standards. 2017-06-14 11:54:58 -04:00
Brad King
f15f905bab Features: Record standards and features for SunPro 5.14
Oracle Studio 12.5 adds support for C 11 and associated standard flags.
It also adds a few more C++ 11 features.
2017-05-03 13:13:43 -04:00
Rolf Eike Beer
94a8ee6fd0 GNU C: record that C99 is available since at least 3.4 2017-02-02 18:28:56 +01:00
Brad King
be3727bf92 Help: Fix language standard link text in cmake-compile-features(7)
Include each language name in the text of the link to its standards
property.
2017-02-02 08:43:58 -05:00
Robert Maynard
4505411982 Help: Document CUDA_STANDARD and related properties 2016-12-09 14:13:06 -05:00
Brad King
9a8d758c3a Help: Document language standard meta-features 2016-11-02 10:01:24 -04:00
Brad King
369d580937 Features: Record features for Intel Compiler on Windows
Since this compiler always defines `__cplusplus` to `1` we need to use
`_MSC_VER`, `__INTEL_CXX11_MODE__`, and the feature test macro named
`__cpp_aggregate_nsdmi` to detect C++11 and C++14 modes.

With no `-Qstd=` flag this compiler defaults to C++98 plus a subset of
C++11/C++14 features needed to be compatible with MSVC.  We pretend it
is plain C++98 and add a `-Qstd=` flag whenever needed for C++11 or
above features even if they would happen to be available in MSVC-mode.

Closes: #16384
2016-10-27 13:33:10 -04:00
Robert Maynard
d028b94872 Features: Specify minimum version Intel C++ 12.1
Versions below 12.1 do not provide enough information to properly detect
if compiling with c++98 or c++0x enabled so remove them from the
supported list.
2016-04-28 09:16:31 -04:00
Brad King
340d0897fa Revert topic 'compiler-features-solaris'
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.
2015-10-08 13:18:39 -04:00
Brad King
61bc0f7363 Features: Disable support for Oracle SolarisStudio on non-Linux
On SunOS the -std=c++11 flag must be used for linking as well as
compiling.  Until we implement support for this we cannot support
the CXX_STANDARD property except on Linux (where it was tested).
2015-09-29 11:25:07 -04:00
Erik Sjölund
a9b1838f97 Help: Fix typo in cmake-compile-features(7) manual (#15594)
target_link_libraries() is being used in the example code but
target_include_directories() was probably meant to be used. The sentence
that starts with "Consuming code then" indicates that the example is
about using the appropriate include directory.
2015-05-29 11:23:37 -04:00
Robert Maynard
322cdc4825 Help: Document supported compilers in cmake-compile-features.7
Extend sentences in other documentation linking to this manual to
say that it has a list of supported compilers.

Co-Author: Brad King <brad.king@kitware.com>
2015-04-07 15:01:18 -04:00
David Demelier
64f8c5336b Help: Fix typo in cmake-compile-features(7) manual
Fix spelling 'execptions' => 'exceptions'.
2014-12-02 09:20:22 -05:00
Brad King
a9dcf4773c Help: Drop TOC from latex manuals
A latex document can have its own TOC.
2014-11-06 14:46:18 -05:00
Brad King
80b19a7127 Help/manual: Avoid long lines in code blocks
Update the wording of some examples to avoid long lines in code blocks.
Otherwise the formatted documentation can exceed certain column width
limitations.
2014-10-22 16:48:04 -04: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
60a981ea8e Features: Enable compiler extensions by default.
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)
2014-05-31 12:16:12 +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