summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/GNU-C.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Record when C compilers have gained full support for 90,99,11Robert Maynard2019-03-271-0/+3
|
* Compilers: Port to use default cmake_record_lang_compile_features macrosChuck Atkins2017-05-301-15/+0
|
* GNU: Use common compiler macros for language standard defaultChuck Atkins2017-05-021-15/+1
|
* GNU C: record that C99 is available since at least 3.4Rolf Eike Beer2017-02-021-5/+4
|
* Features: Make feature recording conditions more consistentBrad King2016-12-021-3/+3
| | | | | | | | | Condition all calls to `_record_compiler_features_{c,cxx}` on `_result EQUAL 0` so that adding new language standards later does not need to update them. Avoid some duplicate compiler version checks by conditioning C11 and CXX14 feature recording on the existence of `CMAKE_{C11,CXX14}_STANDARD_COMPILE_OPTION` (whose setting already used the version check).
* Features: Centralize per-compiler recording macrosBrad King2016-11-021-7/+3
| | | | | Simplify and de-duplicate per-compiler feature recording macros and convert to a centralized per-language macro.
* Project: Guess default standard dialect if compiler was forced (#15852)Brad King2015-11-191-0/+7
| | | | | | | | | | | | | | | | | | | | | Prior to commit v3.4.0-rc1~71^2 (Project: Determine default language dialect for the compiler, 2015-09-15) we always guessed the default language standard dialect based on the compiler version. This was not reliable so that commit switched to computing the default language standard dialect while detecting the compiler id. When a toolchain file uses CMakeForceCompiler to set the compiler id then the detection does not occur. Therefore commit v3.4.0-rc1~54^2 (Project: Don't require computed default dialect if compiler was forced, 2015-09-22) made the lack of detection an error only if the compiler was not forced. However, this means that projects using CMakeForceCompiler no longer even get the guess that we had before so <LANG>_COMPILER does not work. Due to the sophistication of CMake's compiler detection logic projects should be ported away from using CMakeForceCompiler. In the meantime, restore a guess of the default language standard dialect when the compiler is forced.
* Project: Don't require computed default dialect if compiler was forced.Stephen Kelly2015-09-221-3/+5
| | | | | | | | | | | | | | | | Commit 7235334a (Project: Determine default language dialect for the compiler., 2015-09-15) introduced a mechanism to determine the default dialect used for the running compiler. If conditions in the <CompilerId>-<Lang>.cmake file are such that compile features for that version of the compiler should be supported, the _DEFAULT_STANDARD is set to the computed value. However, the CMakeForceCompiler module allows users to bypass execution of the compiler by CMake. In that case, do not set the _DEFAULT_STANDARD variable at all, which effectively disables the compile-features where the module is used. No compile features have ever been recorded where the module is used so no functionality is lost.
* Project: Determine default language dialect for the compiler.Stephen Kelly2015-09-181-4/+6
| | | | | | Use the __cplusplus and __STDC_VERSION__ macros to automatically determine the default dialect for the compiler while determining its id and version.
* Record compile features for GNU C on Windows (#15727)Brad King2015-09-091-2/+2
| | | | Drop the 'UNIX' condition on GNU C compiler features.
* Features: Populate CMAKE_<LANG>_STANDARD_DEFAULT only for supported compilers.Stephen Kelly2015-02-041-1/+1
| | | | | | If no compiler feature information is known for a given compiler version, do not set a language standard default either. The two settings must be recorded consistently.
* Features: Fix GNU 4.4 and 4.5 C standard level flagsBrad King2015-01-211-3/+10
| | | | | The C90 flags were only the "89" versions until GNU 4.5. The C11 flags were not introduced until GNU 4.6.
* Features: Record for GNU 4.4.Stephen Kelly2015-01-181-3/+3
|
* Features: Record for GNU 4.6.Stephen Kelly2015-01-151-1/+1
| | | | | Adjust the CompileFeatures genex_test for the expectation of the OVERRIDE_CONTROL feature group.
* Features: Record C/CXX dialect flags for GNU 4.6.Stephen Kelly2015-01-151-1/+6
| | | | This release was prior to standardization of C11/CXX11.
* Features: Remove wrong content from else() condition.Stephen Kelly2015-01-151-1/+1
| | | | | | | | | | | | As this is not elseif(), the content has no effect. Rather than changing it to an elseif(), remove the conditional content. All versions of GNU prior to 5.0 default to C90/89. Clang-C.cmake has a similar code block which correctly uses elseif() for setting the default C dialect to C99. That may have been updated from a C90 default at some point, so leave the version condition there in place for now.
* Features: Ensure appropriate return value from feature test macros.Stephen Kelly2015-01-151-2/+1
| | | | | | | GNU-CXX already has complex logic and sets the _result to 0 before tests which may set it to something else. Change the other modules to be consistent with that.
* Record compile features for GNU on Apple.Stephen Kelly2015-01-111-1/+1
| | | | | Tested with GNU 4.8 binary (bottle) from homebrew, and assumed to work with the others.
* Merge branch 'default-lang-dialect' into step2Stephen Kelly2014-11-201-2/+5
|\ | | | | | | | | Conflicts: Modules/Compiler/Clang-C.cmake
| * Features: Fix the default C dialect for Clang and GNU.Stephen Kelly2014-11-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang 3.4 uses C99 by default, and Clang 3.6 uses C11 by default: http://thread.gmane.org/gmane.comp.compilers.clang.devel/39379 GNU 4.9 uses C90 by default, and GNU 5.0 uses C11 by default: https://gcc.gnu.org/gcc-5/changes.html Test that the default compiler settings result in the expected dialect macros being defined for both C and CXX. Remove the unused main.c file from the CompileFeatures unit test.
* | Features: Use the correct dialect flag when recording features.Stephen Kelly2014-11-121-4/+4
| | | | | | | | | | Avoid using -std=c++1y for compilers which support -std=c++14, for example.
* | Features: Reorder the GNU C dialect feature testsStephen Kelly2014-11-121-2/+2
|/ | | | | This doesn't make a difference, but the consistency with other files is easier to reason about.
* Features: Extend concept to C language.Stephen Kelly2014-05-141-0/+32
| | | | | | | | | | | 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.
* Split GNU compiler information filesBrad King2009-12-021-1/+2
| | | | | | | | | | | | | | This moves GNU compiler flags into new-style modules Compiler/GNU-<lang>.cmake Platform/<os>-GNU-<lang>.cmake We use language-independent helper modules Compiler/GNU.cmake Platform/<os>-GNU.cmake to define macros consolidating the information.
* ENH: Implicit link info for C, CXX, and FortranBrad King2009-07-231-0/+1
This teaches CMake to detect implicit link information for C, C++, and Fortran compilers. We detect the implicit linker search directories and implicit linker options for UNIX-like environments using verbose output from compiler front-ends. We store results in new variables called CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES The implicit libraries can contain linker flags as well as library names.