Commit Graph

12026 Commits

Author SHA1 Message Date
Craig Scott
220f78e253 TI: Recognize invalid compiler option warning during try_compile()
Fixes: #22866
2021-11-11 10:53:31 -05:00
Brad King
e2ceaec991 Merge topic 'IntelLLVM-no-xilink' into release-3.22
48f29b5805 IntelLLVM: Use MSVC linker with MSVC frontend variant

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6719
2021-11-11 10:45:19 -05:00
William R. Dieter
48f29b5805 IntelLLVM: Use MSVC linker with MSVC frontend variant
The Intel compiler (pre-LLVM) expected xilink.exe and had special logic to
set xilink.exe.  The newer LLVM-based compiler does not want xilink.exe.
link.exe works better for host code, and is the default, so change
the matching condition such that the old compiler matches (and gets
xilink.exe) and the new compiler gets the default link.exe it expects.

A better solution will be to use the compiler as the linker.  A future
change will switch to compiler as linker by default, but that fix needs
more validation.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-11-10 13:41:06 -05:00
Brad King
2b9b64269f Merge topic 'vs-framework-version' into release-3.22
d51246c662 VS: Default TargetFrameworkVersion to v4.7.2 for VS 2022
f97f8537f3 VS: Model a default target framework
e40cedddc0 cmVisualStudio10TargetGenerator: Refactor target framework selection
78782cc7dc cmGlobalVisualStudio8Generator: Refactor SetGeneratorPlatform

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6699
2021-11-08 12:38:47 -05:00
Craig Scott
76c0281421 Help: Clarify how PKG_CONFIG env var initializes cache vars
Fixes: #22870
2021-11-07 16:09:42 +11:00
Brad King
f97f8537f3 VS: Model a default target framework
Add fields to the VS generator to select a target framework.
Migrate the existing default for VS 12 .NET CF for Windows CE.

Report the values in `CMAKE_VS_*` variables and use them for
the CSharp compiler id project too.

Issue: #22849
2021-11-06 06:08:54 -04:00
Thomas Dickerson
58c8d649e1 CheckLinkerFlag: Set policies needed by the implementation
The module was added in CMake 3.18 by commit af96c0f4fa
(CheckLinkerFlag: Add module to check validity of linker flags,
2020-05-16, v3.18.0-rc1~103^2), but it is still possible for projects to
use it without setting policies to the 3.18 version level.
2021-11-04 14:01:09 -04:00
Brad King
753d861a3b Merge topic 'FindHDF5-avoid-duplicate-library-entries' into release-3.22
247f1149e1 FindHDF5: clear language-specific libraries list before discovery
f56963cf05 FindHDF5: clear library output variables at the top of the module

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6698
2021-11-04 09:06:39 -04:00
Brad King
274e3fb7f4 Merge topic 'FindHDF5-fix-windows-hl-implib-query' into release-3.22
6f830c5c38 FindHDF5: fix variable name when querying `hdf5_hl`'s implib

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6697
2021-11-04 09:04:41 -04:00
Brad King
7456127e01 Merge topic 'GNUtoMS-vs2022' into release-3.22
571a795d2f GNUtoMS: Add search path for VS 2022 environment scripts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6695
2021-11-04 09:03:22 -04:00
Ben Boeckel
247f1149e1 FindHDF5: clear language-specific libraries list before discovery 2021-11-03 13:24:30 -04:00
Ben Boeckel
f56963cf05 FindHDF5: clear library output variables at the top of the module
This avoids accumulation of `HDF5_LIBRARIES` results when calling
`find_package(HDF5)` multiple times within a single scope.
2021-11-03 13:05:18 -04:00
Ben Boeckel
6f830c5c38 FindHDF5: fix variable name when querying hdf5_hl's implib
Introduced in 4150048a3b (FindHDF5: unset some variables, 2017-07-24).
2021-11-03 11:29:20 -04:00
Brad King
28d63320f1 Merge topic 'nvhpc-isystem' into release-3.22
92624714c4 NVHPC: Support SYSTEM include directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6691
2021-11-03 10:37:54 -04:00
Brad King
571a795d2f GNUtoMS: Add search path for VS 2022 environment scripts
Extend the logic from commit 08c5b3eff0 (GNUtoMS: Add search path for VS
2019 environment scripts, 2020-01-09, v3.16.3~15^2) to consider VS 2022
paths too.

Fixes: #22847
2021-11-03 10:32:14 -04:00
Robert Maynard
92624714c4 NVHPC: Support SYSTEM include directories
Fixed #22834
2021-11-02 14:33:18 -04:00
Brad King
56d949f05f FindMPI: Fix finding PkgConfg for fallback
In commit 0723b2c935 (MPI: Add fallback detection code for MPI when cross
compiling, 2021-09-17, v3.22.0-rc1~89^2) the FindPkgConfig module was
included directly.  This produces warnings like:

    The package name passed to `find_package_handle_standard_args` (PkgConfig)
    does not match the name of the calling package (MPI).

