1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-17 01:12:07 +08:00

604 Commits

Author SHA1 Message Date
Vitaly Stakhovsky
53675adbcf GetSafeProperty: return std::string const& 2020-04-30 10:27:16 -04:00
Vitaly Stakhovsky
36aba01223 cmGeneratorTarget::GetProperty: return cmProp 2020-04-29 10:59:39 -04:00
Marc Chevrier
4248bb452a CUDA: Device linking use now link options
properties LINK_OPTIONS and INTERFACE_LINK_OPTIONS are propagated
to the device link step.

To control which options are selected for normal link and device link steps,
the $<DEVICE_LINK> and $<HOST_LINK> generator expressions can be used.

Fixes: #18265
2020-04-19 15:53:11 +02:00
Marc Chevrier
3fdae5acaa Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>
These generator expressions can only be used in link options properties.
These expressions return the arguments respectively for device and host link
step, otherwise return an empty string.
2020-04-19 15:04:54 +02:00
Marc Chevrier
aacd4e4a90 Refactoring: add cm::contains to <cmext/algorithm> 2020-04-17 10:00:03 +02:00
Brad King
7e8df1bb24 Merge topic 'cuda_architectures'
21131ca60c CUDA: Add CudaOnly.CompileFlags test
f0931b0790 CUDA: Convert tests to use CUDA_ARCHITECTURES
e98588aaba CUDA: Add CUDA_ARCHITECTURES target property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Patrick Stotko <stotko@cs.uni-bonn.de>
Merge-request: !4568
2020-04-16 11:11:33 -04:00
Raul Tambre
e98588aaba CUDA: Add CUDA_ARCHITECTURES target property
Simplifies CUDA target architecture handling.

Required for Clang support as Clang doesn't automatically select a supported architecture.
We detect a supported architecture during compiler identification and set CMAKE_CUDA_ARCHITECTURES to it.

Introduces CMP0104 for backwards compatibility with manually setting code generation flags with NVCC.

Implements #17963.
2020-04-15 17:55:41 +03:00
Vitaly Stakhovsky
e64fa5f1b6 cmSourceFile::GetProperty: return cmProp 2020-04-14 10:57:17 -04:00
Ben Boeckel
f2a33107be clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with
other conditionals between cloned blocks may be relying on the
intermediate logic to fall out of the case and inverting this logic may
be non-trivial.

See: https://bugs.llvm.org/show_bug.cgi?id=44165
2020-04-13 11:26:02 -04:00
Brad King
f4e4b41a19 Merge topic 'pch-ios-multi-arch'
f593b354da PCH: Add support for multi architecture iOS projects

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4561
2020-04-03 07:05:11 -04:00
Cristian Adam
f593b354da PCH: Add support for multi architecture iOS projects
Fixes: #20497
2020-04-02 11:51:19 -04:00
Vitaly Stakhovsky
3eec21a01c cmTarget::GetProperty: return cmProp 2020-03-30 15:00:14 -04:00
Brad King
f670435715 Merge topic 'pch-warn-invalid'
2ce08e5489 PCH: add an option to disable `-Winvalid-pch`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4499
2020-03-27 08:03:30 -04:00
Cristian Adam
2ce08e5489 PCH: add an option to disable -Winvalid-pch
Fixes: #20295
2020-03-26 14:24:46 +01:00
Rolf Eike Beer
48adc29721 replace "std::string::find(x) == 0" with cmHasPrefix() 2020-03-23 22:41:43 +01:00
Vitaly Stakhovsky
b915fec56e cmTarget: minor code improvements 2020-03-17 08:33:57 -04:00
Vitaly Stakhovsky
fad0ee5404 cmTargetPropertyComputer::GetProperty: return cmProp 2020-03-16 13:47:05 -04:00
Saleem Abdulrasool
2026915f8f Swift: Propagate Swift_MODULE_DIRECTORY as include directory
Teach include directory computation for Swift to implicitly propagate
the `Swift_MODULE_DIRECTORY` of all linked targets as include
directories.  This is required to ensure that the swiftmodule of a
linked target is accessible to the compiler of the current target.

