Commit Graph

14061 Commits

Author SHA1 Message Date
Ben Boeckel
429902ebad Clang: support creating a target for imported modules 2024-04-12 11:46:40 -04:00
Ben Boeckel
4617f272b4 MSVC: support import std 2024-04-12 11:46:40 -04:00
Ben Boeckel
ffe74289b3 CMakeDetermineCompilerId: extract C++ standard library impl
This is needed for C++ modules because `import std` support may differ
based on the standard library implementation. Extract the information as
necessary.
2024-04-12 11:46:39 -04:00
Ben Boeckel
15bbd1d9b8 Experimental: add an experimental feature gate for import std 2024-04-12 11:46:39 -04:00
Ben Boeckel
f80c60df02 CMakeDetermineCompilerSupport: construct C++ modules targets
Compilers may implement this by implementing a `_cmake_cxx_import_std`
function which takes the standard version as an argument (e.g., `23`)
and creating a target named `CMake::CXX${std}` that represents how
`import std;` should be represented within CMake.
2024-04-12 09:32:29 -04:00
Brad King
652c8c6a9a Merge topic 'restore-pkg-prefix-var'
0e4db17764 CMakePackageConfigHelpers: Restore undocumented PACKAGE_PREFIX_DIR variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9420
2024-04-11 10:09:42 -04:00
Brad King
0e4db17764 CMakePackageConfigHelpers: Restore undocumented PACKAGE_PREFIX_DIR variable
Revert commit 6ddf8712cd (CMakePackageConfigHelpers: Use unique variable
name for pkg prefix, 2024-03-30, v3.29.1~8^2).  It regressed existing
projects that rely on the undocumented `PACKAGE_PREFIX_DIR` variable in
package configuration files generated by `CMakePackageConfigHelpers`.

Fixes: #25873
Fixes: #25885
Issue: #25827
2024-04-11 09:23:46 -04:00
Brad King
61234135e1 Merge topic 'GenerateExportHeader-clang-tidy'
461ae86e6f GenerateExportHeader: Suppress clang-tidy warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9418
2024-04-11 08:36:42 -04:00
ClausKlein
461ae86e6f GenerateExportHeader: Suppress clang-tidy warning
Add `NOLINT` for `unconditional-preprocessor-if` in generated files.
2024-04-10 16:43:48 -04:00
Brad King
254358a91b Merge branch 'backport-FindJasper-imported-target' 2024-04-10 12:20:24 -04:00
Kai Pastor
4ab860c4c7 FindJasper: Fix Jasper::Jasper IMPORTED_CONFIGURATIONS
In commit 6e8754c625 (FindJasper: Add IMPORTED target, 2021-10-06,
v3.22.0-rc1~20^2) this property was not set correctly.  This was
detected by `CMP0160` because the `IMPORTED` property is read-only.
2024-04-10 12:12:05 -04:00
Raul Tambre
f21dbf8f26 C++26: Fix C++/CUDA/HIP compile feature support
In commit f808d8afb9 (CMake: Support upcoming C++26 language level,
2022-08-19, v3.25.0-rc1~218^2) we forgot some necessary scaffolding.

