Commit Graph

12702 Commits

Author SHA1 Message Date
Brad King
c88bf61c8d Merge topic 'fortran-compiler-list'
35759e2497 Fortran: cleanup compiler default search list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7548
2022-08-17 14:19:33 -04:00
Brad King
8ad94b1977 Merge topic 'FindVulkan-tolerate-FATAL_ERROR'
9063674517 Help: Add 3.24 release note about FindVulkan component enforcement
bc01362368 FindVulkan: Restore tolerance of unknown FATAL_ERROR component

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7583
2022-08-17 10:16:10 -04:00
Brad King
bc01362368 FindVulkan: Restore tolerance of unknown FATAL_ERROR component
`find_package(Vulkan REQUIRED FATAL_ERROR)` calls exist in the wild, but
`find_package` does not have a `FATAL_ERROR` option.  We silently
tolerated such calls prior to commit 6e4d20921d (FindVulkan: Add
component for `shaderc_combined`, 2022-05-18, v3.24.0-rc1~111^2~5), by
treating the argument as a component and ignoring it.  Restore tolerance
by removing the component and warning about it.

Fixes: #23849
2022-08-17 09:52:12 -04:00
Brad King
8c144f0682 Merge topic 'output_all_attempts_at_compiler_detection'
9c5bd7fe3a CompilerId: Output errors from all attempts at detection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7576
2022-08-17 08:44:26 -04:00
Brad King
4a82938d60 Merge topic 'nvhpc_fpie_support'
52dc49deb9 NVHPC: Enable PIE support on linux

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !7564
2022-08-16 13:01:31 -04:00
Brad King
90607d182c Merge topic 'mingw-windres'
e9755bc7c1 MinGW: Restore using windres when toolchain-prefixed name is not available

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7574
2022-08-16 12:43:53 -04:00
Robert Maynard
9c5bd7fe3a CompilerId: Output errors from all attempts at detection
Instead of printing the output of the last attempt, print
the output of all attempts. This shows users that CMake isn't ignoring any provided flags ( LANG_FLAGS ).
2022-08-16 11:59:46 -04:00
Michael Hirsch
35759e2497 Fortran: cleanup compiler default search list
Made GNU gfortran be last in the list as per the docstring
immmediately preceding.
One high-level version-free name per vendor.
2022-08-16 06:20:06 -04:00
Brad King
e9755bc7c1 MinGW: Restore using windres when toolchain-prefixed name is not available
Since commit 55ba10dcfd (MSYS/MinGW Makefiles: Simplify selection of
windres as Resource Compiler, 2022-05-26, v3.24.0-rc1~82^2) the `MinGW
Makefiles` and `MSYS Makefiles` generators no longer specify the plain
`windres` name for the MinGW resource compiler.  Instead, the name is
specified in our MinGW platform information module. After the change in
commit af4adf6aa9 (MinGW: Fix default windres selection when
cross-compiling, 2020-03-25, v3.18.0-rc1~492^2), when cross-compiling,
we only specify the toolchain-prefixed name of the tool, which may not
be available in all environments.

If the toolchain-prefixed name is not available, fall back to the plain
`windres` name.  We already use this approach for other binutils.

Fixes: #23841
2022-08-15 13:57:58 -04:00
Robert Maynard
52dc49deb9 NVHPC: Enable PIE support on linux 2022-08-15 13:39:30 -04:00
Brad King
4befac3b32 Merge topic 'nvtx3'
cd200c6c2d FindCUDAToolkit: nvtx3 target

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7568
2022-08-15 11:26:23 -04:00
Brad King
c5f6d93d5e Merge topic 'warning-as-error-ti-compiler'
1cd65dfa0e TI compiler: Add support for COMPILE_WARNING_AS_ERROR target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Josef Angstenberger <code@jtxa.de>
Merge-request: !7560
2022-08-15 10:51:45 -04:00
Brad King
732cad4952 Merge topic 'warning-as-error-ti-compiler' into release-3.24
1cd65dfa0e TI compiler: Add support for COMPILE_WARNING_AS_ERROR target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Josef Angstenberger <code@jtxa.de>
Merge-request: !7560
2022-08-15 10:51:44 -04:00
Brad King
d0a307ddcf Merge topic 'mingw-flto'
7b2a87c2eb IPO: Do not use -flto=auto with GCC 10.x on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7559
2022-08-15 10:48:27 -04:00
Brad King
2d08a35b50 Merge topic 'mingw-flto' into release-3.24
7b2a87c2eb IPO: Do not use -flto=auto with GCC 10.x on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7559
2022-08-15 10:48:26 -04:00
Craig Scott
a57ad5eba3 Merge topic 'FetchContent-protobuf-example-CMP0077'
b57681dc34 FetchContent: Fix protobuf example to avoid CMP0077 warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7565
2022-08-14 01:17:27 -04:00
Raul Tambre
cd200c6c2d FindCUDAToolkit: nvtx3 target
nvtx3 is a header-only replacement for the previous shared library
implementations.

