Commit Graph

8233 Commits

Author SHA1 Message Date
Christian Pfeiffer
27b62fa4c5 Fortran: Use same DOC for flags as other languages
Currently, only Fortran uses the string "Flags for Fortran compiler",
whereas C, CXX, CUDA all use the same, more descriptive string.
2017-11-08 14:50:58 +01:00
Brad King
bd68d0c252 Merge topic 'implicit-lib-gcceh'
41aacca7 Restore exclusion of "gcc_eh" from implicit link libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1460
2017-11-08 08:25:16 -05:00
Brad King
ddf485511b Merge branch 'implicit-lib-gcceh' into release-3.10
Merge-request: !1460
2017-11-08 08:12:08 -05:00
Christian Pfeiffer
41aacca7fb Restore exclusion of "gcc_eh" from implicit link libraries
Since commit v3.9.0-rc1~148^2 (Do not assume GCC libs are linked by all
compilers, 2017-05-05) we no longer filter out all `gcc*` implicit link
libraries.  This allows mixing of gcc and non-gcc compilers across
languages.  However, this caused a subtle problem with how GCC makes
exception handling symbols available to linked binaries.

GCC (at least on MinGW) provides two different libraries with exception
handling symbols:

* gcc_s: A shared library with -fvisibility=default, used by -shared-libgcc.
* gcc_eh: A static library with -fvisibility=hidden, used by -static-libgcc.

The C compiler (on MinGW) defaults to -static-libgcc and uses gcc_eh.
The C++ compiler defaults to -shared-libgcc and uses gcc_s when linking
shared libraries and executables so that exceptions can propagate across
shared libraries [1].  When linking a mixed-language binary, the C++
compiler should be used along with its choice of gcc_s.  In this case
gcc_eh should not be added even though the C compiler implies it because
gcc_s supersedes it.

Since the above-mentioned change, CMake is adding gcc_eh to C++ link
lines that also contain C code on MinGW.  This causes both gcc_s and
gcc_eh to be used, which is incorrect.  We can fix this simply by
excluding gcc_eh from the C compiler's implicit link libraries.

[1] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Link-Options.html#Link-Options

Fixes: #17436
2017-11-08 08:10:52 -05:00
Jean-Christophe Fillion-Robin
b551beb6fa FetchContent: Support use of the module before "project()" command
Co-authored-by: Craig Scott <craig.scott@crascit.com>
Co-authored-by: Brad King <brad.king@kitware.com>
2017-11-07 09:50:02 -05:00
Brad King
575250b6c4 Merge branch 'FindOpenGL-clarify-libraries' into release-3.10
Merge-request: !1459
2017-11-07 09:35:04 -05:00
Brad King
f44fb2dd4c FindOpenGL: Clarify logic constructing OPENGL_LIBRARIES
Our comment says the logic matches that for OpenGL::GL.  Structure
the logic the same way to make this clearer.

Issue: #17437
2017-11-07 09:33:43 -05:00
Brad King
a7347c022e Merge topic 'csharp-version-english'
04937db1 CSharp: Fix compiler version detection in non-English languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1449
2017-11-07 08:31:09 -05:00
Brad King
9a0d3e2ed6 Merge branch 'csharp-version-english' into release-3.10
Merge-request: !1449
2017-11-07 08:23:36 -05:00
Yoshinori Tahara
04937db103 CSharp: Fix compiler version detection in non-English languages
When we run `csc.exe /help` we look for "Version" in the output.
Explicitly ask for the output in English.

Reported-by: guttally@users.noreply.github.com
2017-11-07 08:23:16 -05:00
Brad King
b5d8610430 Merge topic 'findboost-compiler-version'
d70bdc72 FindBoost: support more than one number in version components
335816ef FindBoost: use CMake's compiler version rather than querying again

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1441
2017-11-07 08:21:23 -05:00
Brad King
6f80b10c83 Merge branch 'irsl-win2018' into release-3.10
Merge-request: !1451
2017-11-06 14:11:39 -05:00
Christian Pfeiffer
f6994f436c IRSL: Add support for the 2018 release on Windows.
Fixes: #17421
2017-11-06 14:10:45 -05:00
Ben Boeckel
d70bdc72ce FindBoost: support more than one number in version components 2017-11-06 13:26:23 -05:00
Brad King
b104bcfd98 Merge topic 'typos'
777e87ae Fix trivial typos in text

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1442
2017-11-06 09:02:23 -05:00
Ben Boeckel
335816efad FindBoost: use CMake's compiler version rather than querying again 2017-11-03 11:43:22 -04:00
luzpaz
777e87ae00 Fix trivial typos in text
Some are user facing.

