Commit Graph

732 Commits

Author SHA1 Message Date
unknown
625ef88a92 CUDA: Add CMAKE_CUDA_HOST_COMPILER support on Windows non-VS generators 2021-04-22 11:40:46 -04:00
Albrecht Schlosser
388c347a4b Help: Fix typo in CMAKE_TOOLCHAIN_FILE docs 2021-04-18 07:52:59 +10:00
Brad King
bb290fc7a4 Merge topic 'add_toolchain_cmake_option'
d5c3e4ac32 cmake: add support for --toolchain command argument
13838bbb36 CMAKE_TOOLCHAIN_FILE: Document relative path behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5991
2021-04-16 11:39:28 -04:00
Robert Maynard
13838bbb36 CMAKE_TOOLCHAIN_FILE: Document relative path behavior 2021-04-15 10:12: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
71e887d678 Merge topic 'add_q_namespace_export_docs'
3538f1c69b Help: Add Q_NAMESPACE_EXPORT to CMAKE_AUTOMOC_MACRO_NAMES default values

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5982
2021-04-06 08:27:15 -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
Alexander Neumann
3538f1c69b Help: Add Q_NAMESPACE_EXPORT to CMAKE_AUTOMOC_MACRO_NAMES default values
This was accidentally left out of commit 426941c433 (Autogen: Recognize
the new Q_NAMESPACE_EXPORT macro in AUTOMOC, 2020-02-26,
v3.17.0-rc2~3^2).
2021-04-05 11:25:19 -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
78ff963f74 Merge topic 'doc-CMAKE_APPLE_SILICON_PROCESSOR' into release-3.20
3f04f69733 Help: CMAKE_APPLE_SILICON_PROCESSOR cannot be set in a toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5965
2021-04-01 10:23:13 -04:00
Brad King
f4a778c2eb Merge topic 'doc-CMAKE_APPLE_SILICON_PROCESSOR'
3f04f69733 Help: CMAKE_APPLE_SILICON_PROCESSOR cannot be set in a toolchain file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5965
2021-04-01 10:23:13 -04:00
Brad King
3f04f69733 Help: CMAKE_APPLE_SILICON_PROCESSOR cannot be set in a toolchain file
`CMakeDetermineSystem` determines the host system information before
loading the toolchain file.

Issue: #22012
2021-04-01 10:04:05 -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
friendlyanon
96a7040107 project: Define variables indicating whether project is top level
Define `PROJECT_IS_TOP_LEVEL` and `<PROJECT-NAME>_IS_TOP_LEVEL`.  The
latter is a STATIC cache entry just like other `<PROJECT-NAME>_*`
variables so that it is globally scoped.

Issue: #20310
Fixes: #21961
2021-03-26 09:35:34 -04:00
Brad King
0310097377 Merge topic 'vs-custom-flag-table'
608ef8a6fc VS: Add a mostly-undocumented hook to load custom JSON flag tables
8dd8d63665 Tests: Add RunCMake hook to describe test variants

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5895
2021-03-23 11:20:18 -04:00
Brad King
08e3961f80 Merge topic 'doc-xcoff-chrpath'
4a9fb82030 Help: CMAKE_NO_BUILTIN_CHRPATH applies to XCOFF too

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5925
2021-03-23 10:34:50 -04:00
Brad King
608ef8a6fc VS: Add a mostly-undocumented hook to load custom JSON flag tables
The names and formats of our VS flag tables are internal implementation
details.  However, some institutions need to maintain support for
non-public VS platforms and toolsets.  Provide a hook that their
projects can use to load custom flag table files.  This helps avoid
distributing a custom CMake package within such institutions.