Fixes: #19272
2020-03-12 11:50:43 -04:00
Alexandru Croitor
ad3f69c86e Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG> 2020-03-04 14:30:54 +01:00
Brad King
2a9cf88917 Merge topic 'Genex-LINK_LANGUAGE'
461efa7b51 Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...>

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4244
2020-02-27 11:18:28 -05:00
Brad King
2b0c6c69c9 Merge topic 'pch-file-time'
7e9b9fe918 PCH: Copy the timestamp from an absolute header file

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4400
2020-02-27 08:48:49 -05:00
Marc Chevrier
461efa7b51 Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...>
This MR may help to solve issues #19757 and #18008

Fixes: #19965
2020-02-26 16:38:42 +01:00
Cristian Adam
7e9b9fe918 PCH: Copy the timestamp from an absolute header file
If `target_precompile_headers` contains a file from the project,
then CMake will set the timestamp for `cmake_pch.h|xx` from that
file.

This helps with ccache and precompile headers.

Fixes: #19923
2020-02-26 10:05:47 -05:00
Kyle Edwards
7abc3d61ac Ninja Multi-Config: Fix issue with framework dependencies and Autogen
Fixes: #20345
2020-02-17 08:24:57 -05:00
Vitaly Stakhovsky
bbc07e4561 Source: use std::string in place of const char* 2020-01-29 14:31:01 -05:00
Isuru Fernando
4a62e3d97c macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION properties
Fixes: #17652
2020-01-24 14:13:41 -05:00
Brad King
941c09616b Merge topic 'multi-ninja-pch'
a55df20499 Multi-Ninja: Add precompile headers support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4201
2020-01-20 11:59:28 -05:00
Brad King
9b9dfacaa5 Merge topic 'acc-fix-in-source-depends-path'
ba3a417dce Tests/CustomCommand: add a test for depending on a `./path`
e23475dc73 Tests/CustomCommand: fix custom command line to actually make its output
db4780d584 cmGeneratorTarget: search for relative paths to the binary directory
ec479f101f cmLocalGenerator: collapse the path after construction
fd0ba705ce add_custom_command: check if a relative path should be an in-source path
fd84f510f8 cmLocalGenerator: simplify the current source dir query

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4195
2020-01-20 11:52:00 -05:00
Cristian Adam
a55df20499 Multi-Ninja: Add precompile headers support
Fixes: #19789
2020-01-17 23:17:35 +01:00
Brad King
a7fca06c46 Merge topic 'out-of-dir-link-list'
f0e67da061 target_link_libraries: Fix out-of-dir linking of a list of targets
acee629103 cmTargetLinkLibrariesCommand: Move HandleLibrary to helper struct
ba675f1ecc Tests: Enable CMP0022 in ExportImport out-of-dir linking case

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4226
2020-01-17 09:41:10 -05:00
Ben Boeckel
db4780d584 cmGeneratorTarget: search for relative paths to the binary directory
Dependencies in the form `./somepath.txt` are not found otherwise
because we only match on last-path-component searches and `.` never
shows up in a full path as a full component.
2020-01-16 13:56:30 -05:00
Brad King
f0e67da061 target_link_libraries: Fix out-of-dir linking of a list of targets
In a case like

    target_link_libraries(targetInOtherDir PUBLIC "$<1:a;b>")

then all entries in the list need to be looked up in the caller's
scope.  Previously our `::@(directory-id)` suffix would apply only
to the last entry.  Instead surround the entire entry by a pair
`::@(directory-id);...;::@` so that the `::@` syntax can encode
a directory lookup scope change evaluated as the list is processed.

