Commit Graph

12183 Commits

Author SHA1 Message Date
Craig Scott
5fbac2bb24 ExternalProject: Move inline scripts to separate files
This makes the scripts easier to work on, since the separate files
don't require the extra level of escaping that the inlined code did.
This also means the scripts can be rendered with appropriate
syntax highlighting in IDEs, etc.
2022-01-22 23:00:26 +11:00
Craig Scott
8feaa41ee9 ExternalProject: Ensure _ep_set_directories records cmake paths 2022-01-22 17:36:39 +11:00
Craig Scott
036517fe0b ExternalProject: Move existing step scripts to separate subdirectory
This is in preparation for moving more inline content to separate
scripts as well. Having them in a separate subdirectory is consistent
with other modules and will make them easier to find and work with.
2022-01-22 16:24:16 +11:00
Brad King
74eb6c5316 Merge topic 'CheckPIESUpported-supports-SYSROOT'
219dde4ea8 CheckPIESupported: now uses any SYSROOT settings
4fa105d34e Check{Compiler,Linker}Flag: Add possibility to retrieve check outputs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6877
2022-01-20 12:01:14 -05:00
Brad King
79589f7dfe Merge topic 'FortranCInterface-gcc-12-lto'
6a0ce19ce1 FortranCInterface: Fix compatibility with GCC gfortran 12 LTO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6879
2022-01-20 11:58:05 -05:00
Björn Esser
6a0ce19ce1 FortranCInterface: Fix compatibility with GCC gfortran 12 LTO
Since version 12.0 the GCC Fortran compiler has implemented "WG5/N1942",
which causes, if link-time opmization is enabled, obfuscation of hard-coded
string values in the compiler objects and its resulting ELF-binaries.

This causes the CMake-internal detection of the mangling scheme for the
naming of subroutines to fail.  Thus we must ensure to have any link-time
optimization features to be disabled on the executable file we perform the
detection on.

The static libraries, however, must be build with LTO and non-LTO objects,
as that will ensure the verify step will operate on IPO objects, if building
those is requested by the system compiler flags.

Fixes: #23123

Signed-off-by: Björn Esser <besser82@fedoraproject.org>
2022-01-19 20:47:38 +01:00
Marc Chevrier
219dde4ea8 CheckPIESupported: now uses any SYSROOT settings
Fixes: 23053
2022-01-19 10:49:23 +01:00
Marc Chevrier
4fa105d34e Check{Compiler,Linker}Flag: Add possibility to retrieve check outputs 2022-01-19 10:49:23 +01:00
Brad King
9e38bfa915 CPack/DMG: Add explicit option to use CPACK_RESOURCE_FILE_LICENSE for SLA
Since macOS 12.0, the ``hdiutil udifrez`` and ``hdiutil udifderez``
commands to embed and extract resources in a disk image are deprecated.
The CPack DragNDrop Generator uses these to attach the SLA specified by
the `CPACK_RESOURCE_FILE_LICENSE` option.  Since that option is shared
by multiple CPack generators, we cannot deprecate it.  Instead, add an
explicit option to control the behavior.  This will give projects a way
to package on future macOS versions that remove the commands.

In order to provide a long-term transition away from attaching SLAs to
disk images, update `cpack` to default this behavior to OFF.  To retain
compatibility for CMake projects, teach the CPack module to default the
option to ON.  Later a policy can be added to change the default.

