13585 Commits

Author SHA1 Message Date
Brad King
ef49ed0fe1 LLVMFlang: Fix MSVC ABI debug information format options
In commit 26bf32cdc6 (LLVMFlang: Add support for targeting MSVC ABI on
Windows, 2023-09-28, v3.28.0-rc1~10^2) we incorrectly recorded `-g` as
supporting the `ProgramDatabase` format, but it is actually `Embedded`,
matching Clang.

In order to support easy integration with C and C++ projects that use
the `.pdb` debug formats, pretend LLVMFlang supports them and just don't
actually emit any debug information.

Issue: #24840
2023-12-04 20:30:46 -05:00
Brad King
bf22ac5263 CPack/RPM: Quote paths in rpm spec only if they have whitespace
RPM supports either whitespace with quoting or globbing without quoting.
Prior to RPM 4.19 it accepted globbing in quotes, but it only globbed
correctly without whitespace, where quoting was not necessary anyway.
Starting in RPM 4.19, glob characters in quotes are considered literal.

Fixes: #25421
Inspired-by: Ben Boeckel <ben.boeckel@kitware.com>
See: d44114f007
2023-11-29 12:47:20 -05:00
Brad King
75ea6207b7 CPack/RPM: Factor out helper to quote paths in generated rpm spec 2023-11-29 12:27:31 -05:00
Ben Boeckel
77a7edb73f Clang-CXX: copy into the dyndep output on success
When `clang-scan-deps` fails to scan (e.g., bad source syntax, junk
flags, etc.), the redirection unconditionally updates the file. If this
fails, the `.ddi` file timestamp is updated. If the state is then
reverted (e.g., the command line returns to the state of the last
successful build), the updated file is not useful, but `ninja` does not
rerun because:

- the command hash matches the last successful run
- the output file is newer than its inputs

However, since the `.ddi` file has been updated with bogus contents from
a failed scan, collation fails as the `rules` array is empty (or
incomplete from a batch scan).

If `clang-scan-deps` were properly aware of its output file, it could
use this to not write the file if any inner scan fails. Requested in
https://github.com/llvm/llvm-project/issues/72875.

See: https://github.com/llvm/llvm-project/issues/72875
Fixes: #25429
2023-11-21 09:41:59 -05:00
Brad King
2744f14db1 codespell: Fix typos 2023-11-17 09:58:21 -05:00
Brad King
339cd47732 Merge topic 'FindOpenMP-5.1-and-5.2' into release-3.28
2859be7575 FindOpenMP: Add support for openmp 5.1 (llvm 17) and 5.2

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Markus Mützel <markus.muetzel@gmx.de>
Merge-request: !8965
2023-11-14 09:04:53 -05:00
Christoph Reiter
2859be7575 FindOpenMP: Add support for openmp 5.1 (llvm 17) and 5.2
llvm 17 now defaults to openmp 5.1; see LLVM commit `0c6f2f629cc0`.
It makes FindOpenMP set OPENMP_FOUND and OpenMP_C_SPEC_DATE, but not
OpenMP_C_VERSION, because it doesn't know the version mapping.
Add the spec date to the version mapping for 5.1 and 5.2 to make
things work again.
2023-11-13 10:51:40 -05:00
Robert Maynard
b38a8e77cb FindCUDAToolkit: Search for cufile library name being lowercase
Fixes #25398
2023-11-08 10:43:30 -05:00
Brad King
79f3f29e50 CUDA: Parse NVCC implicit compile/link information in Visual Studio generators
Refactoring in commit deff0e638d (CUDA: Factor out helper to parse NVCC
implicit compiler and linker flags, 2023-09-15, v3.28.0-rc1~63^2~6)
incorrectly dropped detection of the default CUDA architecture and
the CUDA toolkit include directories from the code path used for
Visual Studio generators.  However, CMakeNVCCParseImplicitInfo is
now general enough that we no longer need a VS-specific code path.