Document the hook itself, but explicitly specify that the files the
hook loads are not considered a stable interface.
2021-03-22 13:28:27 -04:00
Craig Scott
4a9fb82030 Help: CMAKE_NO_BUILTIN_CHRPATH applies to XCOFF too 2021-03-22 11:48:01 -04:00
Marcel Ritzschke
c73b847b03 VS: switch to new folder structure while keeping the old one working
Fixes: #21170
2021-03-18 15:44:13 +01:00
Alexander Richardson
95c50da8af Help: Document that CMAKE_<LANG>_FLAGS[_INIT] are strings
Issue: #21944
2021-03-17 09:22:52 -04:00
Brad King
1e2513b612 Merge topic 'vs-toolset-version' into release-3.20
30c835428f VS: Accept and translate '-T version=' values with three components
58a50a3a0a VS: Fix '-T version=14.28' under VS 16.9
09f59da7f0 cmGlobalVisualStudioVersionedGenerator: Clarify local variable name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5903
2021-03-15 08:50:13 -04:00
Brad King
3d661c6c3a Merge topic 'vs-toolset-version'
30c835428f VS: Accept and translate '-T version=' values with three components
58a50a3a0a VS: Fix '-T version=14.28' under VS 16.9
09f59da7f0 cmGlobalVisualStudioVersionedGenerator: Clarify local variable name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5903
2021-03-15 08:50:13 -04:00
Brad King
30c835428f VS: Accept and translate '-T version=' values with three components
The VS 16.8 and VS 16.9 toolset versions differ only in their third
component.  The `vcvarsall` option `-vcvars_ver=` accepts a three
component version, so accept this format for VS toolset selection too.

Issue: #21922
2021-03-12 08:36:45 -05:00
Brad King
58a50a3a0a VS: Fix '-T version=14.28' under VS 16.9
CMake accepts the toolset version that is default in the current VS
version by matching the name later VS versions will use for the SxS
props files.  It predicts the future name based on the first two
components of the current VS version's default toolset.  However, this
heuristic breaks naming the VS 16.8 toolset version 14.28 under VS 16.9
because the latter's default toolset version is 14.28.29910, which did
not increment the second version component (unprecedented in VS).

Fix this by always using the requested version's SxS props file when it
exists, even if it matches the first two components of the current VS
version's default toolset.  Also add a special case for the name VS
16.10 will use for VS 16.9's default toolset, so that it can be used
with VS 16.9 too.

Fixes: #21922
2021-03-12 08:36:40 -05:00
Brad King
4950d35733 Help: Document CMAKE_ANDROID_NDK_VERSION variable 2021-03-03 10:27:50 -05:00
Ben Boeckel
cf22237c69 Help: clarify availability of the MSVC_IDE variable 2021-02-11 09:43:21 -05:00
Brad King
a30d096c85 Help: Update Sphinx versionadded directives for 3.20 release
Run the script:

    Utilities/Sphinx/update_versions.py --since v3.19.0 --overwrite

Manually restore the 3.20 version for `cmake_path`, which was originally
part of 3.19 but reverted and restored in 3.20.
2021-02-10 08:18:12 -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
5a6379f1fd Help: Clarify meaning of CMAKE_SYSTEM_PROCESSOR
On Windows the value may not match the compiler's target architecture.
Update the documentation to state this explicitly.

Issue: #15170
2021-01-26 11:04:22 -05:00
Brad King
3c80666f00 Help: Document intended purpose of XCODE_ATTRIBUTE_<an-attribute>
Also warn the reader against setting values CMake normally generates.

Issue: #21728
2021-01-23 07:29:10 +11:00
Brad King
fddbb7db4b Merge topic 'vs-sdk-selection'
1e67482daf VS: Generalize Win10 max SDK version to all VS generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5721
2021-01-21 09:18:31 -05:00
jonathan molinatto
1e67482daf VS: Generalize Win10 max SDK version to all VS generators
The `CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` variable added in
CMake 3.19 by commit ba497111f6 (VS: Add option for custom Win10 SDK
version maximum, 2020-08-20, v3.19.0-rc1~262^2) was documented as if it
worked for all generators but implemented only to override CMake's
builtin default for the VS 2015 max SDK version.  Generalize the
variable to set a custom max SDK version for later VS versions too.

Fixes: #21720
2021-01-20 14:46:34 -05:00
Pawel Dac
4426ddda1c Help: Clarify memory check sanitizer option behavior for log_path
Added information about prepending [ASAN/LSAN/TSAN/MSAN/UBSAN]_OPTIONS
to MemoryTesterEnvironmentVariable and `log_path` limitation.
2021-01-13 23:14:26 +01:00
Raul Tambre
baa530fe9f Help: Add example for setting default CMAKE_CUDA_ARCHITECTURES value
Fixes #21302 and #21666.
2021-01-10 12:06:02 +02:00
Brad King
4f5a12be29 Merge topic 'reword_MSVC_documentation'
1185438ea8 Help: Reword the MSVC variable documentation focusing on cl.exe compatibility

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5676
2021-01-08 09:12:47 -05:00
Thomas Bernard
1185438ea8 Help: Reword the MSVC variable documentation focusing on cl.exe compatibility
Fixes: #21651
2021-01-07 16:32:48 -05:00
Shannon Booth
a742b5d137 CMAKE_EXPORT_COMPILE_COMMANDS: allow configuration per target
The new target property `EXPORT_COMPILE_COMMANDS` associated with the
existing global variable can be used to optionally configure targets for
their compile commands to be exported.

