Commit Graph

14078 Commits

Author SHA1 Message Date
Brad King
dcbc2ef00d CompilerId: Clarify CUDA, HIP, ObjC, ObjC++ standard level detection
Use named constants.  Regularize comparison patterns.  Follow the
approach from commit b9d4db7098 (CompilerId: Clarify C and C++ standard
level detection, 2024-04-02).
2024-04-16 15:31:36 -04:00
Brad King
cf457fbf9c CompilerId: Drop MSVC conditions from ObjC and ObjC++
MSVC does not compile these languages.
2024-04-16 15:21:35 -04:00
Raul Tambre
f606a27e8d ObjCXX: Fix detection of C++20 default compiler mode
Fix a typo from commit 9f3c70a333 (CUDA, CXX, OBJCXX: C++23 support with
Clang 12, 2020-12-04, v3.20.0-rc1~321^2).
2024-04-16 15:21:34 -04:00
Brad King
8f7049112d Merge topic 'nag-fortran-ninja'
4af20bb794 NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms
91bb8dd872 NAG-Fortran: Fix MODULE library creation on Apple platforms
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
765a611956 NAG-Fortran: Added initial default compilation flags

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9407
2024-04-16 08:53:56 -04:00
Brad King
f494bbaf8f Merge topic 'FindBacktrace-imported-library'
9433755e5d FindBacktrace: Add imported library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9406
2024-04-16 08:51:59 -04:00
Brad King
e9fcec6ac1 Merge topic 'findgtk2-fix'
7e49b98219 FindGTK2: Find arch-specific headers via pkg-config

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9417
2024-04-16 08:50:45 -04:00
Brad King
1c9e514d28 Merge topic 'swift-module-libraries'
56e5cea600 Swift: Support module libraries with command-line build systems

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9379
2024-04-16 08:47:11 -04:00
Simon Maertens
4af20bb794 NAG-Fortran: Do not repeat preprocessing with Ninja on Apple platforms
The Ninja generator uses separate preprocessing and compilation steps.
Do not pass `-fpp` when compiling an already-preprocessed source.

Issue: #25900
2024-04-15 13:48:15 -04:00
Simon Maertens
91bb8dd872 NAG-Fortran: Fix MODULE library creation on Apple platforms
Previously we passed `-bundle` to the NAG Fortran front-end, which
does not support it.  Pass it through to the linker instead.
2024-04-15 13:35:08 -04:00
Simon Maertens
e056006116 NAG-Fortran: Tell the Ninja generator how to preprocess Fortran sources
Fixes: #21398
2024-04-15 13:33:30 -04:00
Simon Maertens
765a611956 NAG-Fortran: Added initial default compilation flags
The configuration of the NAG Fortran compiler was previously missing the
standard flags for debug, release and the other build types.
2024-04-15 13:32:06 -04:00
David Faure
9433755e5d FindBacktrace: Add imported library
This is to avoid (a future version of) Qt from having to wrap
FindBacktrace like [1].

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/cmake/FindWrapBacktrace.cmake
2024-04-15 13:27:23 -04:00
Maxim Cournoyer
7e49b98219 FindGTK2: Find arch-specific headers via pkg-config
Fixes: #25884
2024-04-15 12:19:35 -04:00
Evan Wilde
56e5cea600 Swift: Support module libraries with command-line build systems
Wire up the flags needed to support module libraries built and used with
Swift. We need to pass `-bundle` to the linker when linking module
libraries on Darwin, and we need to pass `-export-dynamic` to the linker
when emitting an executable that exports symbols on Linux. This patch
wires up `CMAKE_SHARED_MODULE_CREATE_Swift_FLAGS` and
`CMAKE_SHARED_MODULE_LOADER_Swift_FLAG` on Darwin, and hooks up
`CMAKE_EXE_EXPORTS_Swift_FLAG` on Linux in order to support passing
things correctly.

We can't expose `CMAKE_EXE_LINKER_FLAGS` to Swift, as it contains flags
that the Swift compiler doesn't recognize, but the other
language-specific variables are safe to expose.
2024-04-15 08:23:39 -07:00
Brad King
ca449572ef Merge topic 'cxxmodules-import-std'
429902ebad Clang: support creating a target for imported modules
4617f272b4 MSVC: support `import std`
62a71047bb cmGraphVizWriter: ignore `__cmake_`-prefixed targets
442086c1dc fileapi: ignore `__cmake_`-prefixed targets
ffe74289b3 CMakeDetermineCompilerId: extract C++ standard library impl
15bbd1d9b8 Experimental: add an experimental feature gate for `import std`
f80c60df02 CMakeDetermineCompilerSupport: construct C++ modules targets
19341e2582 ci: enable `import_std23` C++ module tests on MSVC
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !9337
2024-04-15 09:56:53 -04:00
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
d616df8ad1 Merge topic 'aix-export-tdata'
b4d1ab42b8 AIX: Consider tdata symbols in ExportImportList

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9422
2024-04-12 09:28:46 -04:00
David Tenty
b4d1ab42b8 AIX: Consider tdata symbols in ExportImportList
Thread-local variables are put in the tdata section on AIX / XCOFF [1]. Unfortunately
the ExportImportList script currently doesn't consider this section when looking for
symbols to export.

This results in linking failures in applications (such as LLVM) when building which expect these thread local variables to be exported from their shared libraries.

[1]: https://www.ibm.com/docs/en/aix/7.3?topic=formats-xcoff-object-file-format
2024-04-11 12:18:41 -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