Commit Graph

12669 Commits

Author SHA1 Message Date
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
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
Craig Scott
fd95769ccf FetchContent: Restore support for multiple URL values
In c2044fdf3f (FetchContent: Respect the CMP0135 policy setting,
2022-06-02), the URL keyword was wrongly assumed to only have
a single value. Multiple URL values are allowed if they are all
non-local. Rework the logic to remove that incorrect assumption
and handle both single and multi-value URL combinations.

Fixes: #23792
2022-07-29 20:58:08 +10:00
Brad King
8b6fdc5445 Merge topic 'FindCURL-version-string'
0b7ae2af0d FindCURL: Fix version string in case of multiple curl installations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7515
2022-07-28 08:14:34 -04:00
Brad King
b0273dc26f Merge topic 'find-sdl_gfx'
13aee97207 FindSDL_gfx: Add module to find another SDL component
1279131a8e FindSDL_*: Drop module history from public documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7475
2022-07-28 08:13:53 -04:00
Xavier Del Campo Romero
13aee97207 FindSDL_gfx: Add module to find another SDL component
Complement the several existing `FindSDL_*` modules.
Follow the pattern of the existing `FindSDL_mixer` module.

Fixes: #12004
2022-07-27 15:30:33 -04:00
Georg Lutz
0b7ae2af0d FindCURL: Fix version string in case of multiple curl installations
On systems where there are two versions of libcurl installed
CURL_VERSION_STRING is always set to the version found by the
`pkg_check_modules(PC_CURL QUIET libcurl)`.

