Commit Graph

12258 Commits

Author SHA1 Message Date
Kenneth Soerensen
bd3e23a605 IAR: Fix detection of modern C++ version
The change in commit cc4da8d13a (IAR/CXX: Fix compatibility with CMP0057
OLD, 2022-01-29, v3.23.0-rc1~46^2) broke the detection of C++ version
because the `IN_LIST` operator cannot work directly on a list but
requires a variable.
2022-03-08 09:34:48 -05:00
Brad King
1d9b545390 Merge topic 'FindMatlab-minver' into release-3.23
bb2c7b7dc0 FindMatlab: Fix logic error when minimum version is not found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7047
2022-03-08 08:22:09 -05:00
Michael Hirsch
bb2c7b7dc0 FindMatlab: Fix logic error when minimum version is not found
Fix logic added by commit 7fdd5128b1 (FindMatlab: Fix version selection
if a version is given, 2021-07-02, v3.22.0-rc1~66^2).  Ensure that
`_list_index` is always initialized to -1, akin to `list(FIND)` not
finding a match.

Issue: #22377
2022-03-07 10:12:43 -05:00
Brad King
71a8b4e63d Merge topic 'binutils-llvm-ar-clang-macos' into release-3.23
29ea94e17c BinUtils: Avoid llvm-ar on Apple platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7039
2022-03-04 08:52:05 -05:00
Brad King
7edc09b4f6 Merge branch 'binutils-llvm-ar-clang-macos' into release-3.22
Merge-request: !7039
2022-03-03 12:58:00 -05:00
Brad King
29ea94e17c BinUtils: Avoid llvm-ar on Apple platforms
Since commit cf82300a63 (BinUtils: Clarify search logic and make it more
consistent, 2021-05-27, v3.21.0-rc1~119^2~2) we correctly prefer the
more-specific name `llvm-ar` over `ar` when using Clang.  However, on
Apple platforms, `llvm-ar` does not generate a symbol table that the
Apple linker accepts.  Fall back to `ar` on Apple platforms.

Fixes: #23269
2022-03-03 12:54:10 -05:00
Brad King
5c1f5357b0 VS: Fix CUDA compiler id with CMAKE_CUDA_ARCHITECTURES={all,all-major}
Skip the architecture verification check for these values on Visual
Studio.  It cannot be implemented correctly until future work delays the
check to the main compiler test step.

Issue: #23164, #23161
2022-03-02 15:49:14 -05:00
Brad King
04a7200c75 Merge topic 'cuda-arch-all' into release-3.23
2796d6eeca CUDA: Fix CMAKE_CUDA_ARCHITECTURES=all/all-major with NVCC 11.5+
e450d55552 Help: Update CUDA_ARCHITECTURES docs for generic all/all-major support
fe64c49e72 CUDA: Simplify CMAKE_CUDA_ARCHITECTURES special value logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7026
2022-03-02 07:52:17 -05:00
Brad King
2796d6eeca CUDA: Fix CMAKE_CUDA_ARCHITECTURES=all/all-major with NVCC 11.5+
Changes in commit 8f64df0a7c (CUDA: Generic all and all-major support,
2021-12-19, v3.23.0-rc1~23^2) broke our architecture verification checks
when using `-arch={all,all-major}` with NVCC 11.5+.  If we test the
compiler with `-arch={all,all-major}`, we have no expected list of
architectures, so skip the check.

Fixes: #23278
2022-03-01 12:16:40 -05:00
Brad King
893ba6c5c3 Merge topic 'FindThreads-revert-libc-pthread-flag' into release-3.23
c6da90bd39 FindThreads: Revert "Honor THREADS_PREFER_PTHREAD_FLAG when ... in libc"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7025
2022-03-01 08:37:58 -05:00
Brad King
fe64c49e72 CUDA: Simplify CMAKE_CUDA_ARCHITECTURES special value logic
Refactor the logic checking `CMAKE_CUDA_ARCHITECTURES` special values.
Switch on the value first, and then make other decisions for each case.
This makes room for other special values to be added later.
2022-02-28 21:30:23 -05:00
Brad King
7a16688f02 Merge branch 'FindThreads-revert-libc-pthread-flag' into release-3.22
Merge-request: !7025
2022-02-28 13:09:19 -05:00
Brad King
02b04f1ca8 Merge branch 'FindThreads-revert-libc-pthread-flag' into release-3.21
Merge-request: !7025
2022-02-28 13:09:00 -05:00
Brad King
c6da90bd39 FindThreads: Revert "Honor THREADS_PREFER_PTHREAD_FLAG when ... in libc"
Revert commit 5efb6fb516 (FindThreads: Honor THREADS_PREFER_PTHREAD_FLAG
when pthread is found in libc, 2021-11-03, v3.21.5~4^2).  The check for
the `-pthread` flag can pass on compilers like XL, that interprets it as
`-p -t hread` and returns zero.  Prior to that commit, we did not use
the check in the `CMAKE_HAVE_LIBC_PTHREAD` code path.  Now we do, it
succeeds, and we incorrectly add the `-pthread` flag for XL.