I implemented it as a separate target since while the header names match and
ideally it should be API compatible, forcing its include directory into the old
target would lengthen the include search path and could cause confusion or
possible build differences for projects using multiple build systems. This
keeps it explicit as a developer opt-in.

Implements: #21377
Resolves: #23835
2022-08-13 23:52:42 +03:00
Harald Fernengel
b57681dc34 FetchContent: Fix protobuf example to avoid CMP0077 warning
The protobuf example would raise a "Policy CMP0077" warning and
protobuf tests would still be built, e.g. setting the variable is
ignored in latest CMake. Set an INTERNAL cache variable instead so
that CMP0077 warnings won't be triggered.
2022-08-13 09:44:45 +10:00
Craig Scott
1cd65dfa0e TI compiler: Add support for COMPILE_WARNING_AS_ERROR target property 2022-08-12 08:27:19 +10:00
Cristian Adam
62cd3904bf variable: Set LINUX variable on Linux target systems
Fixes: #23840
2022-08-12 07:20:05 +10:00
Brad King
7b2a87c2eb IPO: Do not use -flto=auto with GCC 10.x on Windows
Revise the change from commit fe57410b33 (IPO: Use -flto=auto if
compiler is GCC >= 10.1, 2022-06-22, v3.24.0-rc2~2^2) to require
at least GCC 11 on Windows.

Fixes: #23836
Issue: #23640
2022-08-10 14:49:34 -04:00
Brad King
9d5a129a06 Merge topic 'FindGTK2-homebrew'
899390fd7b FindGTK2: Search homebrew paths for arch-specific headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7552
2022-08-10 09:19:49 -04:00
Brad King
3907c08146 Merge topic 'ExternalProject-BUILD_ALWAYS-install'
81fd0d6e26 ExternalProject: Fix install on BUILD_ALWAYS+BUILD_BYPRODUCTS with Ninja
d9e88721ad ExternalProject: Add test case for BUILD_ALWAYS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7546
2022-08-10 09:14:33 -04:00
Dominic Hamon
899390fd7b FindGTK2: Search homebrew paths for arch-specific headers
Without this, CMake fails to find brew-installed GTK2 on macOS.
With it, GTK2 is found.
2022-08-09 09:25:23 -04:00
Brad King
8100f11713 Merge topic 'FindThreads-msvc-no-pthread-flag'
7203963788 FindThreads: Skip check for -pthread flag when targeting the MSVC ABI

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7551
2022-08-09 09:16:43 -04:00
Maik Nijhuis
81fd0d6e26 ExternalProject: Fix install on BUILD_ALWAYS+BUILD_BYPRODUCTS with Ninja
The `BUILD_BYPRODUCTS` option causes the ExternalProject's `build` step
in `build.ninja` to have `restat = 1`, so its "always out-of-date"
status caused by `BUILD_ALWAYS` does not propagate to the `install`
step.  Mark the latter step as explicitly always out-of-date too.

Fixes: #23820
2022-08-09 08:27:11 -04:00
Brad King
7203963788 FindThreads: Skip check for -pthread flag when targeting the MSVC ABI
Since commit 3257c34073 (FindThreads: avoid failing in AIX when using
-D_XOPEN_SOURCE=500, 2022-04-30, v3.24.0-rc1~197^2) we no longer check
for `pthreads.h` before checking for the `-pthread` flag.  Compilers
targeting the MSVC ABI do not have such a flag, so avoid performing the
check unnecessarily.