Fixes: #25378
2023-11-01 13:51:21 -04:00
Brad King
27e64a8498 CMakeNVCCParseImplicitInfo: Recognize link.exe line in CUDA VS integration 2023-11-01 13:51:10 -04:00
Brad King
045399a461 CMakeParseImplicitLinkInfo: Ignore MSVC link /implib: flag
The flag specifies the import library for the linked binary.
It is not a linked library.
2023-11-01 13:07:43 -04:00
Brad King
3f7419a124 Merge topic 'revert-GetPrerequisites-linux-x86' into release-3.28
139df0bc2f GetPrerequisites: Revert "Ignore relative paths printed by ldd"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8933
2023-11-01 09:39:59 -04:00
Brad King
139df0bc2f GetPrerequisites: Revert "Ignore relative paths printed by ldd"
Revert commit cf2ad9995a (GetPrerequisites: Ignore relative paths
printed by ldd, 2023-02-20, v3.27.0-rc1~459^2) because it regressed
existing use cases.  We will need to find another solution to the use
case motivating the change.

Fixes: #25372
2023-10-31 14:15:29 -04:00
Brad King
d33ea3dff5 Merge topic 'FindFreeType-config-windows' into release-3.28
0117446c97 FindFreeType: also set `FREETYPE_FOUND`
2cf2d4f7df FindFreeType: insert Freetype's location to the start
1cfc708eea FindFreeType: handle config-specific `LOCATION` settings as well
ae9890cd36 FindFreeType: consider `IMPLIB`-using platforms

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8920
2023-10-31 09:10:42 -04:00
Ben Boeckel
0117446c97 FindFreeType: also set FREETYPE_FOUND
Fixes: #25371
2023-10-30 10:51:10 -04:00
Ben Boeckel
2cf2d4f7df FindFreeType: insert Freetype's location to the start
This should help static builds satisfy dependencies by listing
transitive libraries after freetype's.
2023-10-28 14:59:07 -04:00
Ben Boeckel
1cfc708eea FindFreeType: handle config-specific LOCATION settings as well
`vcpkg` builds release and debug variants on platforms other than
Windows (which uses the `IMPLIB` properties).
2023-10-28 14:59:07 -04:00
André Apitzsch
d7f7bf08cd FindProtobuf: Fix protoc include path regression
This was accidentally broken by commit 31adc11030 (FindProtobuf: Add
PLUGIN_OPTIONS and PROTOC_OPTIONS to protobuf_generate, 2023-06-29,
v3.28.0-rc1~409^2~2).

Fixes: #25368
2023-10-27 11:41:28 -04:00
Ben Boeckel
ae9890cd36 FindFreeType: consider IMPLIB-using platforms
See: https://github.com/microsoft/vcpkg/issues/34725
2023-10-26 12:44:29 -04:00
Cristian Adam
74b5fae52d Clang: Use -fno-ansi-escape-codes for color diagnostics on Windows
-fno-ansi-escape-codes is used only on Windows by Clang.

Without the flag color diagnostics are displayed only if clang.exe
is executed directly. Build tools like ninja and mingw32-make
will not display colored diagnostics.

Using -fno-ansi-escape-codes will make the build tools pass
the colored diagnostics to the calling application e.g IDE.

Fixes: #24235
2023-10-23 09:41:29 -04:00
مهدي شينون (Mehdi Chinoune)
44faa3773c PGI/NVHPC: Remove -Mipa compiler option for 23.3+
`-Mipa` was removed since 23.3.  The compiler warns about it:

    nvfortran-Warning-The option -Mipa has been deprecated and is ignored.