Fixes: #25819
2024-04-09 11:38:59 +03:00
Brad King
c7cbe57e1f Clang: Fix detection of C++26 when targeting MSVC ABI
`_MSVC_LANG` may not be defined higher than C++20, but `__cplusplus` is.
2024-04-09 11:38:51 +03:00
Brad King
4022b969be Merge topic 'lang-std-levels'
80a5a86514 GNU: Fix detection of C++ 11 mode in GCC 4.{4,5,6}
c9cc3dc646 PGI: Fix detection of C++ 14/17 modes
7f05d472a2 NVHPC: Fix detection of C++ 20 mode on NVHPC < 22.7
3587579f34 XL/XLClang: Fix detection of C++ 14 mode on Linux
863cde8c19 Intel: Fix detection of C++ 14/17 modes on Linux/macOS
1e774a86d3 Intel: Fix detection of C++ 17/20 modes on Windows
b9d4db7098 CompilerId: Clarify C and C++ standard level detection
ae18811f2e IntelLLVM: Add C standard flags on Windows
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9412
2024-04-08 18:09:36 -04:00
Brad King
80a5a86514 GNU: Fix detection of C++ 11 mode in GCC 4.{4,5,6}
These versions of the compiler have experimental C++11 support and so do
not define `__cplusplus` correctly, but do define a feature macro we can
use to distinguish this mode.
2024-04-05 07:38:14 -04:00
Brad King
c9cc3dc646 PGI: Fix detection of C++ 14/17 modes
The PGI compiler is based on EDG.  Share conditions with Intel Classic.
2024-04-05 07:38:06 -04:00
Brad King
7f05d472a2 NVHPC: Fix detection of C++ 20 mode on NVHPC < 22.7
This compiler does not always define `__cplusplus` correctly, but does
define a feature macro that we can use to distinguish this mode.
2024-04-05 07:37:03 -04:00
Brad King
3587579f34 XL/XLClang: Fix detection of C++ 14 mode on Linux
This compiler does not always define `__cplusplus` correctly, but does
define a feature macro that we can use to distinguish this mode.
2024-04-04 17:56:31 -04:00
Brad King
863cde8c19 Intel: Fix detection of C++ 14/17 modes on Linux/macOS
The Intel Classic C++ compiler is based on EDG.  It does not always
define `__cplusplus` correctly, but does define feature macros that we
can use to distinguish these modes.
2024-04-04 17:56:02 -04:00
Brad King
1e774a86d3 Intel: Fix detection of C++ 17/20 modes on Windows
The Intel Classic C++ compiler for Windows does not always define
`_MSVC_LANG` correctly, but does define feature macros that we can use
to distinguish these modes.
2024-04-04 16:48:46 -04:00
Brad King
b9d4db7098 CompilerId: Clarify C and C++ standard level detection
Use named constants.  Regularize comparison patterns.
2024-04-04 15:13:17 -04:00
Brad King
352f8923fc Merge topic 'FindOpenSSL-SLP-layout'
9ff5dae3f6 FindOpenSSL: Update layout for Shining Light Productions debug libraries
aa86f487c2 FindOpenSSL: Update layout for Shining Light Productions 32-bit package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9402
2024-04-04 09:29:26 -04:00
Brad King
ae18811f2e IntelLLVM: Add C standard flags on Windows 2024-04-03 19:34:03 -04:00
Brad King
529ccb3dff IntelLLVM: Use C23 and C++23 flags only versions supporting them
Revise commit 4331f7b4bf (IntelLLVM: Add provisional flags for C23 and
C++23, 2023-01-12, v3.26.0-rc1~86^2).
2024-04-03 19:34:03 -04:00
Brad King
3ca7f37e5a Intel: Fix classic compiler version check for C++20 flag
The `-std=c++20` flag was added by Intel compiler 2019 update 3.
2024-04-03 19:34:03 -04:00
Matthias Isele
9ff5dae3f6 FindOpenSSL: Update layout for Shining Light Productions debug libraries
The installer no longer names debug libraries with a `d` suffix.  They
are distinguished by the per-runtime-library directory containing them.

Fixes: #25856
2024-04-03 16:59:30 -04:00
Matthias Isele
aa86f487c2 FindOpenSSL: Update layout for Shining Light Productions 32-bit package
Issue: #25856
2024-04-03 16:59:13 -04:00
Brad King
6e54534914 Merge topic 'FindCUDAToolkit-doc-linkcheck'
480cf4a714 FindCUDAToolkit: Replace documentation links with their permanent redirects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9397
2024-04-03 09:39:32 -04:00
Brad King
7b1b5fd287 Merge topic 'artos-lib-prefix'
e6b63b5cb2 ARTOS: Add support for finding library files named with 'lib' prefix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Bert Ezendam <bert.ezendam@alliander.com>
Merge-request: !9399
2024-04-03 09:36:20 -04:00
Brad King
26d1a5aec8 Merge topic 'artos-lib-prefix' into release-3.29
e6b63b5cb2 ARTOS: Add support for finding library files named with 'lib' prefix

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Bert Ezendam <bert.ezendam@alliander.com>
Merge-request: !9399
2024-04-03 09:36:19 -04:00
Brad King
2ce6dfe90e Merge topic 'vs-intel-oneapi'
3f5cd0389f IntelLLVM: Fix link flags with Visual Studio generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9398
2024-04-03 09:35:20 -04:00
Brad King
a045c5c4ec Merge topic 'vs-intel-oneapi' into release-3.29
3f5cd0389f IntelLLVM: Fix link flags with Visual Studio generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9398
2024-04-03 09:35:19 -04:00
Brad King
3c8d4ed51a Merge topic 'swift-linker-selection'
3fb4092826 Swift: Add CMAKE_LINKER_TYPE support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9380
2024-04-03 09:34:06 -04:00
Brad King
3f5cd0389f IntelLLVM: Fix link flags with Visual Studio generators
The link flag wrapping added by commit 5d5a712303 (IntelLLVM: Pass
linker flags to the compiler when used as linker, 2022-05-27,
v3.25.0-rc1~344^2~4) is not needed with Visual Studio generators because
MSBuild invokes the linker directly.  Furthermore, that commit omitted
wrapping of the per-config linker flags.

Revise the logic to add the link flag wrapping more precisely.

Fixes: #25533
2024-04-02 12:54:01 -04:00
Brad King
e6b63b5cb2 ARTOS: Add support for finding library files named with 'lib' prefix
Update the platform module added by commit 462fbd1eca (Add support for
ARTOS platform using GNU C with ac compiler driver, 2015-08-13,
v3.4.0-rc1~201^2) to tell `find_library` to consider library file names
starting in `lib`.

