Commit Graph

13127 Commits

Author SHA1 Message Date
Brad King
b548c7efa6 Merge topic 'FindCUDAToolkit-static-deps' into release-3.26
1d6c343661 FindCUDAToolkit: Add missing static library dependencies on pthread and libdl

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8422
2023-04-26 10:22:26 -04:00
Robert Maynard
1d6c343661 FindCUDAToolkit: Add missing static library dependencies on pthread and libdl
Discourse-topic: https://discourse.cmake.org/t/7946
2023-04-26 10:19:59 -04:00
Robert Maynard
11a9f88bdf FindCUDAToolkit: Fix nvrtc_static dependencies on Windows
Required for CUDA toolkit 11.5:

* https://docs.nvidia.com/cuda/archive/11.5.0/nvrtc/index.html#build-instruction
2023-04-25 13:37:19 -04:00
Brad King
038cd7f620 Merge topic 'FindCUDAToolkit-nvptxcompiler_static-deps' into release-3.26
8711231739 FindCUDAToolkit: nvptxcompiler_static correctly specify dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8395
2023-04-06 09:05:49 -04:00
Robert Maynard
516d807423 FindCUDAToolkit: Add dependency between cusparse and nvJitLink
Starting in CUDA 12.0 cusparse uses nvJitLink. As part of verifying this PR I also corrected the nvJitLink dependencies
2023-04-05 11:37:06 -04:00
Robert Maynard
8711231739 FindCUDAToolkit: nvptxcompiler_static correctly specify dependencies
Avoids linking to `Threads::Threads` on non-unix systems where it isn't needed. In addition ensures that dlopen symbols are resolved.
2023-04-05 10:57:55 -04:00
Brad King
f8deb84120 Merge topic 'swift-xcode-14.3' into release-3.26
52dbfefe0d Xcode: Fix detection of Swift compiler location for Xcode 14.3

Merge-request: !8388
2023-04-04 09:24:57 -04:00
Brad King
52dbfefe0d Xcode: Fix detection of Swift compiler location for Xcode 14.3
Previously we tried to match output from `xcodebuild` to detect the
path to the `swiftc` tool.  This approach is used for C and CXX
for historical reasons, but is unnecessary for Swift.  We know the
name of the tool, so we can just ask `xcrun --find swiftc`.

Fixes: #24666
2023-04-03 18:59:57 -04:00
Brad King
921ffd3070 Merge topic 'vs-fortran-try_compile' into release-3.26
4da50fe3f4 VS: Remove extra try_compile argument in Intel Fortran check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8383
2023-04-03 08:56:54 -04:00
Brad King
4da50fe3f4 VS: Remove extra try_compile argument in Intel Fortran check
Refactoring in commit d00d8537f6 (Modules: Use new keyword-dispatched
try_compile signature, 2022-09-16, v3.25.0-rc1~115^2) accidentally
left one of the old signature arguments behind, causing a warning.
2023-03-31 08:22:23 -04:00
YR Chen
006e1995eb Swift: Restore compatibility with old C++ driver
The `-wmo` flag added by commit 6063428de7 (Swift: Update default build
flags, 2022-10-03, v3.26.0-rc1~585^2~1) behaves differently with the old
driver.  Detect when the old driver is being used, and avoid adding that
flag.

Fixes: #24641
2023-03-28 10:02:05 -04:00
Brad King
a6bb4975ab FindHDF5: Restore parallel HDF5 detection with only CXX enabled
Since commit 14c46fb16a (FindHDF5: Find C component with only CXX
compiler, 2022-12-13, v3.26.0-rc1~175^2), if CXX is enabled but C is
not, the `_HDF5_test_regular_compiler_C` helper writes a `.cpp` source
but the `_HDF5_invoke_compiler` still expects a `.c` source.  Refactor
the logic to select a name for the source file up front, and use it in
both helpers.