This change was backported to the 3.21 and 3.22 release series long
after they initially came out.  Since there may be more cases where we
now add `-pthread` incorrectly, it is simplest to revert the change in
all release series pending further investigation.

Fixes: #23270
2022-02-28 12:53:15 -05:00
Fred Baksik
005c7dc9e7 GHS: Store full path of Integrity OS directory
Fixes build project error because the OS directory was a relative
path from the binary directory.

Fixes issue during project regeneration where the `-os_dir` project option
was missing because GHS_OS_DIR was not properly stored in the cache
file.

This error was introduced by commit aa59eaac4f (GHS: Allow setting GHS
variables from toolchain file, 2021-11-15, v3.23.0-rc1~337^2).
2022-02-23 11:33:35 -05:00
Brad King
65e4d29e35 CheckTypeSize: Modernize and clarify documentation
Spell out the list of result variables as a definition list rather
than in prose.

Fixes: #23247
2022-02-18 11:33:06 -05:00
Brad King
809cb5b76a Merge topic 'FindGLUT-link-dirs' into release-3.23
44f7238d5d FindGLUT: Use link directories for libs from pkg-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6985
2022-02-16 09:42:53 -05:00
Axel Huebl
449f343498 FindHDF5: Tolerate failure during compiler interrogation
Check that the file that is accessed via `file(STRINGS...)` truly
exists.

This is not the case in some EMSCRIPTEN/WebASM builds where we want to
overwrite the HDF5 find logic manually. The missing check here prevents
that one can overwrite the search logic in exotic environments.
2022-02-15 10:44:29 -05:00
Silvio Traversaro
44f7238d5d FindGLUT: Use link directories for libs from pkg-config
Since commit f90d15458a (FindGLUT: Use pkg-config to find flags if
available, 2021-06-11, v3.22.0-rc1~469^2), the `GLUT_LIBRARIES` may come
from `pkg-config`, in which case they may be `-l` flags instead of
absolute paths.  Propagate `GLUT_LIBRARY_DIRS` to GLUT::GLUT too.

Fixes: #23229
2022-02-15 10:35:11 -05:00
Brad King
db5b4f40c3 Merge topic 'FindMatlab-mcr911' into release-3.23
b8d885ed0d FindMatlab: Fix version detection for MCR >= 9.10

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6976
2022-02-15 09:50:08 -05:00
Tom M
b8d885ed0d FindMatlab: Fix version detection for MCR >= 9.10
Recent MCR versions have the following `VersionInfo.xml`:

    <version>9.11.0.1837725</version>

Fix parsing of multiple digits in the version components
so that we do not mistake this for version `9.1`.
2022-02-14 10:23:33 -05:00
Brad King
59da8629cc Merge topic 'FortranCInterface-macos-arch' into release-3.23
58af150a74 FortranCInterface: Fix mangling detection for x86_64 on arm64 macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6974
2022-02-14 09:59:45 -05:00
Brad King
2adea60f45 Merge topic 'GoogleTest-discovery-fix-escaping' into release-3.23
61929f936f GoogleTest: Fix escaping in test names

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6965
2022-02-14 09:58:00 -05:00
Brad King
58af150a74 FortranCInterface: Fix mangling detection for x86_64 on arm64 macOS
Fixes: #23218
2022-02-11 11:56:58 -05:00
Evgeniy Shcherbina
61929f936f GoogleTest: Fix escaping in test names
Due to add_command() being a macro it introduced excessive and
nonobvious escaping in different parts of the script. Because of
one of such places the resulting script would have an erroneous
${TEST_LIST} if the user data (in test parameters) had a semicolon.

To eliminate this non-obvious escaping, add_command() was converted
to function. Updated the escaping accordingly.

Fixes: #23059
2022-02-11 09:03:40 -05:00
Brad King
5b480172c3 Merge topic 'clang-cross-compile-windows-pdb' into release-3.23
641cb1093b Windows/Clang: Support PDB when cross-compiling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6959
2022-02-10 09:09:09 -05:00
Brad King
1a30d3ade5 Merge branch 'backport-IntelLLVM-depfile-flags' into release-3.22
Merge-request: !6964
2022-02-09 10:09:51 -05:00
Brad King
1e947fcb83 Merge branch 'backport-IntelLLVM-depfile-flags' into IntelLLVM-depfile-flags 2022-02-09 10:08:52 -05:00
William R. Dieter
a8b6bf9a38 IntelLLVM: Add dependencies on system header files on Windows
In commit a90d2a9eed (IntelLLVM: Add support for Intel LLVM-based
compilers, 2020-11-02, v3.20.0-rc1~89^2~20) the IntelLLVM depfile
generation flags were taken from `Platform/Windows-Intel-C`.  Those
flags were added by commit a624a3e1b3 (Ninja: Use deps=gcc for Intel
Compiler on Windows, 2019-01-30, v3.14.0-rc1~30^2), which forgot to
account for commit 6d74e7870b (Ninja: Add dependencies on
system-provided header files, 2016-03-15, v3.6.0-rc1~265^2).