FindEXPAT needs this on ARTOS since commit 13079f382b (FindEXPAT: Fix
for debug and other modified builds, 2023-02-18, v3.27.0-rc1~463^2)
removed its explicit `libexpat` library name candidate.

Fixes: #25776
2024-04-02 12:48:24 -04:00
Evan Wilde
3fb4092826 Swift: Add CMAKE_LINKER_TYPE support
Extend commit 96a953b1ed (Add options to specify linker tool, 2023-09-27,
v3.29.0-rc1~577^2) with the `CMAKE_Swift_USING_LINKER_*` variables
needed to support `CMAKE_LINKER_TYPE` for Swift.
2024-04-02 10:42:12 -04:00
Brad King
480cf4a714 FindCUDAToolkit: Replace documentation links with their permanent redirects 2024-04-02 08:43:12 -04:00
Brad King
f8ba5b12ca Merge topic 'refactor-compile-features-and-flags'
588371d2d5 Modules: Rename CMakeDetermine{CompileFeatures -> CompilerSupport}
4d27ef55bd Modules: Factor out helpers for GNU language standard flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9366
2024-04-02 08:13:18 -04:00
Brad King
153201471f Merge topic 'FindMPI-IntelLLVM'
e6dee2a4bd FindMPI: Fix finding IntelLLVM wrappers on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Acked-by: Changkai Qiu <qiuchangkai@hotmail.com>
Merge-request: !9395
2024-04-02 08:07:59 -04:00
Brad King
e6dee2a4bd FindMPI: Fix finding IntelLLVM wrappers on Windows
In commit 5e700411d2 (FindMPI: add IntelLLVM MPI wrappers, 2024-01-19,
v3.29.0-rc1~92^2) we added `mpiicpx.bat` for C++ on Windows, but that is
a GNU-like front-end that we do not yet support.  Use `mpiicx.bat` for
both C and C++ on Windows, just as we use `icx` to compile both.

Fixes: #25807
2024-04-01 12:11:32 -04:00
Brad King
ad13d01621 Merge topic 'cmp0159_warnings'
3cd64287fe Modules: Fix CMP0159 warnings in modules when tracing

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9385
2024-04-01 09:43:14 -04:00
Brad King
16dd3b79dc Merge topic 'check-Werror-CMP0066'
cebcc07a80 CheckSymbolExists: Remove -Werror from per-config flags
06c99ce73b CheckSymbolExists: Avoid removing the flag after -Werror
e60281e968 CMakeDetermineCompilerABI: Remove -Werror from per-config flags
6abd25e7fd Help: Fix a typo

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9377
2024-04-01 09:38:57 -04:00
Brad King
554a9b00c8 Merge topic 'tls-verify'
7139944264 ctest: Fall back to CMake environment variable for TLS server verification
c295df53c6 ctest: Test fallback to CMake options for TLS server verification
0d250dd021 ExternalProject: Honor CMAKE_TLS_VERIFY environment variable
e8404502b1 ExternalProject: Revise TLS_VERIFY wording to use TLS_VERSION pattern
46faaf9667 file(DOWNLOAD|UPLOAD): Add CMAKE_TLS_VERIFY environment variable
8b0169fe2b file(DOWNLOAD|UPLOAD): Add test covering CMAKE_TLS_VERIFY cmake variable
93886f5c7d file(DOWNLOAD|UPLOAD): Avoid unnecessary CMAKE_TLS_VERIFY variable lookup
bed32f400e file(DOWNLOAD|UPLOAD): Document TLS_VERSION fallback to environment variable
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: scivision <michael@scivision.dev>
Merge-request: !9389
2024-04-01 09:37:20 -04:00
Brad King
ae41bfc6c2 Merge topic 'nested-package-config-file'
6ddf8712cd CMakePackageConfigHelpers: Use unique variable name for pkg prefix
91b9d35608 CMakePackageConfigHelpers: Remove unused variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9390
2024-04-01 09:35:09 -04:00
Craig Scott
6ddf8712cd CMakePackageConfigHelpers: Use unique variable name for pkg prefix
Fixes: #25827
2024-04-01 09:32:37 +11:00
Craig Scott
91b9d35608 CMakePackageConfigHelpers: Remove unused variable 2024-04-01 09:32:28 +11:00
Brad King
7139944264 ctest: Fall back to CMake environment variable for TLS server verification
Use `ENV{CMAKE_TLS_VERIFY}` if `CTEST_TLS_VERIFY` or `CMAKE_TLS_VERIFY`
is not set.

Issue: #23608
2024-03-30 09:22:05 -04:00
Brad King
0d250dd021 ExternalProject: Honor CMAKE_TLS_VERIFY environment variable
Issue: #23608
2024-03-30 09:22:05 -04:00
Brad King
e8404502b1 ExternalProject: Revise TLS_VERIFY wording to use TLS_VERSION pattern 2024-03-30 09:22:05 -04:00
Juan Ramos
3cd64287fe Modules: Fix CMP0159 warnings in modules when tracing
Closes: #25829
2024-03-29 13:51:59 -07:00