Commit Graph

9153 Commits

Author SHA1 Message Date
Brad King
f709089d84 XLClang: Extract compiler implicit include directories 2019-02-25 08:24:28 -05:00
Chuck Atkins
8278237933 XL: Remove overlap with the new XLClang compiler ID
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.
2019-02-25 08:24:28 -05:00
Brad King
6f5cf2d2c6 XL: Revert "Recognize compilers identified by __ibmxl__"
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`.
2019-02-25 08:24:28 -05:00
Chuck Atkins
90c6156aa8 XLClang: Add a new compiler ID for the clang-based XL compiler 2019-02-25 08:24:28 -05:00
Brad King
e0231fe439 XL: Look for CreateExportList only on AIX
This tool comes with XL on AIX but not on Linux.  Move the
infrastructure to find and use it to the AIX-specific modules.
2019-02-25 08:24:27 -05:00
Chuck Atkins
13b1d2f9f8 XL: Record C compiler version that started using C99 by default 2019-02-25 08:24:27 -05:00
Brad King
40768761b6 Merge topic 'drop-MIPSpro'
214fcefa52 Remove now-unused code once used for MIPSpro on IRIX

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3004
2019-02-25 08:13:44 -05:00
Brad King
2cc6eedde4 Merge topic 'check_lang_source_runs_output'
92d9ec9bfb CheckLangSourceRuns: Capture run output to log files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3011
2019-02-25 07:55:20 -05:00
Craig Scott
92d9ec9bfb CheckLangSourceRuns: Capture run output to log files
Fixes: #18973
2019-02-23 21:16:03 +11:00
Brad King
214fcefa52 Remove now-unused code once used for MIPSpro on IRIX
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.
2019-02-21 11:12:51 -05:00
Brad King
b76b83efd3 Merge topic 'cray-cleanup'
d59159afdb Cray: clean up CrayPrgEnv and CrayLinuxEnvironment modules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2945
2019-02-20 09:05:57 -05:00
Brad King
85d779442b Merge topic 'asm-no-slash-question'
b186329d3d Use -? instead of /? to test compiler for MSVC-like command-line support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2984
2019-02-20 08:53:41 -05:00
Chuck Cranor
d59159afdb Cray: clean up CrayPrgEnv and CrayLinuxEnvironment modules
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.
2019-02-19 06:50:22 -07:00
Brad King
2dd2079152 Merge topic 'fix-legacy-implicit-includes'
890bae524c Do not explicitly report "standard" include directories as implicit
5c171ca898 Restore unconditional use of "standard" include directories
9502276f82 Prefix implicit include directories with sysroot on construction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2981
2019-02-19 07:54:57 -05:00
Brad King
bc34282da6 Merge topic 'FindBoost-layout-tagged'
bee6597ac5 FindBoost: Find boost libraries built with --layout=tagged

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2961
2019-02-19 07:53:47 -05:00
Brad King
b186329d3d Use -? instead of /? to test compiler for MSVC-like command-line support
MS-style command-line tools accept either `/` or `-` for command-line
options.  Prefer `-` over `/` so that non-MS tools do not treat it as a
path.

Fixes: #18941
2019-02-19 07:29:27 -05:00
Brad King
890bae524c Do not explicitly report "standard" include directories as implicit
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) we did
not account for `CMAKE_<LANG>_STANDARD_INCLUDE_DIRECTORIES`.  This
variable lets platform modules or toolchain files specify directories
that are to be explicitly passed as standard include directories.  These
include directories are used by the test project from which we extract
implicit include directories so they appear in the parsed results
whether or not the compiler really considers them implicit.  Exclude
these entries from the computed implicit include directories since they
are not actually implied by the compiler when we invoke it with
"standard" include directories passed explicitly.

Instead teach the build system generators to treat the "standard"
directories as implicit for purposes of excluding them from appearing
earlier in the compiler command line due to `include_directories` and
`target_include_directories` calls.

Issue: #18936, #18944
2019-02-18 17:12:14 -05:00
Brad King
9502276f82 Prefix implicit include directories with sysroot on construction
Since commit 7cd65c97fa (Add CMAKE_SYSROOT variable to set --sysroot
when cross compiling., 2013-04-13, v3.0.0-rc1~342^2) we have prefixed
the value of `CMAKE_SYSROOT` to implicit include directories.  This was
done because we hard-coded `/usr/include` as an implicit include
directory without accounting for the sysroot.  Instead we should prefix
the hard-coded paths when they are constructed.  Update the
`Platform/UnixPaths` module to do this as `Platform/Darwin` already
does.

Since commit 5990ecb741 (Compute implicit include directories from
compiler output, 2018-12-07, v3.14.0-rc1~108^2) the values of the
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` variables are computed from
a real compiler invocation so they already account for the sysroot
prefix.  In commit 6fc3382944 (Update logic for sysroot in detected
implicit include directories, 2019-02-13, v3.14.0-rc2~6^2) we attempted
to apply the prefix conditionally, but that is incorrect because the
compiler's real implicit include directories are not all under the
sysroot.  Instead assume that all implicit include directories in
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` already have the sysroot
prefix if needed.  Code that constructs the value must be responsible
for that because it is the only place that knows.
2019-02-18 17:09:26 -05:00
Yves Frederix
bee6597ac5 FindBoost: Find boost libraries built with --layout=tagged
Pick up libraries of the form `boost_system-mt-x64`, which do not have
the version suffix.

Fixes: #18908
2019-02-18 10:53:42 -05:00
Brad King
786edf9ab4 Merge topic 'externalproject_docs'
f2072a6554 Help: Clarify ExternalProject_Add()'s LOG_MERGED_STDOUTERR behavior
f2820bce15 Release notes: Make ExternalProject dot points consistent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2978
2019-02-18 09:09:02 -05:00
Craig Scott
f2072a6554 Help: Clarify ExternalProject_Add()'s LOG_MERGED_STDOUTERR behavior
The output is only merged for a step if it is logging to file. This
option is ignored for steps that are logging normally.

A minor grammatical error has also been fixed as part of this change.
2019-02-17 13:30:07 +11:00
Brad King
029abf9733 Merge topic 'FindLibXml2'
fd86a4de04 FindLibXml2: Document LibXml2_FOUND as preferred case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2970
2019-02-15 07:44:34 -05:00
Brad King
3411c81575 Merge topic 'try_compile-expand-compile-defs'
cde2596a19 try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2965
2019-02-15 07:19:51 -05:00
Brad King
113a395ee7 Merge branch 'try_compile-expand-compile-defs' into release-3.14
Merge-request: !2965
2019-02-15 06:47:59 -05:00
Brad King
dac6cf1b99 Merge branch 'FindLibXml2' into release-3.14
Merge-request: !2970
2019-02-15 06:47:22 -05:00
Saleem Abdulrasool
fd86a4de04 FindLibXml2: Document LibXml2_FOUND as preferred case
Both `LIBXML2_FOUND` and `LibXml2_FOUND` are provided but the modern
convention is to use the case that matches the module name.
2019-02-15 06:41:32 -05:00
Brad King
cde2596a19 try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS
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
2019-02-15 06:21:19 -05:00
Brad King
0069825f50 Merge topic 'fortran-submodule-names'
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
2019-02-14 10:25:15 -05:00
Brad King
2f51f281a8 Merge branch 'fortran-submodule-names' into release-3.14
Merge-request: !2958
2019-02-14 10:24:43 -05:00
Brad King
d80ecba5c2 Fortran: Fix submodule file names across compilers
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
2019-02-14 10:23:02 -05:00
Brad King
50ba2f019b Merge topic 'fix-legacy-implicit-includes'
6fc3382944 Update logic for sysroot in detected implicit include directories
2ad14ef4ea cmAlgorithms: Add cmHasPrefix to match existing cmHasSuffix
557b2d6e65 Fix regression in -I/usr/include exclusion logic
017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2957
2019-02-14 10:14:47 -05:00
Brad King
30783addc1 Merge branch 'fix-legacy-implicit-includes' into release-3.14
Merge-request: !2957
2019-02-13 10:05:48 -05:00
Brad King
557b2d6e65 Fix regression in -I/usr/include exclusion logic
The change in commit 15ad830062 (Refactor exclusion of -I/usr/include to
avoid per-language values, 2019-01-21, v3.14.0-rc1~108^2~4) caused the
exclusion to apply to Fortran, but it was only meant for C, CXX, and
CUDA.  The purpose of the change was to prepare for the value of
`CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES` to be computed from the
actual compiler instead of hard-coded.  We need to preserve exclusion of
`-I/usr/include` if the compiler has any implicit include directory that
looks intended to replace it, e.g. `<sdk>/usr/include` on macOS.

Fixes: #18914
2019-02-13 09:52:20 -05:00
Brad King
017598a444 macOS: Fix addition of <sdk>/usr/include to default implicit include dirs
In commit 1293ed8507 (ParseImplicitIncludeInfo: keep implicit incl.
consistent when rerunning cmake, 2019-01-30, v3.14.0-rc1~26^2) the
`Platform/UnixPaths` module was updated to add `/usr/include` to
`CMAKE_{C,CXX,CUDA}_IMPLICIT_INCLUDE_DIRECTORIES` through an
initialization variable used by `CMakeDetermineCompilerABI` instead of
directly.  This approach makes it only a default that can be overridden
by detection of the implicit include directories really used by the
compiler.

The addition of `<sdk>/usr/include` to default implicit include
directories by the `Platform/Darwin` module needs the same update but
was accidentally left out of the original commit.
2019-02-13 09:52:19 -05:00
Brad King
f468c0e1b9 Merge topic 'FindMatlab-version-empty'
40176749bc FindMatlab: Tolerate empty version log file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2949
2019-02-12 08:25:51 -05:00
Brad King
f0a57d42a2 Merge topic 'FindOctave-interp-target'
6725975bd8 FindOctave: Add target for octinterp

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2931
2019-02-12 08:24:11 -05:00
Brad King
3ff5a43c49 Merge branch 'FindMatlab-version-empty' into release-3.14
Merge-request: !2949
2019-02-11 13:21:41 -05:00
Sebastian Nagel
40176749bc FindMatlab: Tolerate empty version log file 2019-02-11 13:20:55 -05:00
Peter Stroia-Williams
6725975bd8 FindOctave: Add target for octinterp
This change adds the Octave::Octinterp target to make the octinterp
library available without users having to resort to using the
Octave_INTERP_LIBRARY variable.
2019-02-08 20:34:30 +00:00
Brad King
0741eda246 Merge topic 'mingw-ar-suffix'
42825fc220 MinGW: Fix locating BinUtils when compiler has a suffix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2924
2019-02-07 06:55:53 -05:00
Brad King
982e6e7775 Merge topic 'findcups'
dd45f23b01 FindCups: add imported target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2917
2019-02-07 06:55:12 -05:00
Brad King
6252a7ff61 Merge topic 'cpack-ifw-error-wording'
60a8d4c5f4 CPack/IFW: Correct wording in error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2928
2019-02-07 06:52:46 -05:00
Brad King
1e2e12889b Merge branch 'cpack-ifw-error-wording' into release-3.14
Merge-request: !2928
2019-02-07 06:51:28 -05:00
Joachim Wuttke (o)
60a8d4c5f4 CPack/IFW: Correct wording in error message 2019-02-07 06:51:15 -05:00
Brad King
ebb6b3a2da Merge topic 'FindHDF5-cleanup'
d3d9e6b760 FindHDF5: Modernize formatting of variable documentation
acbd69c219 FindHDF5: Use execute_process instead of exec_program

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2916
2019-02-07 06:49:56 -05:00
Brad King
6383dc398a Merge branch 'FindHDF5-cleanup' into release-3.14
Merge-request: !2916
2019-02-07 06:48:52 -05:00
Michael Hirsch, Ph.D
d3d9e6b760 FindHDF5: Modernize formatting of variable documentation 2019-02-07 06:47:07 -05:00
Michael Hirsch, Ph.D
acbd69c219 FindHDF5: Use execute_process instead of exec_program 2019-02-07 06:47:07 -05:00
Gregor Jasny
8af334f5ba Xcode: Derive stdlib from CXX flags
Closes: #18396
2019-02-07 06:43:51 -05:00
Regina Pfeifer
42825fc220 MinGW: Fix locating BinUtils when compiler has a suffix
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
2019-02-06 17:43:55 +01:00