summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmGeneratorTarget: Remove default config from Get* methodsBrad King2020-05-181-1/+2
| | | | Ensure all call sites pass an explicit configuration.
* Merge topic 'cuda-clang'Brad King2020-05-181-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | a653ca9504 Tests: Update CUDA tests to work with Clang 5df21adf46 CUDA: Add support for Clang compiler dc2eae1f91 FindCUDAToolkit: Factor out discovery code into a separate file 70be10cbf4 CUDA: Remove toolkit include dirs from implicit include dirs only with NVIDIA Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Artem Belevich <tra@google.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Acked-by: Axel Huebl <axel.huebl@plasma.ninja> Acked-by: friendnick <ikoval67@gmail.com> Acked-by: Patrik Huber <patrikhuber@gmail.com> Merge-request: !4442
| * CUDA: Add support for Clang compilerRaul Tambre2020-05-151-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When crosscompiling we pass the sysroot. We need to try various architecture flags. Clang doesn't automatically select one that works. First try the ones that are more likely to work for modern installations: * <=sm_50 is deprecated since CUDA 10.2, try sm_52 first for future compatibility. * <=sm_20 is removed since CUDA 9.0, try sm_30. Otherwise fallback to Clang's current default. Currently that's `sm_20`, the lowest it supports. Separable compilation isn't supported yet. Fixes: #16586
* | Merge topic 'fix-ClearSourcesCache'Brad King2020-05-181-0/+1
|\ \ | |/ |/| | | | | | | | | a9f4f58f0c cmGeneratorTarget: Clear AllConfigSources in ClearSourcesCache Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4751
| * cmGeneratorTarget: Clear AllConfigSources in ClearSourcesCacheBrad King2020-05-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | In commit 40aa6c059c (cmGeneratorTarget: Add method to collect all sources for all configs, 2017-04-10, v3.9.0-rc1~268^2~5) we forgot to update `ClearSourcesCache` to also clear `AllConfigSources`. This leads to subtle cases where code paths like PCH handling that add sources during generation break depending on ordering. Suggested-by: Christian Fersch Fixes: #20712, #20702
* | INTERFACE_SOURCES: Fix per-config link libs on multi-config generatorsBrad King2020-05-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In multi-config generators we memoize the computed set of source files for a target to avoid repeating the computation when the set does not depend on the configuration. We already track whether generator expressions in `SOURCES` or `INTERFACE_SOURCES` reference the configuration (`$<CONFIG:...>`). However, we previously forgot to track whether the set of libraries whose `INTERFACE_SOURCES` are considered depends on the configuration. This caused multi-config generators to use the first configuration's set of sources for all configurations in cases such as target_link_libraries(tgt PRIVATE $<$<CONFIG:Debug>:iface_debug>) where the `iface_debug` target has `INTERFACE_SOURCES`. Fix this by also tracking config-dependence of the list of libraries for evaluation of the list of source files. Fixes: #20683
* | cmGeneratorTarget: Factor evaluated target prop entries into structBrad King2020-05-121-57/+54
| | | | | | | | This will allow storing more than just the list of entries itself.
* | cmGeneratorTarget: Track when the set of link libs is config-dependentBrad King2020-05-121-0/+9
| | | | | | | | | | | | | | Report in `cmLinkImplementationLibraries` and `cmLinkInterfaceLibraries` whether the list of libraries depends on a genex referencing the configuration. We already track whether a genex references the head target.
* | Merge topic 'stdstring-getsafeprop'Brad King2020-05-011-5/+8
|\ \ | | | | | | | | | | | | | | | | | | 53675adbcf GetSafeProperty: return std::string const& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4683
| * | GetSafeProperty: return std::string const&Vitaly Stakhovsky2020-04-301-5/+8
| | |
* | | Merge topic 'stl-support'Brad King2020-05-011-2/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 8d4a9ee398 Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view> Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4689
| * | Refactoring: rename "cm_static_string_view.hxx" as <cmext/string_view>Marc Chevrier2020-04-301-2/+1
| | |
* | | cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-194/+193
|/ /
* | CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-62/+152
| | | | | | | | | | | | | | | | | | | | 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
* | Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>Marc Chevrier2020-04-191-10/+14
| | | | | | | | | | | | 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.
* | Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-16/+18
| |
* | Merge topic 'cuda_architectures'Brad King2020-04-161-0/+89
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | CUDA: Add CUDA_ARCHITECTURES target propertyRaul Tambre2020-04-151-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | cmSourceFile::GetProperty: return cmPropVitaly Stakhovsky2020-04-141-6/+6
|/ /
* | clang-tidy: address bugprone-branch-clone lintsBen Boeckel2020-04-131-3/+5
| | | | | | | | | | | | | | | | | | 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
* | Merge topic 'pch-ios-multi-arch'Brad King2020-04-031-27/+41
|\ \ | | | | | | | | | | | | | | | | | | f593b354da PCH: Add support for multi architecture iOS projects Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4561
| * | PCH: Add support for multi architecture iOS projectsCristian Adam2020-04-021-27/+41
| | | | | | | | | | | | Fixes: #20497
* | | cmTarget::GetProperty: return cmPropVitaly Stakhovsky2020-03-301-6/+7
|/ /
* | Merge topic 'pch-warn-invalid'Brad King2020-03-271-2/+16
|\ \ | | | | | | | | | | | | | | | | | | 2ce08e5489 PCH: add an option to disable `-Winvalid-pch` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4499
| * | PCH: add an option to disable `-Winvalid-pch`Cristian Adam2020-03-261-2/+16
| | | | | | | | | | | | Fixes: #20295
* | | replace "std::string::find(x) == 0" with cmHasPrefix()Rolf Eike Beer2020-03-231-2/+2
| | |
* | | cmTarget: minor code improvementsVitaly Stakhovsky2020-03-171-1/+1
|/ /
* | cmTargetPropertyComputer::GetProperty: return cmPropVitaly Stakhovsky2020-03-161-4/+4
| |
* | Swift: Propagate Swift_MODULE_DIRECTORY as include directorySaleem Abdulrasool2020-03-121-0/+84
| | | | | | | | | | | | | | | | | | 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
* | Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>Alexandru Croitor2020-03-041-4/+40
| |
* | Merge topic 'Genex-LINK_LANGUAGE'Brad King2020-02-271-34/+130
|\ \ | | | | | | | | | | | | | | | | | | 461efa7b51 Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...> Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4244
| * | Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...>Marc Chevrier2020-02-261-34/+130
| | | | | | | | | | | | | | | | | | This MR may help to solve issues #19757 and #18008 Fixes: #19965
* | | Merge topic 'pch-file-time'Brad King2020-02-271-0/+13
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 7e9b9fe918 PCH: Copy the timestamp from an absolute header file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4400
| * | PCH: Copy the timestamp from an absolute header fileCristian Adam2020-02-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Ninja Multi-Config: Fix issue with framework dependencies and AutogenKyle Edwards2020-02-171-14/+17
|/ / | | | | | | Fixes: #20345
* | Source: use std::string in place of const char*Vitaly Stakhovsky2020-01-291-10/+12
| |
* | macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION propertiesIsuru Fernando2020-01-241-6/+16
| | | | | | | | Fixes: #17652
* | Merge topic 'multi-ninja-pch'Brad King2020-01-201-2/+9
|\ \ | | | | | | | | | | | | | | | | | | a55df20499 Multi-Ninja: Add precompile headers support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4201
| * | Multi-Ninja: Add precompile headers supportCristian Adam2020-01-171-2/+9
| | | | | | | | | | | | Fixes: #19789
* | | Merge topic 'acc-fix-in-source-depends-path'Brad King2020-01-201-0/+11
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | cmGeneratorTarget: search for relative paths to the binary directoryBen Boeckel2020-01-161-0/+11
| |/ / | | | | | | | | | | | | | | | 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.
* | | Merge topic 'out-of-dir-link-list'Brad King2020-01-171-31/+46
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 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
| * | target_link_libraries: Fix out-of-dir linking of a list of targetsBrad King2020-01-161-31/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge topic 'avoid-getcwd'Brad King2020-01-151-1/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | 22f38c0d6b cmake: avoid getcwd in `CollapseFullPath` Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4218
| * | cmake: avoid getcwd in `CollapseFullPath`Tim Blechmann2020-01-141-1/+2
| | | | | | | | | | | | | | | | | | `CollapseFullPath` calls getcwd, which is a rather expensive system call. we can replace it with `GetHomeOutputDirectory()` to save us from the calling overhead
* | | clang-format: fix erroneous handling of header <queue>Marc Chevrier2020-01-061-2/+1
| | | | | | | | | | | | 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.
* | | Add set_property option: DEPRECATIONJoseph Snyder2020-01-021-0/+28
|/ / | | | | | | | | | | | | | | | | | | | | | | 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.
* | Ninja: Add multi-config variantKyle Edwards2019-12-131-4/+6
| | | | | | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* | Link properties: must be transitive over private dependency on static libraryMarc Chevrier2019-12-121-2/+2
| | | | | | | | | | | | Ensure transitivity over multiple static libraries. Fixes: bbba701899 (Link properties: must be transitive over private dependency on static library, 2019-12-06)
* | Merge topic 'link-options-propagation'Brad King2019-12-091-14/+22
|\ \ | | | | | | | | | | | | | | | | | | bbba701899 Link properties: must be transitive over private dependency on static library Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4120