Fixes: #24627
Issue: #24241
2023-03-22 11:50:18 -04:00
Brad King
15a86d45d1 Merge topic 'clang-windows-cxx-modules' into release-3.26
1b7c26da49 Ninja: Wrap rules using '>' shell redirection with 'cmd /C' on Windows
ffd8537acf Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end
6013227230 cmGlobalNinjaGenerator: Use forward slashes in clang modmap format on Windows
d9d74b5e8a cmDyndepCollation: Drop outdated mentions of CXX_MODULE_INTERNAL_PARTITIONS
edab56d29a cmLocalNinjaGenerator: De-duplicate condition for using 'cmd /C' on Windows
8ebe3f92b3 cmGlobalNinjaGenerator: Detect GNU-like command-line for dyndep collator
f3ca199c9b cmGlobalNinjaGenerator: Factor out GNU-like command-line detection on Windows
f79817fcf0 cmCxxModuleMapper: Use value semantics in path conversion callback
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8346
2023-03-21 08:58:42 -04:00
Brad King
90d90a5d91 Merge topic 'clang-cl-showIncludes' into release-3.26
843fc607de Ninja: Restore detection of clang-cl showIncludes prefix
3346570ae9 Tests: Comment RunCMake.Ninja ShowIncludes sample input languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8344
2023-03-21 08:57:34 -04:00
Brad King
ffd8537acf Clang: Record Clang 16.0 C++ modules flags only for GNU-like front-end
The settings added by commit 3fe8e33f27 (Clang: Record Clang 16.0 flags
for our experimental C++ modules support, 2023-03-03, v3.26.0-rc6~6^2)
work only for the GNU-like `clang++` front-end, and not for the
MSVC-like `clang-cl` on Windows.

Also quote the path to `clang-scan-deps` to support spaces in its path.

Issue: #24611
2023-03-20 13:13:08 -04:00
YR Chen
843fc607de Ninja: Restore detection of clang-cl 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 `clang-cl`, which uses a relative path, forward
slashes, and is always in English [1]:

    Note: including file: ./foo.h

Update the regex to match that too.

[1] https://github.com/llvm/llvm-project/blob/llvmorg-16.0.0/clang/lib/Frontend/HeaderIncludeGen.cpp#L102

Co-authored-by: Brad King <brad.king@kitware.com>
2023-03-20 10:08:25 -04:00
Marc Chevrier
4c902d675b FindPython: ensure Stable ABI is correctly handled
Fixes: #24610
2023-03-20 08:10:53 -04:00
Brad King
5e5a21aadd Merge topic 'CMakePackageConfigHelpers-ARCH_INDEPENDENT' into release-3.26
6988ddf8ac WriteBasicConfigVersionFile: Fix regression in ARCH_INDEPENDENT check

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8337
2023-03-17 07:54:16 -04:00
Brad King
6988ddf8ac WriteBasicConfigVersionFile: Fix regression in ARCH_INDEPENDENT check
Refactoring in commit 77982de955 (CMakePackageConfigHelpers: only emit
arch check if needed, 2023-01-29, v3.26.0-rc1~16^2) did not correctly
preserve the check for empty `CMAKE_SIZEOF_VOID_P`.  Fix it.

The difference between the version files generated before and after is:

    -if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "")
    +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")

This restores the check generated before the above-mentioned commit.

