Commit Graph

4600 Commits

Author SHA1 Message Date
Brad King
8d5f4c4db9 Xcode: Switch to the "new build system" for Xcode 12 and above
Provide an option to switch back to the original build system via
`-T buildsystem=1`.

Fixes: #18088
2020-09-18 13:02:14 -04:00
Brad King
2db623f554 Xcode: Add option to specify build system variant
Extend the `-T <toolset>` option to support a `buildsystem=` field with
the Xcode generator.  Add a `CMAKE_XCODE_BUILD_SYSTEM` variable to
inform project code about the selected build system variant.
2020-09-18 12:49:17 -04:00
Brad King
de9a2f1ef6 Help: Move CMAKE_XCODE_GENERATE_SCHEME to proper manual section 2020-09-14 13:14:38 -04:00
Brad King
b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies
`ExternalProject_Add_StepTargets` and `INDEPENDENT_STEP_TARGETS` have
some limitations and lack some sanity checks.  They can cause confusing
build systems to be generated.  The basic problems are:

* The notion of step independence is attached to the step target
  rather than the step itself.

* The custom commands implementing the steps are duplicated in the
  step targets and the primary targets.  This can cause races.
  It is also incompatible with the Xcode "new build system".

Fix this by introducing policy CMP0114 to change the way step target
dependencies are handled.  Define independence from external
dependencies as a property of each individual step regardless of whether
there is a target for it.  Add dependencies among the primary target and
the step targets such that each custom command only appears in one
target.  When some steps are disconnected from the primary target, add
step targets for the steps commonly depended upon so that there is a
place to hold their custom commands uniquely.

Fixes: #18663
2020-09-14 10:48:16 -04:00
Brad King
48ed3bae58 Merge topic 'pch-instantiate-templates'
8c8f03422e PCH: Template instantiation support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Tested-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5168
2020-09-10 16:32:39 -04:00
Deniz Bahadir
0a5c3e3b97 Help: add_library(<name> OBJECT) can omit the source files 2020-09-10 16:59:34 +02:00
Brad King
487c711230 Merge topic 'custom-command-dedup'
45fedf0e17 Makefile: Add policy CMP0113 to avoid duplication of custom commands
844779bdc1 cmMakefileTargetGenerator: Simplify custom command output collection

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5204
2020-09-10 10:12:30 -04:00
Brad King
45fedf0e17 Makefile: Add policy CMP0113 to avoid duplication of custom commands
Do not attach a custom command to a target if it is already attached to one of
the target's dependencies.  The command's output will be available by the time
the target needs it because the dependency containing the command will have
already been built.

This may break existing projects that do not properly mark non-created
outputs with the `SYMBOLIC` property.  Previously a chain of two custom
commands whose intermediate dependency is not created would put both
commands in a dependent project's Makefile even if the first command is
also in its dependency's Makefile.  The first command would run twice
but the build would work.  Now the second command needs an explicit
`SYMBOLIC` mark on its input to tell CMake that it is not expected to
exist.  To maintain compatibility with projects that left out the mark,
add a policy activating the behavior.
2020-09-08 15:38:40 -04:00
Marc Chevrier
be36266dab file(): Add REAL_PATH sub-command 2020-09-08 18:33:57 +02:00
Brad King
d0ccc7cf2a Merge topic 'ispc_improvements'
a020787a9b ISPC: Support generation for multiple instruction sets
5a1750017e ISPC: Add compiler launcher support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5173
2020-09-08 11:19:28 -04:00
Brad King
2b51cc5481 Help: Fix typo in cmake_path(CMAKE_PATH) command signature
Fix a typo accidentally added by commit eb583b0a66 (cmake_path command:
path management, 2020-07-23).  Remove a stray `]` character that breaks
the pygments lexer.
2020-09-08 10:38:47 -04:00
Marc Chevrier
eb583b0a66 cmake_path command: path management
Fixes: #19568, #20922
2020-09-06 10:52:25 +02:00
Robert Maynard
a020787a9b ISPC: Support generation for multiple instruction sets 2020-09-04 08:37:07 -04:00
Robert Maynard
5a1750017e ISPC: Add compiler launcher support 2020-09-03 11:46:11 -04:00
Kyle Edwards
5585e8575b Help: Add note about #pragma once 2020-09-03 09:30:27 -04:00
Tobias Hieta
8c8f03422e PCH: Template instantiation support
Adds PCH_INSTANTIATE_TEMPLATES target property for enabling template
instantiation in precompiled headers.
Enabled by default. Currently only supported for Clang 11 and newer.