But CURL_VERSION_STRING should match the libs and include paths found by
`find_path` and `find_library` (more specifically the path where the
header is found, because that where the version is parsed from.

So make sure that the version is always parsed from the header file, use
the output of pkg_check_modules only as HINT for find_path /
find_library.
2022-07-27 15:05:20 -04:00
Brad King
b141445f8f FindVulkan: Move dxc component docs into definition list 2022-07-25 14:08:02 -04:00
Brad King
96573aec1c Merge branch 'backport-3.24-FindVulkan-relnotes' 2022-07-25 14:04:56 -04:00
MACHIZAUD Andréa
0b538e4002 FindVulkan: Add missing 3.24 release notes 2022-07-25 14:04:43 -04:00
Brad King
db66c384fc FindVulkan: Format component documentation as definition list 2022-07-25 14:04:43 -04:00
Robert Maynard
96bc59b1ca CUDA: Add Device LTO support for nvcc
Fixes #22200
2022-07-22 10:34:45 -04:00
Brad King
96564c5b2d Merge topic 'FindVulkan-dxc'
1277b873c9 FindVulkan: Add `dxc` (DirectX Shader Compiler) component

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7474
2022-07-22 10:16:23 -04:00
Brad King
55895ed4a1 Merge topic 'FindOpenMP-no-force-flags'
878655384e FindOpenMP: Do not overwrite user-set FLAGS, LIB_NAMES

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7487
2022-07-22 10:15:21 -04:00
Brad King
cf27fb7f48 Merge topic 'FindOpenACC_set_found_variable'
9a6f74ffa2 FindOpenACC: Set OpenACC_FOUND when OpenACC is enabled for a language

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7437
2022-07-22 09:55:13 -04:00
HellsingDarge
1277b873c9 FindVulkan: Add dxc (DirectX Shader Compiler) component 2022-07-20 17:06:31 -04:00
Balthasar Reuter
878655384e FindOpenMP: Do not overwrite user-set FLAGS, LIB_NAMES
Since commit 2dbff623f9 (FindOpenMP: Save flags/libs in cache entries
each time they are detected, 2020-02-07, v3.17.0-rc1~10^2~1) we replace
both `OpenMP_${LANG}_FLAGS` and `OpenMP_${LANG}_LIB_NAMES` with detected
flags if either one is not set.  That can overwrite user-provided flags.

Update the logic for C, CXX, and Fortran to initialize each
`OpenMP_${LANG}_{FLAGS,LIB_NAMES}` variable only if it has not already
been set by the user.

Fixes: #23743
2022-07-20 12:21:38 -04:00
Brad King
6700db5dad Merge topic 'FindPython-remove-components-interdependence'
71bdf78bda FindPython: remove unnecessary components interdependence

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7485
2022-07-20 09:25:58 -04:00
Brad King
1279131a8e FindSDL_*: Drop module history from public documentation
This information belongs in commit messages, not documentation.
2022-07-19 12:29:11 -04:00
Marc Chevrier
71bdf78bda FindPython: remove unnecessary components interdependence
Fixes: #23716
2022-07-19 16:22:42 +02:00
Robert Maynard
1527d48cd0 CheckIPO: Refactor logic selecting test source files 2022-07-13 10:25:10 -04:00
Robert Maynard
9a6f74ffa2 FindOpenACC: Set OpenACC_FOUND when OpenACC is enabled for a language 2022-07-13 08:58:51 -04:00
William Marlow
74e3ac2b7e AIX: Export symbols from IBMClang IPA objects
When interprocedural analysis is enabled on the IBMClang family of
compilers (via the `-flto` option) then the resulting object files
contain LLVM IR rather than XCOFF objects[1].

ExportImportList needs to detect LLVM IR objects and use the
`ibm-llvm-nm` tool that ships with the compiler to create the extract
the defined symbols.

Without this change, such objects result in an error message from
`dump` and no symbols being exported from the object file.

[1]: https://www.ibm.com/docs/en/openxl-c-and-cpp-aix/17.1.0?topic=compatibility-link-time-optimization-lto
2022-07-12 07:41:25 +01:00
Marc Chevrier
f1150f30cd Merge topic 'better_doxy_ver_check'
eaec9cf65d FindDoxygen: Implement more complete version checking

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Acked-by: Alex Turbov <i.zaufi@gmail.com>
Merge-request: !7442
2022-07-10 04:42:24 -04:00
Christian Heimlich
eaec9cf65d FindDoxygen: Implement more complete version checking
The foundation of the Doxygen Find Module's detection methodology
is the command `find_program`, which has inhibited the module from
properly handling user version restrictions when provided.

Because `find_program` historically has always returned after the first
match and does not consider version constraints, users of this module
are inadvertently at the mercy of the command's search procedure.
Essentially, `find_package(Doxygen ...)` will always provide the first
Doxygen build found through said procedure, even if it conflicts with
the user's version requirements, and even if another build exists on
the system that would satisfy those requirements (i.e. shadowing).

Utilizes the new `VALIDATOR` option of `find_program` to ensure all
otherwise detectable builds of Doxygen on a given system are evaluated
and that only a build in compliance with `Doxygen_FIND_VERSION`
et. al., when defined, will be matched against.

Also enables handling of version ranges specified within `find_package`
via the **FindPackageHandleStandardArgs** module.

Finally, ensures that only the major, minor, and patch components of
Doxygen's `--version` output are captured for comparison in cases where
it contains additional information, such as a git commit hash.

Fixes: #23692
2022-07-07 13:41:31 -04:00
Brad King
d213cf1193 Merge topic 'findwxwidgets-mingw-regression'
7d6e01801d FindwxWidgets: Do not reset wxWidgets_LIB_DIR unnecessarily
6dce42b171 FindwxWidgets: Restore win32 find style on MinGW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7451
2022-07-07 09:05:39 -04:00
Brad King
f92964bf49 Merge topic 'findwxwidgets-mingw-regression' into release-3.24
7d6e01801d FindwxWidgets: Do not reset wxWidgets_LIB_DIR unnecessarily
6dce42b171 FindwxWidgets: Restore win32 find style on MinGW

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7451
2022-07-07 09:05:38 -04:00
Brad King
a502c11a44 Merge topic 'FindLAPACK-nvhpc'
28d52a43fc FindLAPACK: Add '-fortranlibs' flag only with NVHPC/PGI compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7452
2022-07-07 09:02:02 -04:00
Brad King
acc6a08641 Merge topic 'FindLAPACK-nvhpc' into release-3.24
28d52a43fc FindLAPACK: Add '-fortranlibs' flag only with NVHPC/PGI compilers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7452
2022-07-07 09:02:01 -04:00
Brad King
05a5d351f4 Merge branch 'FindLAPACK-nvhpc' into release-3.23
Merge-request: !7452
2022-07-07 09:01:20 -04:00
Eisuke Kawashima
28d52a43fc FindLAPACK: Add '-fortranlibs' flag only with NVHPC/PGI compilers
Since commit 2c9e623e31 (Find{BLAS,LAPACK}: Add support for the NVHPC
LAPACK library, 2021-05-05, v3.21.0-rc1~192^2) we try the `-fortranlibs`
option as a dependency of the NVHPC LAPACK.  That flag is specific to
the NVHPC/PGI compilers, so use it conditionally with them.

Without this modification, CMake fails to find LAPACK if

- compiler ID is GNU
- `BLA_STATIC` is `ON`
- `BLA_VENDOR` is not defined or set to `All`

Fixes: #23705, #22878
2022-07-06 13:58:47 -04:00
Maarten Bent
7d6e01801d FindwxWidgets: Do not reset wxWidgets_LIB_DIR unnecessarily
Only reset it when `WX_ROOT_DIR` had a value.  This change allows to set
both `wxWidgets_LIB_DIR` and `wxWidgets_ROOT_DIR` at the same time when
they where previously `-NOTFOUND`.
2022-07-06 09:59:38 -04:00
Maarten Bent
6dce42b171 FindwxWidgets: Restore win32 find style on MinGW
Since commit 6fac8af9ca (FindwxWidgets: set wxWidgets_FIND_STYLE to unix
on MINGW, 2022-04-11, v3.24.0-rc1~296^2), we only tried unix find style
on MinGW.  However, only some MinGW builds have the `wx-config` needed
for unix find style.  Other builds, including those using the official
wxWidgets makefiles, do not provide `wx-config` and need to use win32
find style.  To accommodate both use cases, first use win32 find style
and if it fails, use unix find style.
2022-07-06 09:58:48 -04:00
Brad King
4ae8018ddf Merge topic 'FindOpenSSL-doc-pkg-config'
42199256af FindOpenSSL: Document use of pkg-config
475880f39b FindOpenSSL: Reformat hints documentation as definition list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7441
2022-07-06 09:17:42 -04:00
Brad King
0b05adebcc Merge topic 'lcc-additional-implicit-link-dirs'
0eea1e8563 LCC: for OpenMP, collectly determine implicit link dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !7436
2022-07-06 08:53:47 -04:00