Fixes: #19462
2021-01-06 11:51:39 +13:00
Craig Scott
d2456b29f4 Merge topic 'unity-anon-ns'
0fe9c40494 Unity Build: Add option for generating per-file unique id

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4784
2020-12-16 07:40:41 -05:00
Brad King
67f12dd1d6 Merge topic 'ispc_control_header_suffixes'
c9a50f3556 ISPC: Generated Headers suffix configurable with a better default

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5597
2020-12-15 07:40:34 -05:00
Stephen Kelly
0fe9c40494 Unity Build: Add option for generating per-file unique id
Fixes: #21477
2020-12-15 22:26:09 +11:00
Robert Maynard
c9a50f3556 ISPC: Generated Headers suffix configurable with a better default
The target property `ISPC_HEADER_SUFFIX` and associated global
variable now can control the suffix used when generating the
C/C++ interoperability ISPC headers.

In addition the default suffix is now "_ispc.h" which matches the
common convention that the ISPC compiler team uses and recommends.
2020-12-14 13:13:09 -05:00
Guillem Vela
1f41eb8472 Help: Fix small typos in documentation 2020-12-14 07:18:47 -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
Brad King
5f882f6ce5 macOS: Offer control over host architecture on Apple Silicon hosts
Since commit b6c60f14b6 (macOS: Default to arm64 architecture on Apple
Silicon hosts, 2020-09-28, v3.19.0-rc1~63^2) we use `sysctl` to detect
that we are running on Apple Silicon in a way that pierces Rosetta.
This always sets `CMAKE_HOST_SYSTEM_PROCESSOR` to be `arm64` on such
hosts.  However, macOS offers strong support for running processes under
an emulated `x86_64` architecture.

Teach CMake to select either `arm64` or `x86_64` as the host
architecture on Apple Silicon based on the architecture of its own
process.  When CMake is built as a universal binary, macOS will select
whichever slice (architecture) is appropriate under the user's shell,
and `CMAKE_HOST_SYSTEM_PROCESSOR` will match.

Also offer a `CMAKE_APPLE_SILICON_PROCESSOR` variable and environment
variable to provide users with explicit control over the host
architecture selection regardless of CMake's own architecture.

Finally, if `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to
the toolchain to use selected host architecture instead of letting the
toolchain pick.

Fixes: #21554
2020-12-10 12:08:13 -05:00
Brad King
f200ac1304 Merge topic 'remove-partial-intel-compiler-support'
41b69348a5 Revert "Intel: Add Intel DPC++ compiler identification"
f0babb53b3 Revert "Intel: Add Intel Clang compiler identification"

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Merge-request: !5583
2020-12-08 10:16:21 -05:00
Brad King
41b69348a5 Revert "Intel: Add Intel DPC++ compiler identification"
Revert commit 887f3a88a6 (Intel: Add Intel DPC++ compiler
identification, 2020-09-21, v3.19.0-rc1~124^2).  The compiler has
already been released, and is more usable with CMake by pretending to be
upstream Clang than by identifying it as a compiler for which we have
not implemented support.

Fixes: #21551
2020-12-07 10:46:27 -05:00
Brad King
f0babb53b3 Revert "Intel: Add Intel Clang compiler identification"
Revert commit 5c3a93ab88 (Intel: Add Intel Clang compiler
identification, 2020-09-29, v3.19.0-rc1~68^2).  The compiler has already
been released, and is more usable with CMake by pretending to be
upstream Clang than by identifying it as a compiler for which we have
not implemented support.

Issue: #21551
2020-12-07 10:46:22 -05:00
Brad King
628d7ef672 Merge topic 'cuda_env_archs'
c57541d874 CUDA: Fix tests with CUDAARCHS set
c4ae9384ff CUDA: Initialize CMAKE_CUDA_ARCHITECTURES using $ENV{CUDAARCHS}

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5533
2020-12-01 09:37:07 -05:00