Implements #21133.
2020-09-02 08:30:55 +02:00
Brad King
8f73ff0c37 Merge topic 'target_genex_dependency'
f14b390198 GenEx: Remove unneeded dependencies from target info queries

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Raul Tambre <raul@tambre.ee>
Merge-request: !5127
2020-09-01 09:59:08 -04:00
Craig Scott
3001e8b5d9 Merge topic 'xcode-link-phase-all'
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
dc0898205c Xcode: Add special case for file type extension map for .xcassets
7b3d8411a2 Xcode: Refactor build setting append code and attribute getter naming

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5036
2020-09-01 09:38:05 -04:00
Robert Maynard
f14b390198 GenEx: Remove unneeded dependencies from target info queries
Only generate a graph dependency between a custom command and
a target when the custom command queries for the file path
of an artifact of the target.

This makes generator expressions such as `TARGET_FILE_DIR`
behave the same way as `TARGET_PROPERTY` which never generated
a graph dependency.
2020-09-01 09:25:19 -04:00
Brad King
2d723e66f1 Merge topic 'cuda_host_compiler_fail'
01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection
9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5155
2020-09-01 09:20:23 -04:00
Brad King
f7fbe40513 Merge topic 'file_chmod'
7de60beddf file: Add CHMOD and CHMOD_RECURSE subcommands

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Marc Chevrier <marc.chevrier@gmail.com>
Merge-request: !5122
2020-09-01 09:19:18 -04:00
Brad King
f10682b796 Merge topic 'ispc_lang_support'
5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image
8976817d6d ISPC: Update help documentation to include ISPC
2368f46ba4 ISPC: Support building with the MSVC toolchain
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds
34cc6acc81 Add ISPC compiler support to CMake
419d70d490 Refactor some swift only logic to be re-used by other languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5065
2020-09-01 09:15:39 -04:00
Gusts Kaksis
525464ed2a Xcode: Use "Link Binary With Libraries" build phase in some cases
OBJECT and STATIC libraries (framework or non-framework) do not use
this build phase. Not all items to be linked use this build phase either.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2020-09-01 07:38:48 +10:00
Raul Tambre
a57beabb78 Help: Reference CMAKE_CUDA_COMPILER_ID not CMAKE_CUDA_COMPILER
We should refer to the compiler ID in the documentation to avoid users checking
compiler executable names, since that seems fragile.
2020-08-29 13:26:25 +03:00
Raul Tambre
01428c5560 CUDA: Fail fast if CMAKE_CUDA_ARCHITECTURES doesn't work during detection
Also re-ordered the code to avoid testing flags for other compilers, since
we know the vendor before full detection.
2020-08-29 13:06:45 +03:00
Raul Tambre
9f81aa0f69 CUDA: Fail if compiler detection using the host compiler fails
If an user specified a host compiler we should fail if we are unable to perform
compiler detection with it.
Previously we would try without and likely succeed and continue. Then we'd fail
during ABI detection and compiler testing since we'd still try to use it.

This is particularly problematic when crosscompiling since we extract the host
linker from the compiler detection link line. This would result in the wrong
host linker being used and a linking error due to architecture mismatch during
ABI detection where other necessary flags may already be present to make the
host compiler work. See #21076 for an example.

Fix this by adding CMAKE_<LANG>_COMPILER_ID_REQUIRE_SUCCESS to
CMakeDetermineCompilerId, which throws a fatal error if executing the compiler
results in a non-zero exit code.

Fixes #21120.
2020-08-29 13:06:44 +03:00
Robert Maynard
8976817d6d ISPC: Update help documentation to include ISPC 2020-08-28 11:21:31 -04:00
Robert Maynard
e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 2020-08-28 11:21:31 -04:00
Sibi Siddharthan
7de60beddf file: Add CHMOD and CHMOD_RECURSE subcommands
Fixes: #21057

Signed-off-by: Sibi Siddharthan <sibisiddharthan.github@gmail.com>
2020-08-26 21:22:50 +05:30
Brad King
efdd143459 Merge topic 'vs-win-sdk-custom-max'
ba497111f6 VS: Add option for custom Win10 SDK version maximum

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5150
2020-08-26 10:28:07 -04:00
jonathan molinatto
ba497111f6 VS: Add option for custom Win10 SDK version maximum
Since commit 83ddc4d289 (VS: Do not select a Windows SDK too high for
current VS version, 2017-08-07, v3.13.0-rc1~72^2~2) we enforce a maximum
SDK version for the VS 2015 generator.  The blog post linked in the
original commit is no longer available, but it can be seen here:

* https://web.archive.org/web/20190108032520/https://blogs.msdn.microsoft.com/chuckw/2018/10/02/windows-10-october-2018-update/

In particular, it states:

> VS 2015 Users: The Windows 10 SDK (15063, 16299, 17134, 17763)
> is officially only supported for VS 2017.

However, in some circumstances a higher version can be used.

Add a `CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION_MAXIMUM` to override the
generator's default maximum SDK version.

Fixes: #20633
2020-08-25 15:27:38 -04:00
Brad King
5e212cafba Merge topic 'osx_asm_architectures'
940fc62962 macOS: Respect OSX_ARCHITECTURES for ASM

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5152
2020-08-25 10:40:20 -04:00
Brad King
f035ddec4f Merge topic 'win32-executable-genex'
3ef0c40962 WIN32_EXECUTABLE: Add support for generator expressions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5146
2020-08-25 10:33:00 -04:00
Brad King
ea67dbc4cd Merge topic 'file_generate_target'
27a912193b file(GENERATE): Add TARGET argument

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5131
2020-08-25 10:31:02 -04:00
Brad King
0b0dc86eab Merge topic 'unk_imported_location'
359c500a24 cmTarget: Raise error if imported target location is not set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5113
2020-08-25 10:30:14 -04:00
Brad King
4294526504 Merge topic 'msvc_static_assert'
95bc11dbb4 MSVC: Record support for c_static_assert

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5148
2020-08-25 10:26:54 -04:00
Francisco Pombal
268fcc2782 Help: Separate C++ compile feature by standard
Additionally, mention that no fine-grained features are available for
C++ 17 and beyond.

Co-Authored-By: Craig Scott <craig.scott@crascit.com>
2020-08-23 13:49:40 +10:00
Raul Tambre
940fc62962 macOS: Respect OSX_ARCHITECTURES for ASM
Fixes #20771.
2020-08-22 09:16:21 +03:00
Kyle Edwards
3ef0c40962 WIN32_EXECUTABLE: Add support for generator expressions 2020-08-21 09:17:27 -04:00
Raul Tambre
359c500a24 cmTarget: Raise error if imported target location is not set
Previously we would synthesize <TARGET_NAME>-NOTFOUND as the location. This
would then end up on the link line and cause build failures.
Policy CMP0110 is added to control this behaviour.

Fixes #19080, #19943.
2020-08-21 08:38:39 -04:00
Raul Tambre
27a912193b file(GENERATE): Add TARGET argument
Adds TARGET argument to file(GENERATE) to make resolving generator expressions
requiring a target possible.

Implements #21101, fixes #21074.
2020-08-20 17:41:52 +03:00
Raul Tambre
95bc11dbb4 MSVC: Record support for c_static_assert
Supported since MSVC 19.28.29115 (VS 16.8.0 Preview 1.0).
2020-08-20 09:45:47 -04:00
Brad King
e05b200be2 Help/dev: Update CMake Review Process document to suggest 'git describe'
Using `git describe --contains` is the preferred way to reference a
commit relative to a tag.
2020-08-20 07:29:06 -04:00
Brad King
cb5c8e6f25 Merge topic 'cpack-wix-custom-xmlns'
267de3ba30 CPack/WiX: Add support for custom XML namespaces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5132
2020-08-19 11:48:24 -04:00
Brad King
5d77051a43 Merge topic 'buildsystem_documentation_update'
cfcb71c530 Help: Update cmake-buildsystem documentation

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5123
2020-08-19 11:45:38 -04:00
Brad King
2f5cb922f3 Merge topic 'fotran_module_vs_docs'
c5407b95f0 Help: Expand Fortran_MODULE_DIRECTORY documentation.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5128
2020-08-18 10:28:22 -04:00
Fritz Elfert
267de3ba30 CPack/WiX: Add support for custom XML namespaces
Add a `CPACK_WIX_CUSTOM_XMLNS` option to specify these.

Fixes: #21098
2020-08-18 07:50:49 -04:00
Joseph Snyder
cfcb71c530 Help: Update cmake-buildsystem documentation
Add additional information to the cmake-buildsystem manual:

* Add link to "Generator Expressions" in a place which demonstrates a
  generator expression without linking to what they are.
* Update "diagnostic message" for "Compatible Interface Properties" to
  contain an example of the message sent.
* Add information about the macOS FRAMEWORK_VERSION and how "A" is the
  conventional value to use.
2020-08-18 07:42:42 -04:00
Petr Kmoch
c5407b95f0 Help: Expand Fortran_MODULE_DIRECTORY documentation.
Document how Visual Studio generators append per-configuration directory
to path where Fortran modules are created.
2020-08-17 15:27:52 -04:00
Brad King
fe3a404a73 Merge topic 'add_test-special-chars-in-name'
a20987732b add_test: Allow special characters in test name (w/ policy CMP0110)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5076
2020-08-17 14:58:49 -04:00