Fixes: #20204
2020-01-16 13:24:27 -05:00
Brad King
601af8f2b4 Merge topic 'avoid-getcwd'
22f38c0d6b cmake: avoid getcwd in `CollapseFullPath`

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4218
2020-01-15 13:32:52 -05:00
Tim Blechmann
22f38c0d6b cmake: avoid getcwd in CollapseFullPath
`CollapseFullPath` calls getcwd, which is a rather expensive system
call. we can replace it with `GetHomeOutputDirectory()` to save us from
the calling overhead
2020-01-14 18:20:39 +08:00
Marc Chevrier
a8aa89352a clang-format: fix erroneous handling of header <queue>
The rule Regex: '^<' was not applied to this header because a more specific one applies: Regex: '^(<|")Qt?[A-Z]' used for Qt headers (rules are not case-sensitive). So adding a specific rule for this header before the Qt rule is required.
2020-01-06 17:33:45 +01:00
Joseph Snyder
c621839bd9 Add set_property option: DEPRECATION
Add a new property flag for a target which contains a message regarding
deprecation status.

Add a warning at "Generate" time if a linked target is marked as
deprecated.

Expand ExportImport test to ensure that new property is being set and
passed correctly.  Ensure that the message is shown during the
"Generate" step run of the ExportImport test.
2020-01-02 17:11:31 -05:00
Kyle Edwards
5a8a9f7229 Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
2019-12-13 10:51:46 -05:00
Marc Chevrier
af9d4f24ae Link properties: must be transitive over private dependency on static library
Ensure transitivity over multiple static libraries.

Fixes: bbba701899 (Link properties: must be transitive over private dependency on static library, 2019-12-06)
2019-12-12 18:02:32 +01:00
Brad King
b358f1827c Merge topic 'link-options-propagation'
bbba701899 Link properties: must be transitive over private dependency on static library

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4120
2019-12-09 11:32:05 -05:00
Marc Chevrier
bbba701899 Link properties: must be transitive over private dependency on static library
Fixes: #20022
2019-12-09 11:29:36 -05:00
Isuru Fernando
5ff1d7bd90 Add support for WINDOWS_EXPORT_ALL_SYMBOLS when cross-compiling to Windows
Implement `__create_def` using `llvm-nm` (when given as `CMAKE_NM`).
2019-12-06 09:30:25 -05:00
Brad King
e14c9af013 Merge topic 'pch-reuse-no-prop'
bb4c2781ce PCH: Do not issue an error on duplicate target_precompile_headers call

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4046
2019-11-18 09:46:26 -05:00
Cristian Adam
bb4c2781ce PCH: Do not issue an error on duplicate target_precompile_headers call
Fixes: #19970
2019-11-15 09:47:56 -05:00
Brad King
5b46bc3194 Merge topic 'unity-HEADER_FILE_ONLY'
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
2019-11-12 09:51:16 -05:00
Brad King
eae743bf17 Merge topic 'unity-HEADER_FILE_ONLY' into release-3.16
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
2019-11-12 09:51:15 -05:00
Craig Scott
9a935adca9 Merge topic 'pch-no-duplicates'
e01935ac9d PCH: No repeated path for internal generated PCH files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4030
2019-11-12 08:28:46 -05:00
Cristian Adam
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set
Fixes: #19946
Fixes: #19947
Co-authored-by: Craig Scott <craig.scott@crascit.com>
2019-11-11 14:10:18 +01:00
Cristian Adam
e01935ac9d PCH: No repeated path for internal generated PCH files
Fixes: #19952
2019-11-11 13:21:12 +01:00
Kyle Edwards
954bb6549b Merge topic 'modernize-memory-management'
2a67ebf71b cmGeneratorTarget: modernize memory management

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3997
2019-11-06 16:38:34 -05:00
Brad King
ce7408514c Merge topic 'install-name-dir-genex'
a0e2e0ca97 Help: Add documentation and release notes for INSTALL_NAME_DIR genex
deeab72aae Tests: Add tests for INSTALL_NAME_DIR
3c85f11fed INSTALL_NAME_DIR: Add support for generator expressions
2ec1156b80 Refactor: Generalize cmExportInstallFileGenerator::ReplaceInstallPrefix()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3989
2019-11-06 09:32:22 -05:00