Commit Graph

13342 Commits

Author SHA1 Message Date
Brad King
db92b8d401 Merge topic 'FindCUDAToolkit-cupti-nvperf'
f9579ffaa6 FindCUDAToolkit: Add cupti nvperf and pcsampling targets

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8545
2023-06-08 10:48:10 -04:00
Robert Maynard
f9579ffaa6 FindCUDAToolkit: Add cupti nvperf and pcsampling targets 2023-06-07 13:58:09 -04:00
Brad King
e4c53cdc15 BinUtils: Drop now-unnecessary cross-compiling workaround for Apple hosts
Previously we added fallbacks to `llvm-{ar,strip}` on Apple hosts
in case of cross-compiling because the `APPLE` platform variable
was not set w.r.t. the target platform.  The platform variable
has been fixed, so remove the fallbacks.

Issue: #23333
2023-06-07 07:02:20 -04:00
Brad King
1373373823 enable_language: Establish target platform identification variables earlier
Set target platform identification variables like `APPLE` and `LINUX`
as soon as the target system is identified.  This makes them available
during toolchain and binutils selection.

Fixes: #23333
2023-06-07 07:02:20 -04:00
Brad King
1d916bf3d2 kFreeBSD,GNU: Provide multiarch library directory regex earlier
Make `CMAKE_LIBRARY_ARCHITECTURE_REGEX` available while determining
compilers before `Platform/{kFreeBSD,GNU}` is loaded.

Follow up commit cc737ae829 (Linux: Provide multiarch library directory
regex earlier, 2023-05-31).
2023-06-06 15:35:20 -04:00
Brad King
ec472999dc Merge topic 'apple-clang-asm-compiler-id'
8c789bee83 AppleClang: Fix ASM compiler identification

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8537
2023-06-06 10:00:52 -04:00
Brad King
1ad77d7029 Merge topic 'FindPython-distutils-deprecation'
988ac305bd FindPython: update for distutils module deprecation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8538
2023-06-06 09:54:04 -04:00
Gregor Jasny
8c789bee83 AppleClang: Fix ASM compiler identification
Recent AppleClang compilers identify themselves as
`Apple clang version 14.0.3 (clang-1403.0.22.14.1)`.
2023-06-05 17:31:35 -04:00
Marc Chevrier
988ac305bd FindPython: update for distutils module deprecation
Fixes: #24956
2023-06-05 11:22:03 +02:00
Brad King
5a77c2e02a FindOpenACC: Keep flags together in imported target usage requirements
If `OpenACC_C_FLAGS` contains `-h acc`, the flag pair needs to
be preserved as a shell command fragment, and must not be split by
de-duplication with other `target_compile_options`.

Fixes: #24963
2023-06-02 09:15:40 -04:00
Brad King
56ff12501f FindOpenMP: Keep flags together in imported target usage requirements
If `OpenMP_C_FLAGS` contains `-Xclang -fopenmp`, the flag pair needs to
be preserved as a shell command fragment, and must not be split by
de-duplication with other `target_compile_options`.