Issue: #22978
2022-01-18 15:39:51 -05:00
Brad King
a2e42a577b Merge topic 'cuda_host_env'
70f5d9eb49 CUDA: Fix CMAKE_CUDA_COMPILER_ARG1 cache description
ad6cd1074b Help: Correct CUDAHOSTCXX and CUDAARCHS as having higher precedence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6872
2022-01-18 12:12:09 -05:00
Brad King
0604c79c07 Merge topic 'CheckLinkerFlag-update-implementation'
9d1b9a4aa1 CheckLinkerFlag: rely now on internal implementation
660e0d80ae internal/CheckCompilerFlag: rely on common configuration

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6860
2022-01-18 12:08:58 -05:00
Brad King
869349c710 Merge topic 'IntelLLVM-windows-link-with-driver'
79921fb00c IntelLLVM: Set linker to compiler driver for Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6866
2022-01-18 12:04:02 -05:00
Raul Tambre
70f5d9eb49 CUDA: Fix CMAKE_CUDA_COMPILER_ARG1 cache description
Also corrected the misleading indentation.
2022-01-15 21:55:06 +02:00
Marc Chevrier
9d1b9a4aa1 CheckLinkerFlag: rely now on internal implementation
This internal implementation share the configuration
with CheckCompilerFlag.
2022-01-14 23:22:07 +01:00
Marc Chevrier
660e0d80ae internal/CheckCompilerFlag: rely on common configuration
Extract configuration step from the CheckCompilerFlag command
to enable to share it with future CheckLinkerFlag implementation
2022-01-14 23:22:01 +01:00
William R. Dieter
79921fb00c IntelLLVM: Set linker to compiler driver for Windows
For IntelLLVM, linking with the compiler driver is preferred over using
the linker directly.  This is especially true when doing offload to a
target accelerator, which can produce object files that the regular
linker will not handle properly.

Windows-IntelLLVM relies on Windows-MSVC.cmake for many definitions.
This commit does not change that, but does override the MSVC defaults
for linking executables, shared libraries, and static libraries so that
CMake will use the compiler driver instead of the linker.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2022-01-14 08:57:03 -05:00
Brad King
a20d9e1463 Merge topic 'cudatoolkit_find_cufft_static_nocallback'
a4126d1c01 CUDAToolkit: Add CUDA::cufft_static_nocallback target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6856
2022-01-13 15:24:39 -05:00
Robert Maynard
a4126d1c01 CUDAToolkit: Add CUDA::cufft_static_nocallback target
Fixes: #23098
2022-01-12 16:04:02 -05:00
Robert Maynard
9e6c26b75c FindCUDAToolkit: depend cublas on cublasLt for CUDA 11.0+ 2022-01-12 15:06:49 -05:00
Brad King
c0f0fe50bf Merge topic 'msvc-isystem'
3a8b6653dc MSVC: Use -external:I flag without space to support Clang tools

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6855
2022-01-12 09:51:32 -05:00
Brad King
c7af954770 Merge topic 'GoogleTest-discover-sq-brackets'
8b85b10fb3 GoogleTest: Add handling for square brackets in test names
8f977a5c92 GoogleTest: Generalize test samples

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6842
2022-01-12 09:44:24 -05:00
Brad King
3a8b6653dc MSVC: Use -external:I flag without space to support Clang tools
Since commit f29e1874ad (Compiler/MSVC: use the `-external:I` flag for
system includes, 2020-05-19, v3.22.0-rc1~593^2) we use the new flag
followed by the include directory as a separate argument.  Some versions
of `clang-cl` and `clang-tidy` do not support the flag unless the
include directory is attached to it, so use that form instead.

Fixes: #22979
2022-01-11 16:36:36 -05:00
Brad King
ddc6be2c19 Merge topic 'FindLTTngUST-fix-version-detect'
4ce5765a86 FindLTTngUST: Fix version component extraction

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6828
2022-01-11 08:04:33 -05:00
Evgeniy Shcherbina
8b85b10fb3 GoogleTest: Add handling for square brackets in test names
If a test name contains a square bracket (due to parameters) then it
breaks gtest_discovery_test() function in some not-so-predictable
way. That happens due to the special meaning these brackets have in
the CMake language and they can't be escaped universally.

So the following treatment has been implemented:

* Every occurrence of ('[' | ']') in a test name gets replaced with
the corresponding placeholder ("__osb_*" | "__csb_*") before the
Google Test output processing and gets replaced back before adding
a new test to CTest, keeping the original test name intact in the
CTest output.