Use `find_package(PkgConfig)` instead, as other find modules do.

Fixes: #22823
2021-11-01 08:09:15 -04:00
Brad King
c5cc4ddac4 MSVC: Add support for C17
C17 support has been available in MSVC since VS 16.8.

Fixes: #22816
2021-10-28 12:27:00 -04:00
Brad King
6561b032bc MSVC: Tolerate c_std_17 and c_std_23 features on older compiler versions
MSVC `cl` versions prior to 19.27 had no `-std:c*` flags for C
standards.  List the `c_std_{17,23}` features anyway.  This allows
projects to at least attempt compilation with these compilers since they
do not have any modes.
2021-10-28 12:27:00 -04:00
Brad King
22f804e0ec MSVC: Refactor C compile features table for C90, C99, and C11
The custom "no modes" `cmake_record_c_compile_features` implementation
should only be used in `cl` versions prior to 19.27 because they had no
`-std:c*` flags for C standards.  For 19.27 we need a different custom
implementation to account for partial C11 support.  For 19.28 and above
we can use the default implementation through the `*__HAS_FULL_SUPPORT`
settings.

We already use this pattern in the MSVC C++ compile feature table.
2021-10-28 12:27:00 -04:00
Erlend E. Aasland
51a2afe6e7 CPack/IFW: Add support for QtIFW 4.2 2021-10-27 14:31:22 -04:00
Brad King
3d0e2775a5 HIP: Add missing space when appending --cuda-host-only
Fixes: #22805
2021-10-26 10:48:48 -04:00
Brad King
814567faa3 Merge topic 'binutils-llvm-strip' into release-3.22
5dd981539f BinUtils: Avoid llvm-strip versions older than Clang 11

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6655
2021-10-26 09:07:30 -04:00
Brad King
5dd981539f BinUtils: Avoid llvm-strip versions older than Clang 11
Since commit cf82300a63 (BinUtils: Clarify search logic and make it more
consistent, 2021-05-27, v3.21.0-rc1~119^2~2) we correctly prefer the
more-specific name `llvm-strip` over `strip` when using Clang.  However,
`llvm-strip` from Clang versions prior to 11 require extra flags to
strip everything.  Until our `install(TARGETS)` logic learns to add
those flags, avoid using older versions of `llvm-strip` by default.

Fixes: #22785
2021-10-22 09:24:46 -04:00
Brad King
42418b02f7 Android: Refactor sysroot detection under Visual Studio
Since commit 6051a49c78 (Visual Studio: Add Android support, 2020-06-12,
v3.19.0-rc1~619^2) we run MSBuild to build a sample project to detect
the sysroot.  Previously we relied on `CMAKE_VS_MSBUILD_COMMAND` being
available.  That required commit d5b5c19278 (cmGlobalGenerator:
FindMakeProgram() before CMakeDetermineSystem, 2020-06-15,
v3.19.0-rc1~619^2~3) to make it available early enough.  However, that
ordering broke `CMAKE_GENERATOR_INSTANCE` so we need to prepare to
revert it.  Use `cmake_host_system_information` to get the location of
MSBuild under a VS generator instead.
2021-10-20 13:00:25 -04:00
Raul Tambre
7123c8fdbf CheckLanguage: Don't pass CMAKE_CUDA_HOST_COMPILER for Visual Studio
Visual Studio doesn't support specifying it and if we do we get a warning.

Fixes: #22712
2021-10-19 09:03:24 -04:00
Brad King
6dfe28f33c Merge branch 'backport-3.21-vs2022' into vs2022 2021-10-14 13:40:20 -04:00
Brad King
787ab7ff20 IRSL: Fix discovery of VS 2022 v143 toolset redistributables for preview 5
VS 2022 Preview 5 renamed the redist directories from `Microsoft.VC142.*`
to `Microsoft.VC143.*` in order to match the `v143` toolset name.

Fixes: #22586
2021-10-14 13:37:05 -04:00
Brad King
568a93d08c Merge branch 'msvc-c++23' into release-3.21
Merge-request: !6614
2021-10-12 09:35:56 -04:00
Brad King
323846afc1 Merge topic 'msvc-c++23' into release-3.22
ef47e18ad0 MSVC: Tolerate cxx_std_23 feature on older compiler versions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6614
2021-10-12 09:34:16 -04:00
Brad King
9fdfc5dd44 Merge topic 'find-blas-lapack-cleanup'
635f2c87f5 FindBLAS: Fix EML and ArmPL indentations
816dc1cb19 FindBLAS: Replace set(A val) with string(APPEND)
a7843faa20 FindLAPACK: Replace set(A val) with string(APPEND)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6605
2021-10-08 09:49:21 -04:00
Brad King
b7c91c74eb Merge topic 'revert-debian-libexec'
6658e260d4 GNUInstallDirs: Fix misinterpretation of Debian Policy on LIBEXECDIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6607
2021-10-08 09:45:12 -04:00
Brad King
1a47305edf Merge topic 'revert-debian-libexec' into release-3.21
6658e260d4 GNUInstallDirs: Fix misinterpretation of Debian Policy on LIBEXECDIR

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6607
2021-10-08 09:45:10 -04:00
Timo Röhling
6658e260d4 GNUInstallDirs: Fix misinterpretation of Debian Policy on LIBEXECDIR
Revert commit 798c1c3192 (GNUInstallDirs: Comply with Debian Policy on
LIBEXECDIR, 2020-10-08, v3.19.0-rc1~11^2).