Fixes: #24966
2023-06-01 15:18:33 -04:00
Brad King
9a63aa8d57 Merge topic 'ep-tls-verify'
dcbc36572f ExternalProject: Respect TLS_VERIFY for git update step
8fdce89f70 Help: Clarify default TLS_VERIFY behavior for git download method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8516
2023-06-01 11:42:21 -04:00
Craig Scott
dcbc36572f ExternalProject: Respect TLS_VERIFY for git update step
Git config options can be passed to git clone before or after the
"clone" keyword. If specified before, the config setting is only
applied to that command invocation. It acts to override the value
in the global or project defaults (the latter doesn't exist for clone).
When the config setting is passed after the "clone" keyword, it is
saved into the cloned repository's config and will persist for later
git operations. The existing implementation expected the latter
behavior, but put the config setting before the "clone" keyword
and therefore the setting was not persisting to the git update
step. Move it to after the "clone" keyword so that it will persist.

The submodule handling is different. There is no support for
doing a "git submodule update" with a "sticky" config setting.
Instead, you have to pass the setting with all such calls. The
existing implementation was doing this for the clone step, but
not the git update step. Add the config setting there as well
so that submodules also effectively have the sslVerify setting
persist to the update step too.

Fixes: #18948
2023-06-01 10:27:07 +10:00
Brad King
bae57dc281 HIP: Fix search for hip-lang CMake package on multiarch distros
We need `CMAKE_LIBRARY_ARCHITECTURE` to find the package before HIP
compiler ABI detection.  However, if HIP is the first enabled language,
the value is not known until `CMAKE_HIP_LIBRARY_ARCHITECTURE` is
determined by the ABI detection step.  Resolve this by detecting
`CMAKE_HIP_LIBRARY_ARCHITECTURE` from the compiler id output.

Fixes: #24562
2023-05-31 16:53:47 -04:00
Brad King
cc737ae829 Linux: Provide multiarch library directory regex earlier
Make `CMAKE_LIBRARY_ARCHITECTURE_REGEX` available while determining
compilers before `Platform/Linux` is loaded.
2023-05-31 16:52:54 -04:00
Brad King
0dc3e6894f Merge topic 'find-boost-1.82'
5cbbe55de8 FindBoost: Add support for Boost 1.82

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8514
2023-05-31 09:40:24 -04:00
huangqinjin
5cbbe55de8 FindBoost: Add support for Boost 1.82
Update the list of known versions.

There is a new header-only library, Boost.MySQL. It has no
dependencies and has a core header `<boost/mysql.hpp>`.

Run the command

    cmake -DBOOST_DIR=/path/to/boost_1_82_0 \
      -P Utilities/Scripts/BoostScanDeps.cmake

to extract dependencies from the 1.82.0 source tree.
They are the same as 1.81's dependencies, so just update
the version check for warning about newer versions.
2023-05-31 09:29:16 -04:00
Brad King
888c235eca Merge topic 'werror_space_fix'
cec6f98018 CMakeDetermineCompilerABI: Avoid removing the flag after -Werror

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !8518
2023-05-31 09:25:08 -04:00
Raul Tambre
cec6f98018 CMakeDetermineCompilerABI: Avoid removing the flag after -Werror
The matching became too eager after commit 079ea66468
(CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags, 2020-10-04,
v3.19.0-rc1~45^2). When -Werror was specified without a value we would
eat the following flag. Prevent this by disallowing "-" as the first
character of the flag's value.

Fixes: 079ea66468
See-also: https://discourse.cmake.org/t/8230
2023-05-30 11:03:09 -04:00
Craig Scott
8fdce89f70 Help: Clarify default TLS_VERIFY behavior for git download method 2023-05-28 20:16:19 +10:00
Marc Chevrier
0626b62cf2 Link Step: ensure the correct linker is used for depfile configuration
This is related to MR !8443.
2023-05-28 11:28:08 +02:00
Brad King
b8449712a3 Merge topic 'implicit-link-dir-exclude'
023de565d3 Optionally exclude implicit link directories via environment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Roscoe A. Bartlett <rabartl@sandia.gov>
Merge-request: !8506
2023-05-26 09:27:23 -04:00
Brad King
023de565d3 Optionally exclude implicit link directories via environment
A misconfigured compiler may pass extraneous implicit link directories
to its linker.  If they are in `CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES`,
CMake may generate extra `-L` flags on mixed-language link lines that
break linking.  Add an environment variable that users can set to work
around such misconfiguration of their compilers.
2023-05-25 13:42:58 -04:00
William R. Dieter
9875b11969 IntelLLVM: Use compiler driver as linker for MODULE libraries too
Since commit 79921fb00c (IntelLLVM: Set linker to compiler driver for
Windows, 2021-10-19, v3.23.0-rc1~127^2) we default to the compiler
driver as linker for executables, shared libraries, and static
libraries.  Not doing so for shared modules was an oversight.  Copying
the shared library command line for shared modules fixes the problem
(and also is what we do for MSVC).

The MSVC linker is fine for many cases, however it does not support GPU
offload code generated by the IntelLLVM compilers.  Using the compiler
driver as linker, or at least a linker that understands the object
format, is required for linking shared modules that use GPU offload
(e.g., with SYCL or OpenMP).

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2023-05-25 13:17:41 -04:00
Brad King
d491ea1973 Merge topic 'ep-update-disconnected'
8cc45e150a ExternalProject: Make hg download method respect UPDATE_DISCONNECTED
1512dc43cb ExternalProject: Avoid reconfigure when updates are disconnected
1d29cf37a1 Tests: Reduce warning noise in ExternalProjectUpdate test

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8498
2023-05-23 11:06:19 -04:00
Brad King
ffb4804c88 Merge topic 'iar-fix-support-avr-8101'
57f22c6a3d IAR:Fix version detection for xlinkavr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8501
2023-05-23 11:01:48 -04:00
Brad King
ee98a8d24a Merge topic 'FindOpenSSL-deps'
f7e1e0545f FindOpenSSL: Enable static library dependencies on more platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Jürg Billeter <j@bitron.ch>
Merge-request: !8497
2023-05-23 10:57:51 -04:00
Craig Scott
8cc45e150a ExternalProject: Make hg download method respect UPDATE_DISCONNECTED 2023-05-23 22:39:44 +10:00
Craig Scott
1512dc43cb ExternalProject: Avoid reconfigure when updates are disconnected
When UPDATE_DISCONNECTED is true, create separate update_disconnected
and patch_disconnected targets which have ALWAYS set to false.
Make the configure step depend on patch_disconnected in this case too.
This ensures the configure, build, install and test steps are not
executed unnecessarily when updates are disconnected.

Make the update and patch commands depend on the details of those
steps. This ensures they are re-executed when any of those details
change, even if updates are disconnected.

Allow updates to occur even if UPDATE_DISCONNECTED is true, but don't
contact the remote in that case. If asked to update to a ref that isn't known
locally, that is now detected and causes a fatal error when updates are
disconnected. Previously, the build would have silently and erroneously
continued to use the old ref.

Fixes: #16419, #19703, #21146
2023-05-23 22:39:44 +10:00
Brad King
04b0d5c862 codespell: Fix typos 2023-05-22 16:51:15 -04:00
Brad King
970716e232 Merge topic 'FindOpenSSL-trust-root-dir'
5cc8a69867 FindOpenSSL: Trust the user's OPENSSL_ROOT_DIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8486
2023-05-22 12:37:27 -04:00
Felipe Torrezan
57f22c6a3d IAR:Fix version detection for xlinkavr
- The comparison for minimum version for detecting the newer xlinkavr
  was encompassing V7.30.5, which uses the old `xlink` without target suffix.
2023-05-22 12:08:33 +02:00
Brad King
f7e1e0545f FindOpenSSL: Enable static library dependencies on more platforms
Activate the logic from commit 8098bd5768 (FindOpenSSL: add pthread and
dl dependencies to static lib on Linux, 2019-09-13, v3.16.0-rc1~72^2)
on more UNIX platforms.

Fixes: #24870
2023-05-19 15:08:39 -04:00
Richard Levitte
5cc8a69867 FindOpenSSL: Trust the user's OPENSSL_ROOT_DIR
When the user has specified the OpenSSL installation root directory,
through the variable OPENSSL_ROOT_DIR or the environment variable with
the same name, trust it, don't try to find OpenSSL anywhere else.

Fixes: #18352
2023-05-19 05:59:57 +02:00
Brad King
b6c45d28b2 Merge topic 'clang_cxx26'
0183956d30 Clang: C++26 support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8480
2023-05-18 09:22:02 -04:00
Brad King
fed7b2f20e Merge topic 'iar-add-support-avr-8101'
7cd982faf4 IAR: Added support for IAR C/C++ Compiler for Microchip AVR 8.10+

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8481
2023-05-18 09:21:01 -04:00
Brad King
442ca1a59c Merge topic 'FindPython-fix-launcher-typo'
31faf3945f FindPython: fix interpreter launcher variable spelling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8487
2023-05-18 09:19:20 -04:00
Brad King
5855153cec Merge topic 'FindPython-fix-launcher-typo' into release-3.26
31faf3945f FindPython: fix interpreter launcher variable spelling

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8487
2023-05-18 09:19:19 -04:00
Ben Boeckel
31faf3945f FindPython: fix interpreter launcher variable spelling
Reported-by: Johannes (#cmake Slack)
2023-05-17 07:02:07 -04:00
Felipe Torrezan
7cd982faf4 IAR: Added support for IAR C/C++ Compiler for Microchip AVR 8.10+
- Added C17 support
- Added C++17 support
- Changed: IAR UBROF Linker (XLINK) suffixed with target architecture (xlinkavr)
2023-05-16 20:08:01 +02:00
Brad King
20c7219f8f Merge topic 'iar-align-output-extension'
cfec4c1c5e IAR: Enforce output extension for xlink targets
7fec8f993b IAR: Replace extension for compiler and assembler

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8477
2023-05-16 10:44:23 -04:00
Brad King
a59b35ba33 Merge topic 'msvc-wine-showIncludes'
fb3c4715cd Ninja: Restore detection of msvc-wine showIncludes prefix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: huangqinjin <huangqinjin@gmail.com>
Merge-request: !8479
2023-05-16 10:40:09 -04:00
Raul Tambre
0183956d30 Clang: C++26 support
Added in LLVM commit b763d6a4ed4650c74c6846d743156468563b0e31.
This time the final flag form is supported from the get-go to reduce churn.
2023-05-16 09:51:07 +03:00
Brad King
fb3c4715cd Ninja: Restore detection of msvc-wine showIncludes prefix
Since commit 8f82e755f3 (Ninja: Fix detection of MSVC showIncludes
prefix in Italian, 2023-01-26, v3.26.0-rc1~20^2) our regex no longer
matches the output from `msvc-wine`, which uses forward slashes:

    Note: including file: /path/to/foo.h

`cl /showIncludes` under Wine prints paths of the form `Z:\path\to\file`,
but the `msvc-wine` wrapper converts them to the form `/path/to/file` so
that native Ninja can be used.  Update our regex to match the prefix
followed by a path with a leading forward slash.

Fixes: #24908
2023-05-15 15:34:55 -04:00
Joakim Lönnberg
cfec4c1c5e IAR: Enforce output extension for xlink targets 2023-05-12 13:58:32 +02:00
Brad King
c568a6bcf2 Merge topic 'ExternalProject-touch-echo'
3bf0830e44 ExternalProject: Avoid adding empty touch command on "ALWAYS" steps

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Merge-request: !8468
2023-05-11 10:07:02 -04:00
Antonio Caggiano
3bf0830e44 ExternalProject: Avoid adding empty touch command on "ALWAYS" steps
The problem fixed by commit c0b749cf62 (ExternalProject: Always add a
command to a step, 2014-11-05, v3.2.0-rc1~402^2~3) may occur for an
empty `COMMAND ${touch}` too, so avoid specifying any `COMMAND` at all
if there is no touch command.
2023-05-10 09:56:31 -04:00
Brad King
4490a0c266 Merge topic 'dankm/tcsuffix'
6a82852dc2 Allow toolchain suffix without leading dash

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8462
2023-05-10 09:36:42 -04:00
Dan McGregor
6a82852dc2 Allow toolchain suffix without leading dash
FreeBSD installs both LLVM and gcc with tools named after the
major version, in the form "clang<major>", such as "clang16".

Detect compilers named this way, and find the related toolchain
tools.
2023-05-08 18:09:27 -06:00
Raul Tambre
eacacc70fc Clang: use -std=c++23 for Clang 17.0+
Canonical flag changed in LLVM commit ba15d186e5cef2620d562c6c9d9a6d570382cd0a.
2023-05-08 20:26:39 +03:00