summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'add-xlclang'Brad King2019-02-2612-109/+100
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | d9d285c5ad jsoncpp: Fix include order for build within CMake 0d489fab19 libuv: fix atomic ops compilation with xlclang 1699f5c231 Utilities: Suppress warnings in third-party code when using XLClang f709089d84 XLClang: Extract compiler implicit include directories 5c41386357 XLClang: Add policy CMP0089 to present as XL for compatibility 8278237933 XL: Remove overlap with the new XLClang compiler ID 6f5cf2d2c6 XL: Revert "Recognize compilers identified by __ibmxl__" 90c6156aa8 XLClang: Add a new compiler ID for the clang-based XL compiler ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2921
| * XL: Remove overlap with the new XLClang compiler IDChuck Atkins2019-02-252-60/+14
| | | | | | | | | | | | | | | | | | In commit 6555286c55 (XL: Add C and C++ language level flags, 2017-04-27, v3.9.0-rc1~184^2) we added support for both the traditional XL compiler and the Clang-based variant used on Linux. The latter is now handled by `Modules/Compiler/XLClang-{C,CXX}.cmake` using the `XLClang` compiler id. Drop the corresponding content from the traditional XL compiler modules.
| * XL: Revert "Recognize compilers identified by __ibmxl__"Brad King2019-02-254-26/+10
| | | | | | | | | | | | Revert commit eb1a9be4b6 (XL: Recognize compilers identified by __ibmxl__, 2018-03-05, v3.11.0-rc3~4^2). It is no longer needed because we now use `__ibmxl__` to identify with compiler id `XLClang`.
| * XLClang: Add a new compiler ID for the clang-based XL compilerChuck Atkins2019-02-255-0/+75
| |
| * XL: Look for CreateExportList only on AIXBrad King2019-02-251-22/+0
| | | | | | | | | | This tool comes with XL on AIX but not on Linux. Move the infrastructure to find and use it to the AIX-specific modules.
| * XL: Record C compiler version that started using C99 by defaultChuck Atkins2019-02-251-1/+1
| |
* | Merge topic 'qcc-asm-detection'Brad King2019-02-261-0/+2
|\ \ | |/ |/| | | | | | | | | | | be87ce43f0 Add ASM Compiler detection for QCC Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Bartosz <gang65@poczta.onet.pl> Merge-request: !3016
| * Add ASM Compiler detection for QCCMaikel van den Hurk2019-02-251-0/+2
| |
* | Remove now-unused code once used for MIPSpro on IRIXBrad King2019-02-214-20/+0
| | | | | | | | | | | | In commit beb991110d (Remove now-unused code once used on IRIX, 2019-01-11, v3.14.0-rc1~167^2) we removed remnants of IRIX support. Also remove remnants of MIPSpro compiler support.
* | Cray: clean up CrayPrgEnv and CrayLinuxEnvironment modulesChuck Cranor2019-02-191-13/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CrayPrgEnv: - add a new function __cmake_craype_linktype() that determines what link mode the Cray compiler wrapper will use in a more sophisticated way than just MATCHing for static/dynamic on the command line. - add a new function __cmake_craype_setupenv() that does a once-per-cmake-run setup that does the following: 1. does a basic check of the wrapper's configuration. Running cmake and then changing module and/or linktype configuration may cause build problems (since the data in the cmake cache may no longer be correct after the change). We look for this and warn the user about it. 2. uses the "module" provided PKG_CONFIG_PATH environment variable to add additional prefixes to the system prefix path. This function used to be done by CrayLinuxEnvironment using the compiler implicit include/link paths but that is intended only for cross-compiling on Cray front-end nodes. Since CrayPrgEnv runs on both front-end and compute nodes, we migrate this function here. CrayLinuxEnvironment: - No need to set variables like CMAKE_SHARED_LIBRARY_PREFIX to values that have already been properly established by CMakeGenericSystem.cmake. Remove redundant sets of CMAKE_SHARED_LIBRARY_PREFIX, CMAKE_SHARED_LIBRARY_SUFFIX, CMAKE_STATIC_LIBRARY_PREFIX, CMAKE_STATIC_LIBRARY_SUFFIX, CMAKE_FIND_LIBRARY_PREFIXES, and CMAKE_DL_LIBS. - No need to add $ENV{SYSROOT_DIR}/usr/include to CMAKE_SYSTEM_INCLUDE_PATH when we already added $ENV{SYSROOT_DIR}/usr to CMAKE_SYSTEM_PREFIX_PATH. - Remove __cray_list_intersect(), __list_clean_dupes(), and buggy code that adds compiler implicit includes/libs to CMAKE_SYSTEM_INCLUDE_PATH and CMAKE_SYSTEM_LIBRARY_PATH. This function has migrated to CrayPrgEnv.cmake, as noted above. See discussion in issue #17413 for additional details.
* | Merge topic 'try_compile-expand-compile-defs'Brad King2019-02-152-12/+12
|\ \ | | | | | | | | | | | | | | | | | | cde2596a19 try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2965
| * | try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONSBrad King2019-02-152-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The quoting added by commit 8c5221fb1f (try_compile: Preserve special characters in COMPILE_DEFINITIONS, 2019-01-21, v3.14.0-rc1~108^2~3) broke the case that the `COMPILE_DEFINITIONS` value contains a `;`. Without the quoting the `;` would be generated literally in an unquoted argument in the test `CMakeLists.txt` file and would then be expanded. With quoting the `;` is preserved, which is not the old behavior. Fix this by expanding the `;`-list ahead of time. Add test cases for behavior with both `#` and `;`. This was noticed with the PGI compiler where we set `CMAKE_CXX*_STANDARD_COMPILE_OPTION` to values like `--c++17;-A`. The symptom had also been observed while preparing commit ef8f237686 (ParseImplicitIncludeInfo: add SunPro Fortran and PGI compiler, Cray fix, 2019-01-29, v3.14.0-rc1~26^2~2) but was not recognized at the time as a regression. Revert the workaround added by that commit. Fixes: #18919
* | | Merge topic 'fortran-submodule-names'Brad King2019-02-145-0/+15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d80ecba5c2 Fortran: Fix submodule file names across compilers 72057d9c15 Fortran: Thread compiler id through to internal Fortran parser 7ae329e2ed Fortran: Factor out .mod and .smod file name construction Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Michael Hirsch, Ph.D. <michael@scivision.co> Merge-request: !2958
| * | | Fortran: Fix submodule file names across compilersBrad King2019-02-145-0/+15
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The naming convention for submodule files varies across compilers. Add a table to the compiler information modules and thread the information through to the Fortran module dependency parser. Fill out the table for compiler ids known to support Fortran submodules. Fixes: #18746
* | | MinGW: Fix locating BinUtils when compiler has a suffixRegina Pfeifer2019-02-061-2/+2
|/ / | | | | | | | | | | | | | | While all executables from a mingw toolchain share a common prefix, only the ones provided with the compiler have a suffix, the binutils do not. Fixes: #18879
* | CrayPrgEnv/ParseImplicitIncludes: simplify for new implict include parserChuck Cranor2019-01-2916-155/+4
| | | | | | | | | | | | | | | | | | | | | | Remove now redundant implicit parser code from CrayPrgEnv.cmake, as this function is now supported in the general cmake code (e.g. Modules/CMakeParseImplicit{Include,Link}Info.cmake). This simplifies __CrayPrgEnv_setup() to take only one arg (${lang}) and allows us to remove a level of inclusion as CrayPrgEnv-${lang}.cmake is now compiler independent we do not need the CrayPrgEnv-${compiler}-${lang} files any more.
* | ParseImplicitIncludeInfo: add SunPro Fortran and PGI compiler, Cray fixChuck Cranor2019-01-292-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add implicit include parser for PGI compiler ID. PGI verbose output for CXX differs from C and Fortran, so CXX is broken out into its own case. The C and Fortran compilers take "-YI,path" and "-Mnostdinc" to change or disable the builtin include path. The last arg on the command line appears to override previous args (e.g. "-YI,path1 -YI,path2" will set the path to "path2" ... the previous "-YI,path1" gets undone). The CXX compiler verbose output reports with "-I" rather than "-stdinc" for the built in path. In addition with CXX "-Mnostdinc" does not completely zero the include path (e.g. "#include <stdio.h>" still works with "-Mnostdinc"... "-I/usr/include" still shows up in the verbose output). Minor adjustments to get the SunPro parser to handle Fortran as well. Fixes for Cray compiler support (Modules/Compiler/Cray-{C,CXX}.cmake): The *_COMPILE_OPTION flags contain options like "-h c99,gnu" ... these options need to be in double quotes (they are currently not). Otherwise, cmake treats them as lists and tries to run the compiler with "-h;c99,gnu" and fails when it is "Detecting C compile features"... Also, the Cray-CXX.cmake contains "__compiler_cray(C)" instead of "__compiler_cray(CXX)" -- this error prevents the correct VERBOSE flags for CXX from being defined which prevents the implicit include parser from running. Add additional test cases for PGI and SunPro Fortran to the Tests/RunCMake/ParseImplicitIncludeInfo area.
* | Merge topic 'intel-compile-features'Brad King2019-01-281-1/+1
|\ \ | |/ |/| | | | | | | | | fc40bca590 Intel: Record support for relaxed constexpr by version 18.0.5 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2862
| * Intel: Record support for relaxed constexpr by version 18.0.5Brad King2019-01-251-1/+1
| | | | | | | | | | | | Update the special case added by commit f719a13c28 (Features: Add special case to disable relaxed constexpr for Intel 18, 2018-06-04, v3.12.0-rc1~11^2) to record that 18.0.5 fixed the regression.
| * Merge branch 'flang-preprocess-source' into release-3.13Brad King2018-10-291-1/+1
| |\ | | | | | | | | | Merge-request: !2545
| * \ Merge branch 'qccDepfile' into release-3.13Brad King2018-10-291-1/+1
| |\ \ | | | | | | | | | | | | Merge-request: !2540
* | | | CMakeDetermineCompilerABI: pass verbose flag during compilationBrad King2019-01-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default to the same flag that is used for verbose link information, but provide another internal platform information variable to use a compilation-specific variant. Populate it for CUDA where we use a different compiler for compilation and linking and therefore need different flags. Co-Author: Chuck Cranor <chuck@ece.cmu.edu>
* | | | GHS: Add Compiler ID detectionFred Baksik2019-01-161-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Detect GHS compiler and version Detect ARCHITECTURE_ID for PPC / ARM / 86 targets Detect PLATFORM_ID for Integrity and Integrity178 platforms Using defines specified in the documents for the compilers: 201416 PPC / 201754 ARM / 201714 86 -- Fallback C/CXX compiler ID to GHS if not otherwise detected and using GHS MULTI generator Works around issue with some GHS compilers not setting __ghs__ compiler define -- Tweak Compiler ID checking so major id of 002017 is not replaced with 217 -- Prefer try_compile() library targets when testing for working GHS compilers -- Avoid CMake errors if reading past end of file for checking if file is PE executable
* | | | GHS: Use the correct compiler flags for CMAKE_BUILD_TYPEFred Baksik2019-01-162-44/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Do not use CMAKE_C_FLAGS_RELEASE flags when CMAKE_BUILD_TYPE is empty if CMAKE_BUILD_TYPE was not set the generator would use Release settings this does not match the documented behavior of CMAKE_BUILD_TYPE -- CMAKE_C_FLAGS_<CONFIG> not used when -kernel is present Fixes issue where CMAKE_C_FLAGS_<CONFIG> is ignored when -kernel option is present as a compiler option When the -kernel option is added to an executable it uses a different set of language flags This does not occur -kernel=<type> is used or if it is added as part of a link flag The variables CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG> are removed NOTE: By default this only added the flag -ldebug which links in the debugger library. -- Separate compiler options by newlines
* | | | GHS: Update the link line processingFred Baksik2019-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- add missing executable linker libs from: CMAKE_C_STANDARD_LIBRARIES -- add missed transitive link libraries -- add skipped library linker options -- The linker expects -l../relative/path/to/lib.a to be relative to the top-level project Because there can be multiple top-level projects convert the path to an absolute path to target
* | | | GHS: Place build system outputs per target output directivesFred Baksik2019-01-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -- Set output and object file locations -- Suffixes are no longer being forced but will now follow the target properties By default GHS tools have no suffix for executable files so CMAKE_EXECUTABLE_SUFFIX was changed to meet this behavior -- Remove #if 0 blocked out code; it has been replaced. Forcing the -relprog option has been removed from non-kernel executable targets. The default value of this option (if it is even available) is determined by the tool-chain for the specified target and platform (Some tool-chains default to -locatedprogram). The use of -relprog can have unexpected results as it cannot always produce a fully relocated executable. -- Clarify use of CMAKE_BUILD_TYPE to control build configuration
* | | | IAR: Update compiler modules to support AVR systemsEthan Slattery2019-01-154-2/+75
| | | | | | | | | | | | | | | | Fixes: #18557
* | | | XL: Move '-bE' flag earlier so it can be overriddenRob Boehne2019-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, we generate an export list for a shared library and pass that file on the link line. The problem was that it could not be overridden by a target when a specific export file is being used. Multiple `-bE` flags on the link are overridden by subsequent `-bE` flags, so only the last one is used. Fixes: #13282
* | | | PIE link options: Update strategy to fix performance regressionMarc Chevrier2018-12-197-37/+11
| | | | | | | | | | | | | | | | Fixes: #18700
* | | | QNX: Compiler and feature detection fixesCristian Adam2018-12-034-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested compiler detection with the QNX 7.0 list of compiler targets: * gcc_ntoaarch64le * gcc_ntoaarch64le_cxx * gcc_ntoarmv7le * gcc_ntoarmv7le_cxx * gcc_ntox86_cxx * gcc_ntoaarch64le_gpp * gcc_ntox86_64_gpp * gcc_ntoarmv7le_gpp * gcc_ntox86_64_cxx * gcc_ntox86 * gcc_ntox86_gpp * gcc_ntox86_64 This commit fixes some of the problems described in: https://cristianadam.eu/20181202/a-better-qnx-cmake-toolchain-file/
* | | | POSITION_INDEPENDENT_CODE: Manage link flags for executablesMarc Chevrier2018-11-117-0/+48
| | | | | | | | | | | | | | | | Fixes: #14983, #16561
* | | | POSITION_INDEPENDENT_CODE: Fix erroneous '-fPIE' flag for Sun StudioMarc Chevrier2018-11-083-0/+3
| | | | | | | | | | | | | | | | Fixes: #16311
* | | | Merge topic 'flang-preprocess-source'Brad King2018-10-301-1/+1
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | 8d782adbce Flang: Fix command-line used to preprocess sources Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2545
| * | | Flang: Fix command-line used to preprocess sourcesBrad King2018-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running flang with `-E` now ignores any `-o` option and always prints preprocessed output to stdout. Use shell redirection to place it in a file instead. Fixes: #18497
* | | | Merge topic 'qccDepfile'Brad King2018-10-301-1/+1
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | 99728fe27c QNX: Update qcc depfile flags to be compliant with ccache Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2540
| * | QNX: Update qcc depfile flags to be compliant with ccacheMaikel van den Hurk2018-10-291-1/+1
| |/ | | | | | | | | Pass the flags to the preprocessor phase via `-Wp,`. This is accepted both by qcc and ccache.
* | Autogen: Add clang --target= flag to compiler predefines commandBrad King2018-10-051-0/+8
|/ | | | | | | Respect the compiler target value `CMAKE_<LANG>_COMPILER_TARGET` in `CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`. Issue: #18425
* IAR: Abort if compiler version or target architecture is not detectedDaniel Schürmann2018-09-103-0/+14
| | | | | | | | If these are not detected then we cannot support the IAR compiler. Fail early with an explicit message instead of silently proceeding and getting strange errors. Issue: #18333
* Merge topic 'cmake_lang_compiler_predefines'Brad King2018-08-303-3/+21
|\ | | | | | | | | | | | | 83f2d48388 Respect CMAKE_<LANG>_COMPILER_ARG1 in CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2316
| * Respect CMAKE_<LANG>_COMPILER_ARG1 in CMAKE_<LANG>_COMPILER_PREDEFINES_COMMANDSebastian Holtermann2018-08-283-3/+21
| | | | | | | | | | | | | | | | | | | | | | AUTOMOC used to fail to generate ``moc_predefs.h`` when ``ccache`` was used as a compiler starter by e.g. configuring a project with the environment variable CXX="ccache g++". The reason was that ``CMAKE_<LANG>_COMPILER_ARG1`` wasn't respected in the definition of ``CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`` for various compilers. This is fixed by this patch. Fixes #17275.
* | Cray: Record C++14 compiler mode optionsKelly (KT) Thompson2018-08-241-0/+4
|/ | | | Fixes: #18270
* Merge topic 'nag-fortran-rsp'Brad King2018-08-061-0/+1
|\ | | | | | | | | | | | | 10d6c3a635 NAG: Pass response files through front-end to the linker Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2250
| * NAG: Pass response files through front-end to the linkerBrad King2018-08-011-0/+1
| | | | | | | | | | | | | | The `nagfor` compiler front-end does not support the `@rspfile` syntax. Use `-Wl,@rspfile` instead to pass it through to the linker. Fixes: #18232
* | XL: Use -qpic for position independent executablesBrad King2018-08-011-0/+1
|/ | | | | | The XL compiler does not have a dedicated "pie" option so use at least `-qpic`. This missing setting was exposed by the `ExportImport` and `PositionIndependentTargets` tests with XL on an ELF platform.
* Merge topic 'intel-std-fix'Brad King2018-07-132-8/+10
|\ | | | | | | | | | | | | 735e69f445 Intel: Fix incorrectly documented extension flags Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2206
| * Intel: Fix incorrectly documented extension flagsChristian Pfeiffer2018-07-122-8/+10
| | | | | | | | Fixes: #18166
* | Merge topic 'qnx_fix'Brad King2018-07-121-0/+2
|\ \ | | | | | | | | | | | | | | | | | | e014df762b QNX: Fix autogen compiler predefines detection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2205
| * | QNX: Fix autogen compiler predefines detectionCristian Adam2018-07-111-0/+2
| |/ | | | | | | | | | | In commit v3.12.0-rc1~20^2 (Move GNU COMPILER_PREDEFINES_COMMAND from Platform to Compiler, 2018-06-01), `Compiler/GNU.cmake` introduced the `-dM` flag, which requires `-Wp` prefix for the QNX compiler wrapper.
* | LINK_OPTIONS: Add support of "LINKER:" prefixMarc Chevrier2018-06-0617-0/+45
|/
* Features: Add special case to disable relaxed constexpr for Intel 18Brad King2018-06-041-1/+1
| | | | | | | | | | Intel compilers define `__cpp_constexpr` to `200704` even in C++14 mode. This indicates that the `cxx_relaxed_constexpr` feature is not available. However, Intel 17 and above document support for it. In commit v3.8.0~9^2 (Features: Update features for Intel C++ 17.0.2 on UNIX, 2017-03-31) we added a special check for this case. Intel 17 and 19 work. However, Intel 18 does not seem to work and fails our test case. Add a special case to disable the feature for Intel 18.