The `-QMD` option generates Makefile dependencies.  The `-QMMD` option
generates Makefile dependencies, but excludes system header files.
Part of the BuildDepends test includes a header, cmake_pch.hxx, that
includes a second header, zot_pch.hxx.  The test builds a pch file for
cmake_pch.hxx, touches zot_pch.hxx, then verifes that cmake_pch.hxx.pch
is regenerated based on the dependencies.

The cmake_pch.hxx contains `#pragma system_header` before it includes
zot_pch.hxx.  `#pragma system_header` indicates that the portion of the
file following the pragma is to be treated as a system header.

When `-QMMD` is used to generate dependencies, the `#include` of
zot_pch.hxx is ignored because it `-QMMD` says to ignore system headers.

Using `-QMD` instead uses all headers when generating dependencies
and causes this test to pass.  The Clang configuration in
Platform/Windows-Clang.cmake also uses the `-MD` option for generating
pre-compiled headers, instead of `-MMD`.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2022-02-09 10:07:51 -05:00
Brad King
94f1bbdd54 Intel: Add dependencies on system header files on Windows
In commit a624a3e1b3 (Ninja: Use deps=gcc for Intel Compiler on Windows,
2019-01-30, v3.14.0-rc1~30^2) we forgot to account for commit 6d74e7870b
(Ninja: Add dependencies on system-provided header files, 2016-03-15,
v3.6.0-rc1~265^2).
2022-02-09 10:07:51 -05:00
Deniz Bahadir
641cb1093b Windows/Clang: Support PDB when cross-compiling 2022-02-09 00:38:09 +01:00
مهدي شينون (Mehdi Chinoune)
b67ff61c3a FindGSL: Improve version extraction regex
Backport commit 58f2708b90 (FindGSL: Improve version extraction regex,
2021-12-17) to the CMake 3.22 branch.

Fixes: #23017
2022-02-08 10:21:15 -05:00
Brad King
5bf6e57a12 Merge topic 'GoogleTest-discover-type-params' into release-3.23
073dd1bd81 GoogleTest: Change format for typed tests
f28f738bd2 GoogleTest: Fix type param tests for suites with many cases

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6958
2022-02-08 08:35:18 -05:00
Evgeniy Shcherbina
073dd1bd81 GoogleTest: Change format for typed tests
Before it would output a typed test as follows:
  Suit/Type.Case
And now it would be:
  Suit.Case<Type>

In case of NO_PRETTY_TYPES it would simply use the type number
instead of its text representation:
  Suit.Case<0>

The change is introduced to make sure CTest outputs tests in a
similar fashion which is "*Suit.Case*" and angle brackets "<>"
emphasize that we are dealing with a typed (template) kind.
2022-02-07 12:53:17 -05:00
Evgeniy Shcherbina
f28f738bd2 GoogleTest: Fix type param tests for suites with many cases
When there were many cases (two digits or more) the "prettier" would
fail to recognize the pretty part leaving the test name unprocessed.
The fix made sure the processing would work correctly, irrespective
of the case number.

Before the fix, for the following input:
TypedSuite/1.  # TypeParam = int
  case
TypedSuite/10.  # TypeParam = char
  case
The output would be:
TypedSuite/int.case
TypedSuite/10.  # TypeParam = char.case

Now the output will be:
TypedSuite/int.case
TypedSuite/char.case
2022-02-07 12:53:16 -05:00
Brad King
a2b5ef3b36 Merge topic 'default-extensions' into release-3.23
4ef6e27cb9 CompilerId: Fix default extensions check for Clang targeting MSVC ABI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6949
2022-02-04 08:20:21 -05:00
Brad King
01b89d2547 Merge topic 'ep-patch-USES_TERMINAL' into release-3.23
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6940
2022-02-04 08:18:12 -05:00
Brad King
c8a955584d Merge topic 'GoogleTest-discover-spaces-in-parameters' into release-3.23
fd6b8fa40e GoogleTest: Preserve spaces in test parameters

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6941
2022-02-04 08:13:06 -05:00
Brad King
4ef6e27cb9 CompilerId: Fix default extensions check for Clang targeting MSVC ABI
In commit fc3a1cbdd8 (CompilerID: Compiler extensions default detection,
2021-05-29, v3.22.0-rc1~52^2~2), extensions were assumed to be `OFF`
for Clang targeting the MSVC ABI.  However, the `clang` and `clang++`
tools both seem to have extensions enabled by default even when
targeting the MSVC ABI.