See: https://docs.nvidia.com/hpc-sdk/archive/23.9/hpc-sdk-release-notes/index.html#deprecations
2023-10-13 14:04:09 -04:00
Heiko Becker
77ed529c22 FindRuby: Add support for 3.2 2023-10-10 09:25:05 -04:00
Brad King
8547025ff2 Merge topic 'findcuda_toolkit_restore_lib_search_dir' into release-3.28
0b6ae9c467 FindCUDAToolkit: Restore CUDAToolkit_LIBRARY_SEARCH_DIRS variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8859
2023-10-06 08:38:13 -04:00
Robert Maynard
0b6ae9c467 FindCUDAToolkit: Restore CUDAToolkit_LIBRARY_SEARCH_DIRS variable
This was accidentally dropped by commit 4316d4dcfd (FindCUDAToolkit:
Search all of `nvcc` implicit includes and library dirs, 2023-09-26).
2023-10-04 12:10:02 -04:00
Brad King
a483637821 Merge topic 'FindPkgConfig-error' into release-3.28
4c96b31e4b FindPkgConfig: Report not-found package names in fatal error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8856
2023-10-04 11:19:36 -04:00
Brad King
1f00b0e230 Merge topic 'LLVMFlang-MSVC' into release-3.28
26bf32cdc6 LLVMFlang: Add support for targeting MSVC ABI on Windows
e9af7b9687 LLVMFlang: Add support for CMAKE_Fortran_COMPILER_TARGET
26fa048ffe Tests: Enable CMP0091/CMP0141 for MSVC settings in FortranOnly test
9d060b8682 Fortran: Save CMAKE_LINKER variable persistently for MSVC ABI
7571e653f4 CMakeDetermineCompilerABI: Add option to skip implicit link info parsing
12733d0d8d CMakeParseImplicitLinkInfo: Detect link lines using link.exe and lld-link

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8852
2023-10-04 11:18:40 -04:00
Anthony Baker
4c96b31e4b FindPkgConfig: Report not-found package names in fatal error message 2023-10-03 11:59:12 -04:00
Brad King
615e95af60 Merge topic 'FindPostgreSQL-16'
25644a78de FindPostgreSQL: Add support for version 16

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8854
2023-10-03 09:27:29 -04:00
Brad King
26bf32cdc6 LLVMFlang: Add support for targeting MSVC ABI on Windows
The compiler does not yet support everything needed to integrate well
with the MSVC ABI, in particular for runtime library selection and debug
format selection.  Document them in FIXME comments and leave this
support undocumented by CMake for now.

Fixes: #24840
Inspired-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
2023-10-03 09:15:24 -04:00
Brad King
e9af7b9687 LLVMFlang: Add support for CMAKE_Fortran_COMPILER_TARGET 2023-10-02 18:52:02 -04:00
Brad King
9d060b8682 Fortran: Save CMAKE_LINKER variable persistently for MSVC ABI
We already do this for other languages including C and CXX.
2023-10-02 18:52:00 -04:00
Brad King
7571e653f4 CMakeDetermineCompilerABI: Add option to skip implicit link info parsing
Provide a way to do the parsing earlier and not overwrite it here.
2023-10-02 18:51:59 -04:00
Brad King
12733d0d8d CMakeParseImplicitLinkInfo: Detect link lines using link.exe and lld-link
These are printed by LLVM-based compiler drivers targeting the MSVC ABI.
In our use case for this, `CMAKE_LINKER` may not yet be known, so do
not include it in the test data.
2023-10-02 18:51:46 -04:00
Brad King
25644a78de FindPostgreSQL: Add support for version 16
Fixes: #25292
2023-10-02 14:44:04 -04:00
Brad King
8735cbba5d Merge topic 'cxxmodules-no-longer-experimental'
437280b127 cxxmodules: scan C++ sources for imports by default
3cddd11649 Ninja: message about not compiled sources explicitly
068fde1c34 cmGeneratorTarget: use `this->` for method calls
197a6bf171 cxxmodules: rework control logic for scanning regular C++ sources
5eb7bd641a Tests/RunCMake/CXXModules: remove rules file requirement
ff18acc301 CXXModules: remove `EXPERIMENTAL` from C++ module variable names
0c07f39006 cmExperimental: remove the flag for C++ modules
68caec9137 Help: add a manpage for cxxmodule support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Pavel Solodovnikov <hellyeahdominate@gmail.com>
Merge-request: !8828
2023-10-02 11:55:38 -04:00
Ben Boeckel
ff18acc301 CXXModules: remove EXPERIMENTAL from C++ module variable names 2023-10-02 10:17:31 -04:00
Brad King
f8332bec19 FindQt4: Fix typo in documentation formatting 2023-10-02 09:52:59 -04:00
Craig Scott
7ab880421a Merge topic 'ExternalProject-declare-download-byproducts'
872daff159 ExternalProject: declare byproducts for the download step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8823
2023-10-01 07:12:56 -04:00
Ben Boeckel
872daff159 ExternalProject: declare byproducts for the download step
This can surface a conflict where two projects download the same file
and get scheduled against each other.
2023-09-30 15:59:22 +10:00
Brad King
af149fbcaa Merge topic 'FindCUDAToolkit-implicit-dirs'
4316d4dcfd FindCUDAToolkit: Search all of `nvcc` implicit includes and library dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8835
2023-09-29 09:37:30 -04:00
Brad King
88c7eaa7a7 Merge topic 'android-clang-c++23'
75e9918a66 Android: Require Clang 18 for -std=c++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !8847
2023-09-28 09:50:36 -04:00
Robert Maynard
4316d4dcfd FindCUDAToolkit: Search all of nvcc implicit includes and library dirs
Improves the handling of CUDA layouts where we have multiple include
and library directories listed in the output of `nvcc -v`. This
updates both when the CUDA language is enabled or not.

