Commit Graph

1237 Commits

Author SHA1 Message Date
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
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
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
Brad King
4aeaf72fd6 Merge topic 'clang-manifest'
b73857561f Clang: embed windows manifests with GNU interface

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6534
2021-09-21 11:02:23 -04:00
Brad King
bcdd8cfe44 Merge topic 'platform-vars'
a136b6ec98 MINGW: Define variable only when targeting Windows platforms
39c5dad0cb Ninja: Remove redundant check for GNU-like compiler on Windows
0b7ae84a96 Cygwin: Remove redundant definitions of CYGWIN and UNIX variables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6538
2021-09-21 11:01:18 -04:00
Brad King
a136b6ec98 MINGW: Define variable only when targeting Windows platforms
The `MINGW` variable indicates that the compiler targets MinGW, a GNU
ABI on Windows.  Since commit aff3147917 (Modernize GNU compiler info on
Windows, 2009-12-02, v2.8.2~636), we load the `Platform/Windows-GNU`
module for compilers targetin MinGW, so set the variable there instead.
This is equivalent to `Platform/Windows-MSVC` setting the `MSVC`
variable.  Also remove `if(MINGW)` checks from the module, which have
not been necessary since the enclosed logic was moved to that module.

The undocumented `CMAKE_COMPILER_IS_MINGW` internal variable is now
unused, so remove it too.

Fixes: #22647
2021-09-17 12:17:35 -04:00
Brad King
c23e8411e5 Merge topic 'android-PATH'
94f3776774 Android: Restore searching PATH for executables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6528
2021-09-17 09:33:45 -04:00
Brad King
1127b591ec Merge topic 'android-PATH' into release-3.21
94f3776774 Android: Restore searching PATH for executables

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6528
2021-09-17 09:33:44 -04:00
Thomas Bernard
b73857561f Clang: embed windows manifests with GNU interface
Solves: #22611
2021-09-17 00:35:32 +02:00
hhb
94f3776774 Android: Restore searching PATH for executables
Since commit a7f41a7ee4 (Android: Fix find_* search order within NDK for
unified toolchains, 2020-10-13, v3.20.0-rc1~610^2), we turn off
`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`.  This breaks `find_program`
searching `PATH` for host executables.  Fortunately, the setting turns
out not to be necessary, perhaps since commit cbc51a8be3 (Android:
restructure android search paths, 2020-11-06, v3.20.0-rc1~509^2).
Without it, none of NDK tests fail, so remove it to restore pre-3.20
behavior.

Fixes: #22634
2021-09-16 08:45:33 -04:00
Brad King
f01ea7e391 MSVC: Fix MSVC_TOOLSET_VERSION for VS 2022 v143 toolset
This was forgotten in commit 0c7f918fb1 (VS: Update Visual Studio 17
2022 generator for Preview 2, 2021-07-14, v3.21.1~29^2) when the toolset
was first renumbered to `v143`.

Fixes: #22585
2021-09-02 13:47:42 -04:00
WangBin
164643fc39 Android: Fix NDK toolchain dir on arm64 mac 2021-08-18 14:09:33 -04:00
Brad King
ea8fc62194 Merge topic 'macos-10.4' into release-3.21
1af23c4de2 macOS: Restore support for Mac OS X 10.4 (Tiger)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6426
2021-08-06 10:48:20 -04:00
Evan Miller
1af23c4de2 macOS: Restore support for Mac OS X 10.4 (Tiger)
Since commit 4aed96e230 (Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG
on non-macOS too, 2021-04-06, v3.20.1~5^2) we always enable support for
linking with `-rpath`.  The intention of the change was to enable using
the flag on iOS, tvOS and watchOS by avoiding a Darwin-specific version
check.  However, removing the check broke support for OS X 10.4 because
the flag is not supported on that version.

Restore a form of the check that disables the flag on OS X < 10.5 while
still allowing it for the other Apple platforms.  Since no one is doing
iOS/tvOS/etc development on 10.4, this change should have no unintended
side effects.