Fixes: #24608
2023-03-16 11:26:10 -04:00
scivision
58ab34d88a FindMatlab: add version/release map for R2023a 2023-03-16 11:08:05 -04:00
Brad King
97fcd3bd30 CheckCompilerFlag: Revert 'Match the Clang "argument unused" output ...'
Revert commit 5b45a3d0ce (CheckCompilerFlag: Match the Clang "argument
unused" output for all languages, 2023-01-23, v3.26.0-rc1~38^2).  It
broke existing projects that were silently tolerating unrelated unused
arguments in their checks for C and CXX.  For example, using
`CFLAGS=-nostdinc` or `CXXFLAGS=-nostdinc++` causes those flags to be
used when driving the linker as well, and Clang warns they are unused in
that case.

Add a test case covering the now-restored behavior.

Fixes: #24591
2023-03-13 16:18:50 -04:00
Brad King
9f54901ed9 CompilerId: Restore logging of failed identifications in CMake 3.25
Changes in commit 9c5bd7fe3a (CompilerId: Output errors from all
attempts at detection, 2022-08-16, v3.25.0-rc1~290^2) accidentally
stopped logging failed compiler identification build output.

This was fixed for CMake 3.26 and later by commit 24ccc8c3c9
(CompilerId: Restore logging of failed identifications, 2023-01-16,
v3.26.0-rc1~70^2~6).  Backport it to 3.25.
2023-03-13 14:29:50 -04:00
Brad King
5f4dad37f0 Merge topic 'clang-16-cxx-modules' into release-3.26
3fe8e33f27 Clang: Record Clang 16.0 flags for our experimental C++ modules support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: Alex <leha-bot@yandex.ru>
Merge-request: !8285
2023-03-06 08:59:20 -05:00
Brad King
9c181ad470 Merge topic 'GoogleTest-type-param-suite' into release-3.26
9aa9032266 GoogleTest: Restore suite name for type-parametrized tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8282
2023-03-06 08:53:40 -05:00
Brad King
df18138b5b Merge branch 'GoogleTest-type-param-suite' into release-3.25
Merge-request: !8282
2023-03-03 12:58:30 -05:00
Brad King
3fe8e33f27 Clang: Record Clang 16.0 flags for our experimental C++ modules support
LLVM/Clang 16.0 now contains official support for what CMake needs.
2023-03-03 12:44:53 -05:00
Brad King
9aa9032266 GoogleTest: Restore suite name for type-parametrized tests
Fix a regression from commit 073dd1bd81 (GoogleTest: Change format for
typed tests, 2022-02-07, v3.23.0-rc1~4^2) in the suite name detection.

Co-authored-by: Evgeniy Shcherbina <ixsci@pm.me>
Fixes: #24563
2023-03-03 10:38:02 -05:00
Brad King
cb1b95886b Merge topic 'ExternalProject-revert-install' into release-3.26
771387523a ExternalProject: Restore driving install through build system

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Craig Scott <craig.scott@crascit.com>
Reviewed-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8279
2023-03-03 09:22:45 -05:00
Brad King
771387523a ExternalProject: Restore driving install through build system
Revert commit 66b5d51f38 (ExternalProject: Install CMake projects
using 'cmake --install', 2022-09-08, v3.25.0-rc1~150^2).
It changed the ExternalProject install step command from:

    cmake --build <dir> --target install --config <cfg>

to:

    cmake --install <dir> --config <cfg>

The latter command no longer runs the external project build system
during the install step.  We could consider using the commands:

    cmake --build <dir> --target all --config <cfg>
    cmake --install <dir> --config <cfg>

as the install step, but if `CMAKE_SKIP_INSTALL_ALL_DEPENDENCY` is
used in the external project, that can change semantics too.

Revert the original change pending further investigation on other ways
to support its motivating use case.  Add a test covering the
previously-regressed use case.

Fixes: #24567
Issue: #23946
2023-03-02 14:28:26 -05:00
Marc Chevrier
764441e672 FindPython: fix erroneous ${CMAKE_SHARED_LIBRARY_SUFFIX} matching
Fixes: #24556
2023-03-01 12:34:13 +01:00
Kyle Edwards
24c7279a6f FindOpenSSL: Search for -pthread flag
Because -pthread doesn't begin with -l, it doesn't show up in the
pkgconfig LIBRARIES variable, causing FindOpenSSL to not add the
Threads::Threads dependency. Explicitly search LDFLAGS_EXTRA
for -pthread and add the dependency if it's found.

Fixes: #24532
2023-02-23 13:31:23 -05:00
Brad King
70ecc3c36a Merge topic 'BundleUtilities-chmod-later' into release-3.26
1430f7f574 BundleUtilities: Avoid unnecessary chmod in fixup_bundle_item

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !8232
2023-02-21 08:38:59 -05:00
Brad King
1430f7f574 BundleUtilities: Avoid unnecessary chmod in fixup_bundle_item
Move the permissions modification added by commit 88fed668b1 (Make
bundle items writable before fixup, 2010-09-07, v2.8.3~129^2) inside the
condition added by commit 45ed314bff (BundleUtilities: do not run
install_name_tool on scripts, 2020-07-27, v3.19.0-rc1~404^2).
There is no reason to add write permissions to a file that we are
not going to modify.

Fixes: #24424
2023-02-20 13:17:04 -05:00
Brad King
a8cedb1572 FindOpenSSL: Fix regression in dependency on threads
Since commit 1b7804edd0 (FindOpenSSL: use extra dependencies from
pkg-config as well, 2022-12-05, v3.26.0-rc1~227^2) we conditionally find
Threads but unconditionally depend on it.  Make the conditions
consistent.

Fixes: #24505
2023-02-20 10:53:42 -05:00
David Truby
3f1e58c5b9 LLVMFlang: Fix post-preprocess compile for fixed-form Fortran
LLVM Flang's preprocessor output is always valid fixed form Fortran with
a fixed line length of 72. If an application tries to use fixed form
with a different line length, this will fail in the
post-preprocessing compilation step as they will pass a flag asking for
a different fixed line length.

To fix this we can pass -ffixed-line-length-72 to the post-preprocess
compilation stage. This will be ignored when the input is free form
Fortran, and force to a 72 line length when the input is fixed.
2023-02-14 09:22:12 -05:00
Brad King
2a75edb342 LCC: Fix extraction of __LCC__ version components
Previously the logic only worked for major versions of the form `1.xx`.
Fix it to work with versions `2.xx` and above.
2023-02-13 09:29:32 -05:00
Brad King
4ce614eb5a Merge topic 'findopenssl-static-findpkg-fix' into release-3.26
652f34eab9 FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ON

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !8174
2023-02-08 11:37:59 -05:00
Eisuke Kawashima
6d48f48d5d FetchContent: Bump documented example Catch2 to v3.0.1
The previous Catch2 v2.13.4 does not compile on some platforms [1].

[1] https://github.com/catchorg/Catch2/issues/2326
2023-02-07 10:54:25 -05:00
Kyle Edwards
652f34eab9 FindOpenSSL: Use static pkgconfig if OPENSSL_USE_STATIC_LIBS=ON
Fixes: #24395
2023-02-07 10:38:20 -05:00
Brad King
5d40cf45fa Merge topic 'android-ndk-legacy-toolchain' into release-3.26
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8170
2023-02-07 09:32:19 -05:00
Brad King
7aee115ff4 Merge topic 'FindCUDAToolkit-nvrtc-builtins' into release-3.26
9688a8ebc2 FindCUDAToolkit: Fix `nvrtc_builtins_static` library name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8162
2023-02-07 09:00:35 -05:00
Brad King
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file
This variable has been provided since commit 746906242d (Android: Detect
NDK version number, 2021-02-26, v3.20.0-rc3~1^2~3) when using CMake's
NDK support or the modern NDK toolchain file.  Since commit 005e2cdfb0
(Android: Do not use gold for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2)
we need the value in our compiler/platform information files, so provide
it when using the NDK legacy toolchain file too.

Revert commit 1c86e397fe (Android/Clang: Tolerate undefined
CMAKE_ANDROID_NDK_VERSION, 2022-09-16, v3.25.0-rc1~118^2) since the
variable should now always be defined.

Issue: #21772
Fixes: #24386
2023-02-06 17:17:25 -05:00
scivision
b19036d8b3 Help: CheckSource{Compiles,Runs}: fix typo and clarify 2023-02-06 09:55:23 -05:00
Paul Taylor
9688a8ebc2 FindCUDAToolkit: Fix nvrtc_builtins_static library name
Update the change from commit 2a94c762ed (FindCUDAToolkit: Add support
for CUDA::nvrtc_static, 2023-01-20, v3.26.0-rc1~55^2).  The lib is named
`libnvrtc-builtins_static.a`, not `libnvrtc_builtins_static.a`.
2023-02-06 09:36:43 -05:00
Brad King
71f9c1943d FindImageMagick: Fix documentation syntax in usage example 2023-02-01 13:58:23 -05:00
Brad King
ce0139a1df Merge topic '_hm_swift_threads_pthread'
d7963aa9ee FindThreads: Filter -pthread out for compatibility with Swift linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8142
2023-02-01 09:09:52 -05:00
Brad King
2f5b0ac34e Merge topic 'CMakePackageConfigHelpers-ARCH_INDEPENDENT'
77982de955 CMakePackageConfigHelpers: only emit arch check if needed

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8133
2023-01-31 09:33:53 -05:00
Harry Mallon
d7963aa9ee FindThreads: Filter -pthread out for compatibility with Swift linker 2023-01-31 09:11:08 +00:00
Brad King
1c4825066b Merge topic 'msvc-showIncludes'
8f82e755f3 Ninja: Fix detection of MSVC showIncludes prefix in Italian
d6e7e4d4a1 Tests: Extend RunCMake.Ninja ShowIncludes cases to cover more languages
9596305c0b Tests: Generalize RunCMake.Ninja ShowIncludes test infrastructure
c6dd4fa21d Tests: Extend RunCMake.Ninja ShowIncludes case with sample path
a9d97492fd Ninja: Record showIncludes detection in configure log

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8129
2023-01-30 10:23:31 -05:00
Andrea Pappacoda
77982de955 CMakePackageConfigHelpers: only emit arch check if needed
Before this patch, the write_basic_package_version_file() function of
the CMakePackageConfigHelpers module always emitted an architecture
check, even if the ARCH_INDEPENDENT option was specified. While this is
not an issue when configuring builds, as the check is skipped, this can
create issues when the "arch independent" version files are installed in
the datadir (e.g. /usr/share) in a MultiArch environment like Debian,
where different architecture packages of the same libraries can be
coinstalled; as the amd64 version of a given library contains "8 * 8"
in the file, while the i386 one contains "4 * 8", there's a conflict, as
files in /usr/share are expected to be identical across architectures.

This patch fixes this issue by only emitting the architecture check code
if needed; when ARCH_INDEPENDENT is specified, no code is written at
all.

Here's a diff between the version files generated before and after this
patch:

    diff -u old/indep.cmake new/indep.cmake
    --- old/indep.cmake	2023-01-29 13:43:04.840671117 +0100
    +++ new/indep.cmake	2023-01-29 13:57:28.475191551 +0100
    @@ -52,19 +52,3 @@
     endif()

    -# if the installed project requested no architecture check, don't perform the check
    -if("TRUE")
    -  return()
    -endif()
    -
    -# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
    -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
    -  return()
    -endif()
    -
    -# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
    -if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
    -  math(EXPR installedBits "8 * 8")
    -  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
    -  set(PACKAGE_VERSION_UNSUITABLE TRUE)
    -endif()
    diff -u old/no-indep.cmake new/no-indep.cmake
    --- old/no-indep.cmake	2023-01-29 13:42:05.010710508 +0100
    +++ new/no-indep.cmake	2023-01-29 13:57:40.914237219 +0100
    @@ -52,13 +52,8 @@
     endif()

    -# if the installed project requested no architecture check, don't perform the check
    -if("FALSE")
    -  return()
    -endif()
    -
     # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
    -if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
    +if(CMAKE_SIZEOF_VOID_P STREQUAL "" OR "8" STREQUAL "")
       return()
     endif()

Fixes: #24375
2023-01-29 14:00:13 +01:00