Commit Graph

7992 Commits

Author SHA1 Message Date
Brad King
afae027d63 Merge branch 'gtest-discovery-timeout' into release-3.10
Merge-request: !1534
2017-12-07 08:03:11 -05:00
Matthew Woehlke
29731d8919 GoogleTest: Add timeout to discovery
Add a TIMEOUT option to gtest_discover_tests. This provides a
work-around in case a test goes out to lunch, rather than causing the
build to simply hang. (Although this is still a problem with the user's
project, hanging the build is not cool, especially in the case of
automatically running CI builds. It is much preferred that the build
should actively fail in this case, and it is trivially easy for us to
implement that.)
2017-12-06 07:37:48 -05:00
Brad King
0418e91f7d Merge branch 'findmpi-notfound-spam' into release-3.10
Merge-request: !1557
2017-12-05 08:37:10 -05:00
Brad King
64184762f4 Merge branch 'findmpi-found-cond' into release-3.10
Merge-request: !1556
2017-12-05 08:36:52 -05:00
Christian Pfeiffer
2047eb360d FindMPI: Fix multiple configure runs
Due to a erroneous logical dependency on a temporary variable, FindMPI
would depend its FOUND status on the set of flags needed to support
compiler-implicit MPI support after the first configure run.

This behavior is especially causing a misreported NOT FOUND status after
the first run on MPI implementations without MPI compiler like MS-MPI or
MPICH2 on Windows.
2017-12-05 14:17:27 +01:00
Christian Pfeiffer
bde7513d2f FindMPI: Correct legacy variable handling
Due to a minor logic error, MPI_LIBRARY, MPI_EXTRA_LIBRARY and
MPI_<LANG>_LIBRARIES hints are currently not correctly handled and
discarded.

Additionally, if either C or CXX aren't enabled, there subsequent calls
to FindMPI will cause cache variables of the sort "MPI_MPI_EXTRA_LIBRARY-NOTFOUND"
to appear due to an error in the compatibility handling. (Doesn't affect
functionality)
2017-12-05 14:14:40 +01:00
Matthew Woehlke
e99e39829b GoogleTest: Improve gtest_discover_tests messages
Adjust the formatting of error messages produced when test discovery
goes wrong, in order to avoid spurious line breaking.
2017-11-30 15:07:52 -05:00
Brad King
79ad921a38 Merge branch 'clang-cl-fix' into release-3.10
Merge-request: !1522
2017-11-28 11:09:53 -05:00
İsmail Dönmez
f969f1a9ce
Clang: Do not mistake clang-cl 6.0 for GNU-like clang
The check added by commit v3.10.0-rc2~2^2 (Clang: Diagnose unsupported
GNU-like clang targeting MSVC ABI, 2017-10-10) is incorrectly detecting
clang-cl 6.0 as GNU-like.  Currently cmake is testing if the clang
compiler accepts `--version` to see if it accepts GNU style flags.
However, with the latest llvm snapshot this also works for clang-cl:

    > clang-cl --version
    clang version 6.0.0 (trunk)
    Target: x86_64-pc-windows-msvc
    Thread model: posix
    InstalledDir: C:\Program Files\LLVM\bin

So instead we should use the `/?` flag which fails with clang but
works with clang-cl:

    > clang-cl /? &> /dev/null; echo $?
    0
    > clang /? &> /dev/null; echo $?
    1

Fixes: #17518
2017-11-28 17:08:33 +01:00
Brad King
93e7eb7bc5 Merge branch 'cuda-implicit-include-dirs' into release-3.10
Merge-request: !1528
2017-11-27 10:26:52 -05:00
Brad King
2f72573a62 CUDA: Treat /usr/include as an implicit include directory
We already do this for C and C++.

Fixes: #17512
2017-11-27 10:24:13 -05:00
Matthew Woehlke
70f9f62da8 GoogleTest: Fix multiple discovery on same target
According to the documentation, tests can be discovered for a target
multiple times by using a different prefix and/or suffix to ensure name
uniqueness. However, while this worked for gtest_add_tests, it did not
work with gtest_discover_tests because the generated file that sets up
the tests was named based only on the target name, and so subsequent
discovery from the same target would clobber earlier discovery.

Fix this by introducing a counter that records how many times discovery
has been used on a target, and use this to generate unique names of the
generated test list files.
2017-11-21 12:05:34 -05:00
Brad King
ff3c11eeac FindOpenGL: Add option to prefer GLVND for legacy GL
Since commit v3.10.0-rc5~3^2 (FindOpenGL: Default to non-GLVND libraries
for legacy GL, 2017-11-08) users may set `OPENGL_gl_LIBRARY` to empty to
use GLVND components for the legacy GL interfaces.  This is useful only
when one knows in advance that the GLVND components will be found.

Add a `OpenGL_GL_PREFERENCE` variable to specify a preference for legacy
GL or GLVND.  The latter can suppress `OPENGL_gl_LIBRARY` only when the
needed GLVND components are found.  If no preference is explicitly
specified, choose a default based on whether GLVND components were
requested (because this indicates the project has been updated for
CMake 3.10).