Fixes: #24915
2023-09-27 13:28:52 -04:00
Brad King
75e9918a66 Android: Require Clang 18 for -std=c++23
Update the Clang version checks added by

* commit eacacc70fc (Clang: use -std=c++23 for Clang 17.0+,
                     2023-05-08, v3.27.0-rc1~115^2)
* commit 0183956d30 (Clang: C++26 support,
                     2023-05-16, v3.27.0-rc1~85^2)

to account for Android NDK r26's distribution of a Clang based on a
development version of LLVM/Clang 17.0 that pre-dated addition of
these flags.

Follow the pattern from commit 12e6796b62 (Android: Do not pass
non-existent Clang -std flags, 2018-04-02, v3.12.0-rc1~284^2),
which fixed the same problem for `-std=c++17`.

Fixes: #25281
2023-09-27 12:56:49 -04:00
Brad King
5d32320bf3 Merge topic 'hip-nvidia'
fd982eec10 HIP: Add tests for special NVIDIA values of CMAKE_HIP_ARCHITECTURES
8c8b3f1bfa HIP: Fix support for -DCMAKE_HIP_ARCHITECTURES=native with NVCC
b3e92775ab HIP: Add CMAKE_HIP_HOST_COMPILER when compiler is NVCC
e43918b4ca HIP: Fix linking mixed-lang binary with CXX compiler and Makefile generators
4794505122 HIP: Do not require hip-lang package for NVIDIA platform
09d759dc7f HIP: Simplify exclusion of AMD device runtime with NVIDIA GPUs
2a60663670 HIP: Simplify CMAKE_GENERATOR references for determining compiler
8124950f6c CUDA: Generalize CMAKE_{CUDA => <LANG>}_HOST_COMPILER variable docs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8836
2023-09-26 09:40:25 -04:00
Brad King
8a39d146d4 Merge topic 'FindOpenMP-macOS-LLVM-Clang'
3cff031c9a FindOpenMP: Handle non-Apple clang on macOS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8832
2023-09-26 09:33:02 -04:00
Brad King
0be496cb5a Merge topic 'orangec-compiler'
f8fa4f1ad7 ci: Add OrangeC 6.73.1 nightly CI job
531b4fe643 OrangeC: Add support for OrangeC compiler
10f435a58f Tests: Simplify nested if conditions in Complex tests

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Victor <lostfreeman@gmail.com>
Merge-request: !8592
2023-09-26 09:23:10 -04:00
Brad King
187fb1911f Merge topic 'add-c++23'
961a077238 IBMClang: Add provisional flags for C++23

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8837
2023-09-26 09:18:10 -04:00
Craig Scott
8a90ae92af Merge topic 'FetchContent-EXCLUDE_FROM_ALL'
5f77807f1c FetchContent: Add support for EXCLUDE_FROM_ALL

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8822
2023-09-26 08:35:45 -04:00
Xing Xue
961a077238 IBMClang: Add provisional flags for C++23
With this one can use the IBM Open XL C/C++ compiler to build projects
that require feature `cxx_std_23`.
2023-09-25 19:05:31 -04:00
Steven Stallion
5f77807f1c FetchContent: Add support for EXCLUDE_FROM_ALL
Fixes: #20167
2023-09-26 08:56:44 +10:00