Fixes: #22490
2021-08-02 16:12:14 -04:00
Jessica Hamilton
a1261ce917 Platform/Haiku: Remove the include-once behavior
The behavior was added by commit 7ebc1cb2ff (Haiku: Several fixes to
platform module, 2013-10-05, v3.0.0-rc1~541^2~3), but was not explained
in its commit message.  No other platform modules do this.

The include-once behavior results in incorrect variables set in some
larger projects, e.g. .NET Core, particularly when cross-compiling,
`CMAKE_DL_LIBS` being one of these.  Remove it.
2021-07-29 08:42:46 -04:00
Brad King
047585edc6 BinUtils: Find linker and librarian for Intel compilers on Windows
Update our Intel linker and archiver rules to use the `<CMAKE_LINKER>`
and `<CMAKE_AR>` placeholders instead of hard-coding the tool names.
2021-05-27 10:46:33 -04:00
Josef Angstenberger
dad5b9d845 Modules: Fix typos and spelling in comments 2021-05-07 17:00:15 +02:00
Brad King
06d103889c Merge topic 'clang-ipo-support'
3dd776ccfd Windows-Clang: Support duplicate object names in LTO archives

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6082
2021-05-05 10:07:26 -04:00
Brad King
3dd776ccfd Windows-Clang: Support duplicate object names in LTO archives
Update the archive rules added by commit 6e3655db2c (Clang: add LTO
support for GNU-command line clang on windows, 2019-07-08,
v3.16.0-rc1~161^2~3) to match the `ar` convention we use for normal
archives.