Fixes: #23829
2022-08-08 12:41:57 -04:00
Brad King
ed86192cd8 Merge topic 'doc-markup-program-options'
a6abdf6c8f Help: Consistent options declaration -- short first, then long
f4563f05db Help: Value for `--graphviz=` option actually is mandatory
04843d743e Help: Replace a bunch of more ``--option`` to `:option:` role
09446266ee Help: Replace mentions of ``-D`` option with :option:`-D` role
b57f27b087 Help: Replace mentions of ``-T`` and ``-A`` options with role
d25b232dee Help: Replace mentions of ``-G`` option with :option:`-G` role
63940e1cab Help: Replace mentions of ``-C`` option with :option:`-C` role
183a49cbfe Help: Replace mentions of ``-S`` option with :option:`-S` role
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7544
2022-08-08 09:39:41 -04:00
Brad King
ac00b37ea2 Merge topic 'swift_debug'
20fe9cf7e9 Swift: Disable optimization when compiling in Debug

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7545
2022-08-05 08:53:58 -04:00
Alex Turbov
d25b232dee Help: Replace mentions of `-G option with :option:-G` role 2022-08-04 19:34:45 +04:00
Alex Turbov
183a49cbfe Help: Replace mentions of `-S option with :option:-S` role 2022-08-04 19:33:42 +04:00
David Geldreich
20fe9cf7e9 Swift: Disable optimization when compiling in Debug
By default no `-O...` flag is specified for Debug configuration for
Swift so Xcode adds a (wrong) `-O` flag that prevents one from accessing
variables while debugging.  Add `-Onone` to the Swift Debug
configuration to avoid this.

Fixes: #23818
2022-08-04 09:45:31 -04:00
Brad King
52dec3f11f Merge topic 'enable-intel-llvm-ipo-3'
c633bd76d8 Add linker prefix for "-stack" flag on MSVC builds
6823db0c5a Enable IPO for IntelLLVM compilers on Linux and Windows
adbffd204d Propagate OpenMP compiler flags to linker for IntelLLVM
3640842df2 Tests: Update ModuleDefinition for IntelLLVM MSVC Frontend Variant
5d5a712303 IntelLLVM: Pass linker flags to the compiler when used as linker

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7533
2022-08-04 09:37:47 -04:00
Brad King
d4ec1ded39 Merge topic 'fetchcontent-set-CMAKE_VERIFY_INTERFACE_HEADER_SETS'
2a9cc3e8e8 FetchContent: Disable header set verification for dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7535
2022-08-04 09:34:48 -04:00
Brad King
3a38f6c618 Merge topic 'fetchcontent-set-CMAKE_VERIFY_INTERFACE_HEADER_SETS' into release-3.24
2a9cc3e8e8 FetchContent: Disable header set verification for dependencies

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7535
2022-08-04 09:34:47 -04:00
Brad King
4e6b0ba90a Merge topic 'FindLua-docfmt'
3e2094fb9b FindLua: Improve documentation formatting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7539
2022-08-04 09:32:37 -04:00
Craig Scott
2a9cc3e8e8 FetchContent: Disable header set verification for dependencies
The CMAKE_VERIFY_INTERFACE_HEADER_SETS variable is intended to
be under the control of the user. It doesn't discriminate between
header sets defined in the main project and those defined by
dependencies brought into the build directly via FetchContent.
Developers will usually only be interested in verifying the main project's
header sets, not those from dependencies.

Make the variable effectively only enable header set verification of the
main project by turning it off during FetchContent_MakeAvailable() calls.
The user still has variables like CMAKE_PROJECT_INCLUDE and
CMAKE_PROJECT_<projectName>_INCLUDE available to them if they
want to enable verification of all or specific dependencies respectively.