Issue: #17437
Issue: #17449
2017-11-15 13:44:59 -05:00
Brad King
aadc38c7fd FindOpenGL: Re-order component library searches
Move the search for the legacy GL library to after the GLVND libraries.
For now we still always look for both.
2017-11-15 11:46:58 -05:00
Brad King
fa5090b441 Merge branch 'doxygen_dot' into release-3.10
Merge-request: !1472
2017-11-10 10:34:34 -05:00
André Apitzsch
9cab8570fa FindDoxygen: Fix setting of HAVE_DOT in non-backward-compat mode
`DOXYGEN_DOT_FOUND` is only set if `_Doxygen_keep_backward_compat` is
used (when no components are requested), so use `Doxygen_dot_FOUND`
directly.  Preserve the "YES" or "NO" value used previously.
2017-11-10 08:49:37 -05:00
Brad King
1f15324824 Merge branch 'FindOpenGL-no-glvnd-for-GL' into release-3.10
Merge-request: !1466
2017-11-09 13:13:54 -05:00
Brad King
e6b209c870 FindOpenGL: Default to non-GLVND libraries for legacy GL
Projects using `OPENGL_LIBRARIES` or `OpenGL::GL` expect legacy GL.
Although GLVND OpenGL+GLX provides legacy GL interfaces, using those
library files may conflict with legacy GL library files used by
dependencies (or dependents) of such projects.  Therefore we should
not yet use OpenGL+GLX when a legacy GL library is available.

If `OPENGL_gl_LIBRARY` is set then use it as the legacy GL library.
If it is *not* set then fall back to using GLVND OpenGL+GLX to provide
legacy GL interfaces.  This will allow users to build projects using
GLVND even if they have not been ported.

Fixes: #17437
2017-11-09 09:47:12 -05:00
Brad King
24ca336981 Merge branch 'FindHDF5-c-version' into release-3.10
Merge-request: !1465
2017-11-08 09:39:05 -05:00
Axel Huebl
a6abb6c8b6 FindHDF5: Fix H5_VERSION on Patch in C
Fix a typo from commit v3.6.0-rc1~85^2 (HDF5: Refactor the use of
compiler wrappers, 2016-04-04) that accidentally used the HDF5 C++
version (which could be empty) while detecting the C patch version.
The detection failed for patch releases, such as `1.10.0-patch1`
becoming `.1` instead of `1.10.0.1`.
2017-11-08 09:35:45 -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
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
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
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
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
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
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
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
51b4f12773 Merge branch 'flang-remove-boundscheck' into release-3.10
Merge-request: !1393
2017-10-19 13:05:15 -04:00
Christian Pfeiffer
3aeff21df7 Flang: Remove unsupported fbounds-check flag
The Flang compiler neither supports nor documents -fbounds-check leading
to -Wunused-command-line-argument warnings with the default Debug flags.
2017-10-19 13:04:50 -04:00
Brad King
5a25bda524 Merge branch 'findopenmp-lib-paths' into release-3.10
Merge-request: !1385
2017-10-17 09:59:48 -04:00
Christian Pfeiffer
f4cc71099a FindOpenMP: Improve OMP libraries search
This supports libraries given as full path and filters libraries given
in CMAKE_<LANG>_STANDARD_LIBRARIES.

Fixes: #17351
2017-10-17 09:53:57 -04:00
Brad King
f618142fb9 Merge branch 'FindXMLRPC-no-includes' into release-3.10
Merge-request: !1377
2017-10-11 11:22:00 -04:00
Brad King
e7720a0f3f FindXMLRPC: Tolerate no include directories
`xmlrpc-c-config $modules --cflags` may report no `-I` flags if the
headers are in a standard location like `/usr/include`.  In this case
it is okay for `XMLRPC_INCLUDE_DIRS` to be empty.

Ideally the `--cflags` output should be used as hints for a `find_path`
call to really find the headers as we do for other find modules, but
simply assuming no explicit include directories are needed is good
enough for now.

Fixes: #17347
2017-10-11 11:19:03 -04:00
Brad King
b1aa8a4773 FindXMLRPC: Drop unnecessary exec_program code paths
We always have `execute_process` now, so drop our ancient `exec_program`
code paths that are never used anymore.
2017-10-11 10:31:32 -04:00
Brad King
609a6fe96d Merge branch 'clang-msvc-help' into release-3.10
Merge-request: !1373
2017-10-11 09:28:09 -04:00
Brad King
155c1505a5 Merge branch 'cpack-deb-mr-1296-fix' into release-3.10
Merge-request: !1375
2017-10-11 08:25:30 -04:00
Brad King
ce45b3e4e3 Merge branch 'ExternalProject-CMP0054' into release-3.10
Merge-request: !1369
2017-10-11 08:20:25 -04:00