summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'compile-features-for-language-standards'Brad King2016-11-0310-63/+36
|\ | | | | | | | | | | | | | | | | | | | | 9a8d758c Help: Document language standard meta-features df252db1 Features: Test cycle diagnostic with language standard meta-feature 6d5fb0e0 Features: Test feature propagation with language standard meta-feature a34b98a8 WCDH: Ignore language standard meta-features b0996a3f Features: Add meta-features requesting awareness of a particular standard 8b6cc251 Features: Centralize per-compiler recording macros 2d23f7b2 Features: Do not record features on MSVC < 2010
| * Features: Add meta-features requesting awareness of a particular standardBrad King2016-11-021-0/+5
| | | | | | | | | | | | | | | | | | | | A common use case of `target_compile_features` is simply to specify that the compiler should be run in a mode that is aware of e.g. C++11. Some projects simply specify a particular C++11-only feature to request this. Provide a first-class way to do this by naming features after the corresponding language standard. Record them as always available in the corresponding standard level so that requesting them always ensures that standard (or higher) is used.
| * Features: Centralize per-compiler recording macrosBrad King2016-11-0210-63/+29
| | | | | | | | | | Simplify and de-duplicate per-compiler feature recording macros and convert to a centralized per-language macro.
| * Features: Do not record features on MSVC < 2010Brad King2016-11-021-1/+3
| | | | | | | | | | | | | | We have no feature tests for versions of VS older than 2010, so do not even call `record_compiler_features` for such versions. This is consistent with other compilers where we call this macro only for versions for which we have recorded features.
* | Features: Fix Intel cxx_attributes existence conditionBrad King2016-11-031-1/+1
|/ | | | | | This condition needs to follow the same pattern added in note `[1]` by commit a5a3642f (Features: Port Intel CXX features to test macros where possible, 2016-10-26). It was accidentally left out of that commit.
* Features: Record features for Intel Compiler on WindowsBrad King2016-10-274-18/+7
| | | | | | | | | | | | | 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
* Features: Port Intel CXX features to test macros where possibleBrad King2016-10-271-18/+31
| | | | | | The Intel 16 and 17 compilers define feature test macros of the form `__cpp_<feature>`. Use them where possible to detect corresponding features.
* Features: Unset Intel CXX feature temporariesBrad King2016-10-271-0/+10
|
* Intel: Remove incorrect C++98 standard compiler flag on WindowsBrad King2016-10-271-5/+6
| | | | | | | | | | The change in commit 05e05cd2 (Intel: Fix compiler C++98 standard flag on Windows, 2016-10-26) was wrong. The Intel C++ Compiler for Windows does not support either `-Qstd=c++98` or `-Qstd=gnu++98`. Simply remove both flags for this compiler and use no options at all to achieve this mode. Issue: #16384
* Intel: Fix compiler C++98 standard flag on WindowsBrad King2016-10-261-1/+5
| | | | | | | The Intel C++ Compiler for Windows does not support the `-Qstd=c++98` flag but does support `-Qstd=gnu++98`. Issue: #16384
* Features: Record features for Intel C++ 17 on UNIXBrad King2016-10-261-3/+3
| | | | Issue: #16384
* Intel: Fix compiler extension flags on WindowsBrad King2016-10-242-6/+12
| | | | | | | | | The extension flags enabled by commit v3.6.0-rc1~120^2~1 (Features: Record standard flags for Intel C/C++ on Windows, 2016-04-18) of the form `-Qstd=gnu++11` are not supported by the Intel C/C++ Compiler for Windows. Fall back to using the non-extension form of the flags. Issue: #16384
* Simplify CMake per-source license noticesBrad King2016-09-278-96/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Ninja: Add explicit preprocessing step for FortranBrad King2016-09-223-0/+9
| | | | | | | | | | All Fortran sources need to be preprocessed before any source may be compiled so that module dependencies can be (later) extracted. Factor out an explicit preprocessing step preceding compilation. Use Ninja depfile dependencies on the preprocessing step and then compile the already-preprocessed source with a separate build statement that depends explicitly only on the preprocessor output. Later we will insert dynamic discovery of module dependencies between these steps.
* Features: Record features for VS 15 Preview 4Brad King2016-09-061-0/+3
|
* issues: update references to the CMake issue trackerBen Boeckel2016-08-151-2/+3
| | | | | References to specific comments are left as-is since comments were not migrated.
* NAG: Use -PIC for Fortran position-independent executable codeNeil Carlson2016-08-091-0/+1
| | | | | | | | | The Numerical Algorithms Group (NAG) Fortran compiler documents -PIC for position-independent code and does not have a separate option for PIE. We added `-PIC` for PIC in commit v2.8.11~174^2 (NAG: Use -PIC for Fortran position-independent code, 2013-02-18). Follow up for PIE. Closes: #16236
* Merge topic 'update-cle-version-info'Brad King2016-08-081-0/+2
|\ | | | | | | | | e52302d6 CrayLinuxEnvironment: Add alternative methods to get version info
| * CrayLinuxEnvironment: Add alternative methods to get version infoChuck Atkins2016-08-051-0/+2
| | | | | | | | Closes: #16229
* | Merge topic 'gcc-fvisibility-version'Brad King2016-08-031-1/+1
|\ \ | | | | | | | | | | | | 85e03142 GNU: Use -fvisibility on GCC 4.0 and 4.1 too
| * | GNU: Use -fvisibility on GCC 4.0 and 4.1 tooBrad King2016-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | This flag is needed for the `<LANG>_VISIBILITY_PRESET` target property. It has been supported since GCC 4.0, not 4.2 as we previously recorded. Fixes #16222.
* | | Merge topic 'intel-gnu11-support'Brad King2016-08-031-4/+4
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 088f14eb Intel-C: standard flags are also supported in 12.0 27a3ca15 Intel-C: support gnu89 and gnu99 extension flags cc223e1e Intel-C: declare support for gnu11
| * | Intel-C: standard flags are also supported in 12.0Ben Boeckel2016-08-021-1/+1
| | |
| * | Intel-C: support gnu89 and gnu99 extension flagsBen Boeckel2016-08-021-2/+2
| | |
| * | Intel-C: declare support for gnu11Ben Boeckel2016-08-021-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | Without extensions, functions like `strdup` are not available since they are actually controlled by feature flags such as _SVID_SOURCE and _BSD_SOURCE. When using `-std=c11` on Intel, none of these flags are set, so the functions are not declared properly leading to compile errors. Reported-by: Adam J. Stewart <ajstewart426@gmail.com> Closes: #16226
* | Use string(APPEND) in ModulesDaniel Pfeifer2016-07-271-1/+1
| | | | | | | | | | | | | | 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'
* | Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain filesBrad King2016-07-0626-103/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document these variables. Change our convention for setting these variables from: set(CMAKE_C_FLAGS_INIT "...") to string(APPEND CMAKE_C_FLAGS_INIT " ...") so that any value previously set by a toolchain file will be used. Automate the conversion with: sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \ Modules/Compiler/*.cmake Modules/Platform/*.cmake and follow up with some manual fixes (e.g. to cases that already meant to append). Also revert the automated changes to contexts that are not protected from running multiple times.
* | Intel: Do not use GNU-like flags on WindowsBrad King2016-07-055-24/+54
|/ | | | | | | | | | | Refactor options out of `Modules/Compiler/Intel-{ASM,C,CXX,Fortran}.cmake` into a common helper in `Modules/Compiler/Intel.cmake`. Condition them to be used only on non-Windows hosts where the Intel compiler is GNU-like instead of MSVC-like. Previously this worked only because the options were later overridden by `Modules/Platform/Windows-Intel*.cmake`, but it is cleaner to not set the options in the first place.
* Compiler/TI: Pass libraries as last part to linkerAlexander Stein2016-06-021-1/+1
| | | | | | | | | If e.g. libc.a is passed before any objects the linker raises the follwing warning: cannot resolve archive libc.a to a compatible library, as no input files have been encountered In the end the library is skipped and missing symbols occur. Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
* GHS: Use shorter object file names on collisionGeoff Viola2016-05-182-0/+2
|
* Features: Record features for VS 2015 Update 2Brad King2016-04-281-1/+4
|
* Features: Record standard flags for Intel C/C++ on WindowsBrad King2016-04-282-32/+44
| | | | | Select the `-std=` or `-Qstd=` flag based on whether Intel is GNU-like or MSVC-like, respectively.
* Features: Record standards and features for Intel C on UNIXRobert Maynard2016-04-282-0/+73
| | | | | Record features for Intel C 12.1 and above. Skip this for now on Windows (where Intel C simulates MSVC).
* Features: Specify minimum version Intel C++ 12.1Robert Maynard2016-04-281-22/+18
| | | | | | 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.
* Features: Record standards and features for Intel C++ on UNIXLevi Morrison2016-04-282-0/+158
| | | | Skip this for now on Windows (where Intel C++ simulates MSVC).
* Merge topic 'asm-includes'Brad King2016-03-291-1/+1
|\ | | | | | | | | 9408a7a8 ASM: Add missing <INCLUDES> placeholder for "compile" rules
| * ASM: Add missing <INCLUDES> placeholder for "compile" rulesGregor Jasny2016-03-291-1/+1
| | | | | | | | | | | | | | | | This placeholder was added to the compilation rules for other languages by commit v3.4.0-rc1~342^2 (Factor an <INCLUDES> placeholder out of <FLAGS> in rule variables, 2015-07-13) but ASM was incorrectly left out. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* | GHS: Implement link flags and dirs for non-target groups (#16029)Geoff Viola2016-03-281-0/+2
| |
* | GHS: Factor out compiler information shared among languagesGeoff Viola2016-03-283-4/+10
|/ | | | | Move common information in `Modules/Compiler/GHS-*.cmake` over to a common `Modules/Compiler/GHS.cmake` and include it.
* Merge topic 'ghs-try_compile'Brad King2016-03-222-0/+4
|\ | | | | | | | | bf3e76d2 GHS: Fix try_compile (#15975)
| * GHS: Fix try_compile (#15975)Geoff Viola2016-03-212-0/+4
| |
* | Add support for Bruce C Compiler (BCC)Paweł Stankowski2016-03-212-0/+8
|/ | | | Revise C compiler detection code to be K&R compatible.
* Ninja: Add dependencies on system-provided header files (#14914)Brad King2016-03-154-4/+4
| | | | | | | | When system-provided packages are upgraded we must re-compile sources depending on their headers. Use `-MD` instead of `-MMD` so that the generated depfiles do not exclude system headers. Suggested-by: Jussi Judin
* Features: Clang has no cxx_decltype_incomplete_return_type in MSVC sim modeMariusz Pluciński2016-03-101-1/+3
|
* Apple: Enable -isystem for GNU Compiler >= 4 (#15953)Gregor Jasny2016-02-071-1/+1
| | | | | | | | Due to #4662 -isystem support was disabled for all GNU Compilers on Apple platforms. But the change was probably a just work around for a broken compiler on Tiger (see 10837#c27206). So we tighten the condition to only kick in for GCC versions earlier than 4. That should ensure sane behavior for Xcode 3.2 and later.
* IAR: Add support for using this compiler with the Ninja generatorJuhani Simola2016-02-032-1/+5
| | | | | | The dependency flags require recent versions of `iccarm` and `iccavr`. The multi-rule dependency generated with `--dependencies=m` does not work well with Ninja, so use `--dependencies=ns` instead.
* Record compile features for MinGW Clang on Windows (#15897)Brad King2016-01-111-2/+2
| | | | | | Drop the 'UNIX' condition on Clang compiler features. This enables use of compile features with MinGW Clang, though additional work may be needed for clang-cl.
* CrayPrgEnv: Cleanup binaries from implicit compile flag detectionChuck Atkins2015-12-291-2/+5
|
* CrayPrgEnv: Don't use absolute paths for imlicit librariesChuck Atkins2015-12-181-6/+11
| | | | | | | When parsing implicit include dirs, link dirs, and link libs, all arguments are resolved to absolute paths instead of relative paths. This is correct for link and include directories but link libraries should only include the library name, not it's path.
* Merge topic 'detect-cray-wrappers'Brad King2015-12-0916-0/+200
|\ | | | | | | | | | | | | a7ef0225 Cray: Refactor the Cray platform files to use compiler wrapper checks 0763a836 Cray: Add macro tests to detect the Cray compiler wrappers 5eaac0c9 Compiler: Add infrastructure for detecting compiler wrappers