The placeholders are chosen that way to minimize the chance of
clashing with something in the user tests but even if the default
ones would clash with something then they are enhanced to not clash
with anything (hence "_*" at the placeholder's end).

* The GTest output gets searched for the default test name guards
("[=[" | "]=]") and if they are found a new one gets generated until
the one is found which can safely encompass any test name. The
search is quite simple: find the least amount of '=' which would
allow escaping any test.

* The resulting ${TEST_LIST} variable will contain every test but
tests with square brackets as there is no way to make sure such
tests won't break the list altogether.

Fixes: #23039
2022-01-11 09:00:53 +03:00
Norbert Lange
4ce5765a86 FindLTTngUST: Fix version component extraction
The regex was greedy and slurped away all but the last digit,
so 2.13.1 was for ex. detected as 2.3.1.
Fix this by expecting preceding whitespace.
2022-01-10 17:56:48 -05:00
Robert Maynard
d2be9d0f93 Fortran: Support searching for the nvfortran executable
Instead of relying on the PGI symlinks (pgf95/pgf90/...) to always exist.
2022-01-10 09:48:25 -05:00
Craig Scott
d73fc5dd2a ExternalProject: Fix misuse of IS_NEWER_THAN in timestamp checks
This change was originally made in 404cddb7bb (ExternalProject:
Fix misuse of IS_NEWER_THAN in timestamp checks, 2021-02-21),
but was reverted by 57d442e182 (Revert ExternalProject and
FetchContent refactoring, 2021-03-10) due to regressions from
other changes. Reapply this fix on its own, since it is still valid.

When using a file system which only has second resolution timestamps,
there is a reasonably high likelihood of timestamps being the same.
The IS_NEWER_THAN test returns true when timestamps are the same,
so don't redo downloads when they match exactly.
2022-01-08 20:51:44 +11:00
Brad King
b996e576c2 Merge topic 'GoogleTest-dots'
1f9554d4e9 GoogleTest: Fix regex matching all dots in the suite name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6822
2022-01-07 10:23:54 -05:00
Brad King
7b1099a52f Merge topic 'cmcldeps-cross'
d49e168e1b Ninja: Do not use cmcldeps for RC on non-Windows hosts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Dmitry Mikushin <dmitry@kernelgen.org>
Merge-request: !6843
2022-01-07 09:43:39 -05:00
Brad King
efe3410cbb Merge topic 'msvc-arm64ec'
26f52508f2 MSVC: update arm64ec default flags and lib

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6841
2022-01-07 09:42:53 -05:00
Brad King
46b34407cb Merge topic 'armasm-6.17'
c2777ed008 ASM: Fix identification of armasm 6.17+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6833
2022-01-07 09:40:15 -05:00
Francesco Guastella
1f9554d4e9 GoogleTest: Fix regex matching all dots in the suite name 2022-01-07 09:25:57 -05:00
Martin Storsjö
d49e168e1b Ninja: Do not use cmcldeps for RC on non-Windows hosts
The `cmcldeps` executable is only built on Windows.  If running MSVC on
a different OS (with various compatibility wrapping), don't try to use
`cmcldeps`, as the executable doesn't exist.

Fixes: #21760
2022-01-06 15:42:45 -05:00
moyo1997
26f52508f2 MSVC: update arm64ec default flags and lib
Update the support added by commit 4ea3a88625 (MSVC: Add support for
targeting ARM64EC, 2020-12-30, v3.20.0-rc1~121^2).

Add `softintrin.lib` to `CMAKE_C_STANDARD_LIBRARIES_INIT`.

Remove `/D_ARM64EC_WORKAROUND` from the flags as it was only ever needed
in preview versions of VS.

Issue: #21724
2022-01-06 15:31:32 -05:00
Jukka Jalkanen
c2777ed008 ASM: Fix identification of armasm 6.17+
Spelling of "ARM Compiler" changed to "Arm Compiler".
2022-01-06 11:55:38 -05:00
Craig Scott
f745e0497e CheckCompilerFlags: Catch linker warning about ignored flags
Example warning from arm64 macOS that this will now catch:

ld: warning: -no_pie ignored for arm64

Fixes: #22961
2022-01-03 09:35:16 +11:00
Brad King
7a07d089b9 Merge topic 'cpack-freebsd-pkg'
c3715e08e4 FreeBSD: tidy up
a76f19d5e8 FreeBSD: handle new package-file-suffix
d5ae2f9754 FreeBSD: fix up the package name
0ac1ac798e FreeBSD: migrate to newer pkg_create(3) API

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Semphriss <dev.semphris@gmail.com>
Merge-request: !5854
2021-12-22 08:53:54 -05:00
Brad King
9d80742db4 Merge topic 'FindGLUT-include-dirs'
6fda93faf8 FindGLUT: Provide modern-named GLUT_INCLUDE_DIRS result variable
641b3f4101 FindGLUT: Modernize documentation layout
924b2999a1 FindGLUT: Move mark_as_advanced calls closer to find calls

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6820
2021-12-21 09:29:20 -05:00
Brad King
132f45a099 Merge topic 'FindBoost-1.78'
d45667d459 FindBoost: Do not warn about now-supported version 1.78

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6819
2021-12-21 09:28:02 -05:00
Brad King
a2752fd914 Merge topic 'FindBoost-1.78' into release-3.22
d45667d459 FindBoost: Do not warn about now-supported version 1.78

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6819
2021-12-21 09:28:01 -05:00
Adriaan de Groot
d5ae2f9754 FreeBSD: fix up the package name
When using libpkg, the output filename is determined by libpkg
itself, based on information in the manifest: package name and
version, basically. This doesn't necessarily match the name that
CMake has determined via CPACK_TEMPORARY_PACKAGE_FILE_NAME or
CPACK_PACKAGE_FILE_NAME. So reset the CMake-determined list
to match what libpkg will do.
2021-12-21 13:59:27 +01:00
Brad King
6fda93faf8 FindGLUT: Provide modern-named GLUT_INCLUDE_DIRS result variable
Previously this module only provided `GLUT_INCLUDE_DIR`, which does not
follow the modern naming convention documented in `cmake-developer(7)`.

Issue: #23018
2021-12-20 09:53:33 -05:00
Brad King
641b3f4101 FindGLUT: Modernize documentation layout 2021-12-20 09:49:55 -05:00
Brad King
924b2999a1 FindGLUT: Move mark_as_advanced calls closer to find calls 2021-12-20 09:47:41 -05:00
Brad King
b2d764fea1 Merge topic 'FindGLUT-include-dirs'
ae6b25d920 FindGLUT: Provide legacy GLUT_INCLUDE_DIR result in pkg-config code path

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6814
2021-12-20 09:30:01 -05:00
Brad King
e3ece528c8 Merge topic 'googletest-executor-error'
0f51987d42 GoogleTest: show test executor in error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6813
2021-12-20 09:23:44 -05:00
Brad King
6db5fdae4d Merge topic 'FindGSL-version-regex'
58f2708b90 FindGSL: Improve version extraction regex

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6812
2021-12-20 09:22:27 -05:00
Brad King
d45667d459 FindBoost: Do not warn about now-supported version 1.78
In commit d176ff71c0 (FindBoost: Add support for Boost 1.78, 2021-12-15)
we forgot to update the future-version check.

Issue: #23016
2021-12-20 09:03:54 -05:00
Brad King
ae6b25d920 FindGLUT: Provide legacy GLUT_INCLUDE_DIR result in pkg-config code path
Since commit f90d15458a (FindGLUT: Use pkg-config to find flags if
available, 2021-06-11, v3.22.0-rc1~469^2) we return early if pkg-config
provides the information.  During review of that commit, code to
populate the legacy `GLUT_INCLUDE_DIR` result variable was removed from
that code path.  Add code to provide it.

Also fix the test case to use `GLUT_INCLUDE_DIR`, the result variable
documented officially by the module.

Fixes: #23018
2021-12-17 15:17:29 -05:00
Paul-Antoine Arras
0f51987d42 GoogleTest: show test executor in error message
Fixes: #22920
2021-12-17 16:50:12 +01:00