This can be observed with the `RunCMake.CompileFeatures` test.
It fails with the GNU-like `clang/clang++` front-end, but removing
the above special case makes it pass.  The test passes either way
with the MSVC-like `clang-cl` front-end.
2022-02-03 12:06:00 -05:00
Craig Scott
cbb87e0a2c ExternalProject: Add support for USES_TERMINAL_PATCH keyword
This brings the patch step into line with all the others which already
had their own `USES_TERMINAL_<step>` keyword. All steps (including
patch) already have their own `LOG_<step>` keyword too, so the lack of
`USES_TERMINAL_PATCH` was inconsistent.
2022-02-03 09:27:35 -05:00
Brad King
23b1d8f03c CheckPIESupported: Document version adding support for more languages 2022-02-03 07:53:45 -05:00
Evgeniy Shcherbina
fd6b8fa40e GoogleTest: Preserve spaces in test parameters
Before the fix the gtest_discover_tests() function would strip the
user data in test parameters (everything to the right of GetParam())
of spaces. Now the parameters aren't altered in any way.

Fixes #23058
2022-02-03 14:12:53 +03:00
Brad King
9245925810 Merge topic 'cuda_generic_arch_all'
8f64df0a7c CUDA: Generic all and all-major support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !6816
2022-02-02 08:23:19 -05:00
Brad King
1e1e04db75 Merge topic 'ep-redownload-on-SOURCE_DIR-change'
d3477eba06 ExternalProject: Rerun download on SOURCE_DIR change

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6926
2022-02-02 08:17:51 -05:00
Raul Tambre
8f64df0a7c CUDA: Generic all and all-major support
Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags,
2021-08-17) added all and all-major options to CUDA_ARCHITECTURES. These are
fairly generic and likely to see real-world use by distributors. Thus it's
desirable to support these also for Clang and older NVCC versions.

The supported architectures are dependent on the toolkit version. We determine
the toolkit version prior to compiler detection. For NVCC we get the version
from the vendor identification output, but for Clang we need to invoke NVCC
separately.

The architecture information is mostly based on the Wikipedia list with the
earliest supported version being CUDA 7.0. This could be documented and
expanded in the future to allow projects to query CUDA toolkit version and
architecture information.
For Clang we additionally constrain based on its support.

Additionally the architecture mismatch detection logic is fixed, improved and
updated for generic support:
* Commit 01428c55 (CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work
  during detection, 2020-08-29) enabled CMAKE_CUDA_COMPILER_ID_REQUIRE_SUCCESS
  if CMAKE_CUDA_ARCHITECTURES is specified. This results in
  CMakeDetermineCompilerID.cmake printing the compiler error and our code for
  presenting the mismatch in a user-friendly way being useless. The custom
  logic seems preferable so go back to not enabling it.
* Commit 14d8a276 (CUDA: Support nvcc 11.5 new -arch=all|all-major flags,
  2021-08-17) tried to support CMP0054 but forgot to add x to the interpolated
  result. Thus the conditions would always evaluate to false. This is fixed as
  a byproduct of removing NVIDIA specific checks, improving the error message
  and replacing architectures_mode with a simpler architectures_explicit.

Visual Studio support omits testing the flags during detection due to
complexities in determining the toolkit version when using it.
A long-term proper implementation would be #23161.

Implements #22860.
2022-02-01 18:25:20 +02:00
Brad King
6bbbd42e19 Merge topic 'FindHDF5-imported-per-config'
db9d911db0 FindHDF5: Set config-specific locations for imported targets
d28e5263fe FindHDF5: Drop IMPORTED_IMPLIB property from imported UNKNOWN libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6931
2022-02-01 10:35:32 -05:00
Brad King
9d439dfd1b Merge topic 'feature/findruby-3x'
6b6bc7791d FindRuby: evict non-matching binaries and keep scanning.
42d99a248e FindRuby: add support for versions up to 3.1.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6925
2022-02-01 10:31:39 -05:00
Brad King
e7e5ebd0e3 Merge topic 'cpack_nsis_no_description'
b56e0f4689 CPack/NSIS: Fix description not displayed for components

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6920
2022-02-01 10:30:55 -05:00
Craig Scott
d3477eba06 ExternalProject: Rerun download on SOURCE_DIR change
Fixes: #21748
2022-02-01 22:31:29 +11:00
Brad King
db9d911db0 FindHDF5: Set config-specific locations for imported targets
Update the imported target locations added by commit a8e0a6b3e4
(FindHDF5: Port changes from VTK, 2020-06-10, v3.19.0-rc1~312^2~1) to
use config-specific locations.

Issue: #21637
2022-01-31 17:42:39 -05:00