The Debian Policy builds upon FHS 3.0 and permits installing to
`/usr/libexec`. While Policy does grant an additional exception for
applications to use a single subdirectory of `/usr/lib/<triplet>`, this
is not meant to replace `/usr/libexec` as valid target.

Fixes: #22731
2021-10-07 14:29:18 -04:00
Brad King
ef47e18ad0 MSVC: Tolerate cxx_std_23 feature on older compiler versions
In commit 3aaf1d91bf (MSVC: C++20 final flag, C++23 support, 2021-05-29,
v3.20.4~7^2~1) we forgot to add `cxx_std_23` to the fallback table for
MSVC versions from VS 2010 through VS 2015.  This allows project to at
least attempt compilation with these compilers since they do not have
any modes.

Issue: #22729
2021-10-07 11:46:09 -04:00
Igor S. Gerasimov
635f2c87f5 FindBLAS: Fix EML and ArmPL indentations 2021-10-07 09:35:43 -04:00
Igor S. Gerasimov
816dc1cb19 FindBLAS: Replace set(A val) with string(APPEND) 2021-10-07 09:33:51 -04:00
Igor S. Gerasimov
a7843faa20 FindLAPACK: Replace set(A val) with string(APPEND) 2021-10-07 09:33:51 -04:00
Brad King
24fb43e3e7 Merge topic 'math_libs_include'
32574814c7 FindCUDAToolkit: Fix missing sibling include directory for math libraries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6591
2021-10-07 09:23:08 -04:00
Brad King
6e037a04e7 Merge topic 'FindJasper-imported-target'
6e8754c625 FindJasper: Add IMPORTED target
bdbce845cd FindJasper: Add JASPER_INCLUDE_DIRS result variable
7f8413c309 FindJasper: Modernize documentation layout
524205a7a5 FindJasper: Modernize code layout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4633
2021-10-07 09:22:11 -04:00
Brad King
f175a62fcc Merge topic 'xcode-lang-defaults'
3add62462c Xcode: Fix detection of default language standard when given -std= flags
5c4424e5b7 CMakeDetermineCompilerId: Tolerate variables named for languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Raul Tambre <raul@tambre.ee>
Merge-request: !6598
2021-10-07 09:12:45 -04:00
Brad King
0a863c71d8 Merge topic 'corret_nvhpc_fortran_compile_deps'
1a828043b7 NVHPC: only use '-MD' for the C and CXX languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6602
2021-10-07 09:11:21 -04:00
Brad King
2104c198bd Merge topic 'corret_nvhpc_fortran_compile_deps' into release-3.21
1a828043b7 NVHPC: only use '-MD' for the C and CXX languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6602
2021-10-07 09:11:20 -04:00
Robert Maynard
1a828043b7 NVHPC: only use '-MD' for the C and CXX languages
CMake shouldn't use '-MD' for nvfortran to generate dependency information.

Fixes #22723
2021-10-06 16:21:29 -04:00
Hiroshi Miura
6e8754c625 FindJasper: Add IMPORTED target
Fixes: #20601
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2021-10-06 11:28:09 -04:00
Hiroshi Miura
bdbce845cd FindJasper: Add JASPER_INCLUDE_DIRS result variable
The `JASPER_INCLUDE_DIR` cache entry is not supposed to be the public
result variable.
2021-10-06 11:20:54 -04:00
Hiroshi Miura
7f8413c309 FindJasper: Modernize documentation layout 2021-10-06 11:20:38 -04:00
Hiroshi Miura
524205a7a5 FindJasper: Modernize code layout 2021-10-06 11:20:35 -04:00
Brad King
3add62462c Xcode: Fix detection of default language standard when given -std= flags
If one uses `CFLAGS='-std=...'` or `CXXFLAGS='-std=...'` then the given
`-std=` flag(s) will always be used.  That effectively changes the
compiler default standard level and extension settings.  Fix the
Xcode generator's compiler id logic to preserve any `-std=` flag
so that the proper defaults are detected.

This problem was exposed by commit 4a0485be7f (cmStandardLevelResolver:
Avoid unnecessary flags, fix unset level logic, 2021-05-29), which
changed the logic to not pass any `-std=` flag if the standard level
and extension settings requested by the project match the default
(`stdIt <= defaultStdIt` became `stdIt < defaultStdIt`).  The new
logic assumes the detected default standard matches what will actually
happen when the project is generated.
2021-10-06 10:36:39 -04:00
Brad King
5c4424e5b7 CMakeDetermineCompilerId: Tolerate variables named for languages 2021-10-06 10:36:39 -04:00