Issue: #21988
2021-05-03 14:37:20 -04:00
Brad King
e8f0b75ff9 Windows-GNU: Support duplicate object names when linking shared libraries
Extend the change from commit 39d0ade07e (Windows-GNU: Support duplicate
object names in large archives (#14874), 2014-04-14, v3.1.0-rc1~629^2~1)
to apply to the temporary archive we create for linking shared libraries
with MinGW tools.

Issue: #21988
2021-05-03 14:29:26 -04:00
Orgad Shaneh
ddcd1469e8 MSYS: Add support for running under MSYS runtime environment
Detect MSYS as CYGWIN, with the required adaptations.
2021-04-26 14:27:34 -04:00
Brad King
6968500352 Merge topic 'ios-rpath-linker-flag'
4aed96e230 Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5980
2021-04-07 10:06:56 -04:00
Brad King
196376a33e Merge topic 'ios-rpath-linker-flag' into release-3.20
4aed96e230 Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5980
2021-04-07 10:06:55 -04:00
Brad King
e061a201b6 Merge topic 'nvhpc-lib-arch' into release-3.20
764606e256 CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths
5d44d73bbe CMakeDetermineCompilerABI: Revert "Parse library arch from versioned paths"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5984
2021-04-06 08:32:34 -04:00
Brad King
ebc812a8d1 Merge topic 'nvhpc-lib-arch'
764606e256 CMakeDetermineCompilerABI: Extract lib arch from implicit object file paths
5d44d73bbe CMakeDetermineCompilerABI: Revert "Parse library arch from versioned paths"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5984
2021-04-06 08:32:34 -04:00
Craig Scott
4aed96e230 Apple: Set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG on non-macOS too
Since CMake 3.19, we no longer support macOS SDKs older than 10.5,
which corresponds to Xcode 3. Supporting older Xcode versions for
device platforms is also not realistic. We therefore expect the -rpath
linker option should always be supported now.

When targeting iOS, tvOS or watchOS, the previous disabling of -rpath
support meant that the install_name_dir of shared libraries and
frameworks was unable to use @rpath. This resulted in embedding
absolute paths for their install_name. When they were embedded in an
app bundle, this would cause the app to fail at runtime. By enabling the
-rpath linker option, the default install_name_dir is now @rpath for these platforms, which results in binaries that do work at runtime.

Fixes: #20036
2021-04-06 11:46:56 +10:00
Robert Maynard
5d44d73bbe CMakeDetermineCompilerABI: Revert "Parse library arch from versioned paths"
The change in commit 657fc3a9a7 (CMakeDetermineCompilerABI: Parse
library arch from versioned paths, 2021-02-03, v3.20.0-rc1~40^2) caused
`CMAKE_LIBRARY_ARCHITECTURE` to be populated on non-multiarch platforms
if their compilers happen to use `$arch/$version` library directories.
Revert the use of versioned library paths.

Fixes: #22024
2021-04-05 16:40:43 -04:00
Brad King
0fee2adf8c Merge topic 'fujitsu-compiler-4.0-support'
8ef55dec29 Help: Add release notes for Fujitsu compiler support
4c74c86f40 FindBLAS/LAPACK: Add support for the Fujitsu SSL2 library
376c300b25 FindOpenMP: Add support for Fujitsu compilers
9e0a1cf03e FindMPI: Add support for the Fujitsu compiler wrappers
a237450948 Tests: Update for the FujitsuClang compiler
27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode
a55feff69c Tests: Update for the Fujitsu compiler
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Acked-by: Gilles Gouaillardet <gilles@rist.or.jp>
Merge-request: !5954
2021-04-01 10:26:54 -04:00
Brad King
f31d1dd175 Merge topic 'android-binutils'
61e6fc26bc Android: Fix search for binutils

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5958
2021-03-31 09:26:35 -04:00
Chuck Atkins
27579e9cf1 FujitsuClang: Add support for the Fujitsu compiler in Clang mode
This should be front end compatible with vanilla clang but giving it a
unique identifier allows a project to pass additional options unique to
Fujitsu and outside the scope of a CMake builtin.
2021-03-31 09:14:45 -04:00
Chuck Atkins
3c867cff4a Fujitsu: Add support for the Fujitsu compiler in Trad mode
Co-Author: Yuichiro Utsumi <utsumi.yuichiro@jp.fujitsu.com>
2021-03-30 10:32:53 -04:00
Haibo Huang
61e6fc26bc Android: Fix search for binutils
Set `CMAKE_SYSTEM_PROGRAM_PATH` in `Platform/Android-Initialize` instead
of `Platform/Android` so it can be used in `CMakeFindBinUtils`.

Also add the names `llvm-strip` and `llvm-ranlib` for the corresponding
tools.
2021-03-30 10:06:02 -04:00
Raul Tambre
56c759b000 Per-language Win32/Console flags
Allows using different compilers with different flags for different languages.
For example Clang with GNU-like commandline for CXX and MSVC as host compiler
for CUDA.

Should help with #21914.
2021-03-17 17:51:56 +02:00
Brad King
957a117c70 Merge topic 'android-r22'
005e2cdfb0 Android: Do not use gold for ndk >= r22
ed7a87f270 Tests: Update RunCMake.Android for NDK r22
4950d35733 Help: Document CMAKE_ANDROID_NDK_VERSION variable
746906242d Android: Detect NDK version number

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5862
2021-03-03 11:11:58 -05:00
Haibo Huang
746906242d Android: Detect NDK version number
Report it in `CMAKE_ANDROID_NDK_VERSION`.
2021-03-03 10:26:36 -05:00
Raul Tambre
af38d5a1d4 Platform/Windows-NVIDIA-CUDA: Remove duplicated code
Some of the things are set in Platform/NVIDIA-CUDA and since we aren't setting
them to different values there's no point in overriding them.
Also fixed an unset() copy-paste error.
2021-02-14 11:53:26 +02:00
Raul Tambre
4dc1c9e525 CUDA: Fix spelling __IMPLICT_ -> __IMPLICIT_ 2021-02-14 11:53:24 +02:00
Brad King
691e8ac480 Merge topic 'clang-imsvc'
2fc5e5dba9 Clang: Use -imsvc for system include only with MSVC-like front-end

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Thomas Bernard <thomas@famillebernardgouriou.fr>
Merge-request: !5792
2021-02-10 07:46:33 -05:00
Brad King
2fc5e5dba9 Clang: Use -imsvc for system include only with MSVC-like front-end
In commit bb61c2d024 (Clang: use -imsvc for system include dirs when
running on Windows, 2020-09-16, v3.19.0-rc1~162^2) we added `-imsvc`
for all Clang compilers targeting the MSVC ABI.  However, the option
only exists for the MSVC-like front-end.  The GNU-like front-ends
use `-isystem`.

Fixes: #21789
2021-02-09 11:24:41 -05:00
Robert Maynard
657fc3a9a7 CMakeDetermineCompilerABI: Parse library arch from versioned paths
Teach CMake how to extract `CMAKE_<LANG>_LIBRARY_ARCHITECTURE` from
versioned paths such as `/usr/lib/gcc/x86_64-linux-gnu/9`. These kind of
paths are generated by NVHPC compilers.
2021-02-04 15:17:49 -05:00
William R. Dieter
a90d2a9eed IntelLLVM: Add support for Intel LLVM-based compilers
Using a single ID 'IntelLLVM' for the suite of Intel compilers based on
the LLVM backend.  The 'IntelLLVM' ID are used for C, C++, and Fortran.
Data Parallel C++ will be handled in a separate commit.

The C and C++ definitions are based on the Clang definitions.  The Intel
LLVM-based C and C++ compilers are based on the Clang front end, so
existing Clang options are more likely to be a good match than options
for the older Intel compilers.

Fortran is based on the older Fortran front end with the LLVM backend.
It has a similar interface to the older versions, though many options
are shared with the C and C++ compilers.

Fixes: #21561
Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:05:35 -05:00
Tin Huynh
83ea49818f NVHPC: Add support for NVIDIA HPC SDK compilers based on PGI
Identify the compilers as `NVHPC` to distinguish it from the older PGI
compilers from which they evolved, and from other `NVIDIA` compilers.

Fixes: #20887
2021-01-27 09:53:02 -05:00
Brad King
016c71c681 Merge topic 'intel-fortran-nofor-main'
2a5955ac09 Intel: Replace deprecated Fortran flag -nofor_main with -nofor-main

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5729
2021-01-25 11:40:14 -05:00
Brad King
2a5955ac09 Intel: Replace deprecated Fortran flag -nofor_main with -nofor-main
The `-nofor_main` flag was originally added by commit ccdd3e943d (Fix
Intel Fortran SHARED libraries on Linux, 2009-10-27, v2.8.2~915).  Since
then, Intel Fortran renamed the option to `-nofor-main` and deprecated
the old name.  The new name has been available for a long time, so
we can just switch to it.

Fixes: #21735
2021-01-22 09:38:57 -05:00
Brad King
5a1b257fe7 Merge topic 'msvc-arm64ec-platform-support'
4ea3a88625 MSVC: Add support for targeting ARM64EC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5708
2021-01-22 08:38:21 -05:00
Moyo Okeremi 😊
4ea3a88625 MSVC: Add support for targeting ARM64EC 2021-01-20 16:43:35 -08:00
Raul Tambre
acfb54bb2f Clang: Support WIN32_EXECUTABLE
Fixes #21613.
2020-12-23 12:39:09 +02:00
Brad King
41d8c20221 Merge topic 'macos-homebrew-apple-silicon'
1a5c1a68b6 macOS: Add /opt/homebrew to CMAKE_SYSTEM_PREFIX_PATH on Apple Silicon

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Fons Rademakers <fons.rademakers@cern.ch>
Merge-request: !5602
2020-12-14 07:10:04 -05:00
Brad King
1a5c1a68b6 macOS: Add /opt/homebrew to CMAKE_SYSTEM_PREFIX_PATH on Apple Silicon
According to https://brew.sh/2020/12/01/homebrew-2.6.0/ the `/opt/homebrew`
directory is recommended for installing ARM architecture brew packages.

Fixes: #21585
2020-12-11 13:07:17 -05:00
Brad King
794aa36b1f Merge topic 'apple-silicon-host-arch'
b7f0327dcd Tests: Cover macOS host architecture selection on Apple Silicon hosts
5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5589
2020-12-11 13:05:34 -05:00