Fixes: #23808
2022-08-04 09:43:10 +10:00
Michael Hirsch
3e2094fb9b FindLua: Improve documentation formatting
Since commit cb811d11ce (Help: Improve description of modules,
2019-04-12, v3.15.0-rc1~210^2) we've had two `::` prompts for
the preformatted block listing the result variables.  Convert the
block to a definition list.
2022-08-03 09:56:38 -04:00
Brad King
f6917a2f1f Merge topic 'cuda_add_lto_support'
96bc59b1ca CUDA: Add Device LTO support for nvcc
1527d48cd0 CheckIPO: Refactor logic selecting test source files
4a552ab4ad remove unused variables
6eda92d037 remove unused variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7389
2022-08-03 09:42:17 -04:00
Brad King
a7dc0f0b91 Merge topic 'FindCoin3D-windows'
7ab4badb4c FindCoin3D: look for coin4 on windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7532
2022-08-03 09:40:43 -04:00
Brad King
ad20e7b2ae Merge topic 'find-openmp-from-system-paths'
09b4e870a5 FindOpenMP: Restore searching system paths

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Acked-by: Felix Yan <felixonmars@archlinux.org>
Merge-request: !7526
2022-08-02 09:33:09 -04:00
lorenz
7ab4badb4c FindCoin3D: look for coin4 on windows 2022-08-02 08:27:30 -04:00
William R. Dieter
6823db0c5a Enable IPO for IntelLLVM compilers on Linux and Windows
Replicate and adapt Linux IPO options for Intel for IntelLLVM compilers
on Linux and Windows.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2022-08-01 19:34:49 -04:00
William R. Dieter
adbffd204d Propagate OpenMP compiler flags to linker for IntelLLVM
When compiling for offload and in general when OpenMP is enabled while
compiling, it should also be enabled when linking.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2022-08-01 19:34:49 -04:00
William R. Dieter
5d5a712303 IntelLLVM: Pass linker flags to the compiler when used as linker
When linking an executable, DLL, or static library, the compiler sometimes
needs to see the linking options.  Typically `<FLAGS>` is not passed
for linking, because some of the options are only used for compilation.
Previously, `<LINK_FLAGS>` was passed after the `/link` flag because
the compiler did not understand some of the linking options.

This change wraps the initial linker options borrowed from Windows-MSVC
individually, so that they are passed directly to the linker.

This change is helpful both for interprocedural optimization, which needs
to pass `-Qipo` to the compiler at link time, and for SYCL which needs
to pass `-fsycl` and possibly other options to the compiler at link time.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2022-08-01 19:34:49 -04:00
Sprite
09b4e870a5 FindOpenMP: Restore searching system paths
In commit 98314d536e (FindOpenMP: Use NO_DEFAULT_PATH where appropriate,
2017-11-15, v3.11.0-rc1~334^2) we added `NO_DEFAULT_PATH` so that it no
longer searches in `CMAKE_PREFIX_PATH`, but this also excludes searching
in system paths, which are needed on RISC-V platforms.  Use more granular
exclusions instead.

Fixes: #23469
2022-08-01 10:25:10 -04:00
Brad King
26431c1877 Merge topic 'FindGTest-gmock-needs-gtest'
1aa95e1a3b FindGTest: Create the gmock targets only when GTest has been found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7523
2022-08-01 10:02:25 -04:00
Brad King
e0a39aeade Merge topic 'FindGTest-gmock-needs-gtest' into release-3.24
1aa95e1a3b FindGTest: Create the gmock targets only when GTest has been found

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7523
2022-08-01 10:02:24 -04:00
Craig Scott
1d193ce59a Merge topic 'fetchcontent-url-regression'
fd95769ccf FetchContent: Restore support for multiple URL values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7522
2022-08-01 01:42:11 -04:00
Robert Maynard
1aa95e1a3b FindGTest: Create the gmock targets only when GTest has been found
When we introduced the `GTest::gmock` and `GTest::gmock_main` targets in
commit 50bf457a0d (FindGTest: Add target for gmock library, 2021-10-17,
v3.23.0-rc1~321^2) we failed to handle the case where GTest isn't found.
Don't construct gmock targets that depend on non-existent gtest targets
when gtest failed to be found.
2022-07-29 14:05:55 -04:00