Found using

    codespell -q 3 --skip="./Utilities" -I .cmake-whitelist.txt`

whereby the whitelist contained:

    ans
    dum
    helpfull
    emmited
    emmitted
    buil
    iff
    isnt
    nto
    ot
    pathes
    substract
    te
    todays
    upto
    whitespaces
2017-11-03 10:25:05 -04:00
Mark Salisbury
f61052ad39 FindBZip2: Normalize slashes when legacy BZIP2_LIBRARIES is specified
On Windows if you specify the library path using a regular Windows
path with backslashes, FindBZip2 announces that it found the library,
but the value is reported with backslashes instead of forward slashes.
This breaks assumptions elsewhere in CMake.  Convert slashes explicitly.
2017-11-01 17:21:18 -06:00
Brad King
93cd333103 Merge topic 'mingw-clang-c-compile-features'
f86879a0 Record C compile features flags for MinGW Clang on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1435
2017-11-01 07:40:35 -04:00
Brad King
8d1341f4ff Merge branch 'mingw-clang-c-compile-features' into release-3.10
Merge-request: !1435
2017-11-01 07:39:02 -04:00
Brad King
f86879a04c Record C compile features flags for MinGW Clang on Windows
This was done for C++ by commit v3.5.0-rc1~69^2 (Record compile features
for MinGW Clang on Windows, 2016-01-11).  Make the same change for C.
The `UNIX` condition on Clang C compiler features was already dropped by
refactoring in commit v3.9.0-rc1~17^2~4 (Compilers: Port to use default
cmake_record_lang_compile_features macros, 2017-05-10).

Our documentation already claims support for this combination.  This
was simply an oversight when support was added for MinGW Clang C++.

Issue: #15897
Issue: #15943
2017-11-01 07:28:38 -04:00
Isuru Fernando
3c3682289d Flang: Add support for compiling sources on Windows
Define `CMAKE_Fortran_COMPILE_OBJECT` for Flang on Windows.
2017-10-31 08:48:15 -04:00
Isuru Fernando
72d27964b9 Flang: Identify as simulating MSVC on Windows
In `CMakeFortranCompilerId.F.in`, take the `_MSC_VER` out of the
Intel-specific block so it will trigger for other compilers like Flang.
In `Compiler/Clang.cmake`, switch off Fortran too.
2017-10-31 08:47:06 -04:00
Brad King
ccf1155977 Merge topic 'freetype-windows'
3d42c3ed FindFreetype: Normalize slashes when legacy FREETYPE_LIBRARY is specified

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1416
2017-10-30 08:59:00 -04:00
Domen Vrankar
5784ab8fca CPack/Deb: handle shlibs file generation when SOVERSION set to 0
Setting CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS did not
auto generate shlibs control file when .so version
of the library was set to 0.

Fixes #17318
2017-10-29 00:20:54 +02:00
Mark Salisbury
3d42c3eda2 FindFreetype: Normalize slashes when legacy FREETYPE_LIBRARY is specified
On Windows if you specify the library path using a regular Windows
path with backslashes, FindFreetype announces that it found the library,
but the value is reported with backslashes instead of forward slashes.
This breaks assumptions elsewhere in CMake.  Convert slashes explicitly
since we have no `find_library` call for `FREETYPE_LIBRARY`.
2017-10-27 10:52:14 -04:00
Brad King
dfaf84ca73 Merge topic 'findICU_update'
20696a53 FindICU: Add support for static libraries on Windows
606ece67 FindICU: Search in 'sbin' directories for icu tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1396
2017-10-27 09:44:34 -04:00
Brad King
0278ec84d8 Merge topic 'clang-cl-TP'
7077a554 Clang: Use -TP flag for C++ sources with clang-cl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1407
2017-10-26 08:56:37 -04:00
Francois Budin
20696a53e4 FindICU: Add support for static libraries on Windows
When compiling ICU statically on Windows with Visual Studio, the library
file names are prefixed with 's' [1].

[1] http://source.icu-project.org/repos/icu/trunk/icu4c/source/icudefs.mk.in
    `STATIC_PREFIX_WHEN_USED = s`
2017-10-25 16:21:48 -04:00
Francois Budin
606ece67ef FindICU: Search in 'sbin' directories for icu tools
On Ubuntu, several binaries that FindICU.cmake searches for are installed
in 'sbin' instead of 'bin' [1].

[1] https://packages.ubuntu.com/xenial/amd64/icu-devtools/filelist
2017-10-25 16:20:19 -04:00
Brad King
7470561278 Merge topic 'flang-windows'
b2c6c357 Flang: Add partial support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1404
2017-10-25 08:15:43 -04:00
Brad King
fe4d6f1fd6 Merge topic 'omp-oacc-werror-return-type'
15da0ba3 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1406
2017-10-25 08:12:30 -04:00
Brad King
b0207cec32 Merge topic 'findmpi-core-count'
1610f757 FindMPI: Use physical cores for MPIEXEC_MAX_NUMPROCS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1405
2017-10-25 08:12:07 -04:00
Brad King
a720131006 Merge branch 'clang-cl-TP' into release-3.10
Merge-request: !1407
2017-10-25 07:39:12 -04:00
Brad King
7077a554f1 Clang: Use -TP flag for C++ sources with clang-cl
We do this for `cl`, so we should do it for `clang-cl`.

Fixes: #17394
2017-10-25 07:36:10 -04:00
Isuru Fernando
b2c6c3574e Flang: Add partial support on Windows
Add minimal changes needed to help Flang itself build on Windows using
CMake.  Additional work will be required for full support.

Issue: #17384
2017-10-24 11:27:08 -04:00
Brad King
b305e81b3e Merge branch 'omp-oacc-werror-return-type' into release-3.10
Merge-request: !1406
2017-10-24 10:56:36 -04:00
Christian Pfeiffer
15da0ba3a2 Find{OpenMP,OpenACC}: Fix detection with -Werror=return-type
Explicitly return a value from `main` in our test sources.

Fixes: #17391
2017-10-24 10:55:06 -04:00
Brad King
143b2e7b21 Merge branch 'findmpi-core-count' into release-3.10
Merge-request: !1405
2017-10-24 10:41:44 -04:00
Christian Pfeiffer
1610f757ac FindMPI: Use physical cores for MPIEXEC_MAX_NUMPROCS
Since commit v3.9.0-rc1~224^2~1 (FindMPI: MPIEXEC handling improvements,
2017-04-21) the `ProcessorCount` module is being used to initialize
`MPIEXEC_MAX_NUMPROCS`.  However, this leads to the logical cores being
counted rather than the physical ones, and some MPI implementations like
OpenMPI will error if mpiexec is called with that number.  Switch it to
the number of physical cores using `cmake_host_system_information`.

This ensures that if `MPIEXEC_MAX_NUMPROCS` is being used to set up MPI
tests with CTest or similar that the tests won't spuriously fail due to
OpenMPI refusing to start the application.
2017-10-24 10:41:02 -04:00
Brad King
d93b8009f9 Merge topic 'FindCUDA-doc-format'
17ddf126 FindCUDA: Improve documentation formatting markup

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1403
2017-10-24 08:48:45 -04:00
Brad King
047af6e94e Merge topic 'FindOpenCL-more-versions'
55f7930f FindOpenCL: Add detection of OpenCL 2.1 and 2.2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1398
2017-10-24 08:48:28 -04:00
Brad King
07253b8919 Merge topic 'gnuid-cmp54-fix'
a8be8b1b GNUInstallDirs: Enable CMP0054

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1400
2017-10-24 08:47:27 -04:00
Brad King
11dcf81c44 Merge topic 'generator-instance'
9ffb3538 VS: Select and save a VS 2017 instance persistently
17edfa41 cmVSSetupHelper: Add option to specify an instance
a19b8113 CheckLanguage: Pass generator instance into check
6b3cd64d ExternalProject: Propagate the generator instance
314613d1 Add infrastructure for generators to select a build tool instance

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1394
2017-10-24 08:22:25 -04:00
Henry Schreiner
17ddf126f0 FindCUDA: Improve documentation formatting markup 2017-10-23 12:17:38 -04:00
Brad King
d9430d1739 Merge branch 'FindOpenCL-more-versions' into release-3.10
Merge-request: !1398
2017-10-23 11:40:34 -04:00
Henry Schreiner
55f7930f0e FindOpenCL: Add detection of OpenCL 2.1 and 2.2 2017-10-23 11:39:53 -04:00
Brad King
3d35c3d1a3 Merge branch 'gnuid-cmp54-fix' into release-3.10
Merge-request: !1400
2017-10-23 09:03:10 -04:00
Christian Pfeiffer
a8be8b1b54 GNUInstallDirs: Enable CMP0054
Fixes: #17381
2017-10-23 09:02:54 -04:00
Brad King
9ded2fad79 Merge topic 'flang-remove-boundscheck'
3aeff21d Flang: Remove unsupported fbounds-check flag

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1393
2017-10-23 08:21:23 -04:00