summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.h
Commit message (Collapse)AuthorAgeFilesLines
* VS: Don't compute CUDA options unless necessaryRaul Tambre2020-10-271-0/+2
| | | | | | | | | | | | | | | | | | In the following scenario (with 3.18 policies): 1. A CXX target is created. 2. CUDA language is enabled. CMake 3.18 introduced CMP0104, which requires CUDA_ARCHITECTURES to be set. Because the CXX target was created before CUDA was enabled it wouldn't have it set. The Visual Studio generator would however end up computing CUDA compile options for the CXX target, which would result in a fatal error due to the policy violation. There doesn't seem to be a reason to do this for targets that don't actually use the CUDA language, so we can skip and generate the CXX target just fine. Fixes: #21341
* CUDA: Pass toolkit path to ClangRaul Tambre2020-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Clang isn't very good at finding the installed CUDA toolkit. The upstream recommendation is that we should pass the toolkit explicitly. Additionally: * Avoids Clang having to search for the toolkit on every invocation. * Allows the user to use a toolkit from a non-standard location by simply setting CUDAToolkit_ROOT. The same way as with FindCUDAToolkit. Clang wants the directory containing the device library and version.txt as the toolkit path. We thus pass the newly introduced CUDAToolkit_LIBRARY_ROOT as the toolkit path. We save CUDAToolkit_ROOT_DIR and CUDAToolkit_LIBRARY_ROOT on Clang to have them available in try_compile() and avoid unnecessary re-searching or a possibly different installation being found in FindCUDAToolkit. This however means that the selected toolkit can't be changed after the initial language enablement. We now determine CUDA compiler ID before doing actual detection, as we don't want to spend time finding the CUDA toolkit for NVIDIA. Implements #20754.
* cmGeneratorTarget: fix misplaced headerVitaly Stakhovsky2020-06-081-2/+1
| | | | | | In commit b36d1bdd9d (Single location for cmProp typedef, 2020-05-30) we accidentally left inclusion of `cmProperty.h` out of the main block of includes.
* Single location for cmProp typedefVitaly Stakhovsky2020-06-011-1/+1
|
* CUDA: Factor runtime library lookup into helper methodBrad King2020-05-221-0/+3
|
* cmVisualStudio10TargetGenerator: Adopt Windows Store and Phone infrastructureBrad King2020-05-181-17/+3
| | | | | Move support for Resx, Xaml, Certificate, and AppManifest file handling out of cmGeneratorTarget.
* cmGeneratorTarget: Remove default config from Get* methodsBrad King2020-05-181-9/+8
| | | | Ensure all call sites pass an explicit configuration.
* cmGeneratorTarget: Track when the set of link libs is config-dependentBrad King2020-05-121-0/+1
| | | | | | | 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.
* GetSafeProperty: return std::string const&Vitaly Stakhovsky2020-04-301-1/+1
|
* cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-1/+3
|
* Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK>Marc Chevrier2020-04-191-0/+19
| | | | | | 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.
* CUDA: Add CUDA_ARCHITECTURES target propertyRaul Tambre2020-04-151-0/+2
| | | | | | | | | | | 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.
* PCH: Add support for multi architecture iOS projectsCristian Adam2020-04-021-7/+13
| | | | Fixes: #20497
* Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>Alexandru Croitor2020-03-041-0/+3
|
* Genex: Add $<LINK_LANGUAGE:...> and $<LINK_LANG_AND_ID:...>Marc Chevrier2020-02-261-5/+22
| | | | | | This MR may help to solve issues #19757 and #18008 Fixes: #19965
* Ninja Multi-Config: Fix issue with framework dependencies and AutogenKyle Edwards2020-02-171-1/+1
| | | | Fixes: #20345
* Source: use std::string in place of const char*Vitaly Stakhovsky2020-01-291-3/+3
|
* macOS: Add OSX_COMPATIBILITY_VERSION and OSX_CURRENT_VERSION propertiesIsuru Fernando2020-01-241-2/+10
| | | | Fixes: #17652
* target_link_libraries: Fix out-of-dir linking of a list of targetsBrad King2020-01-161-0/+8
| | | | | | | | | | | | | | 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
* Add set_property option: DEPRECATIONJoseph Snyder2020-01-021-0/+7
| | | | | | | | | | | | 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-0/+1
| | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* Link properties: must be transitive over private dependency on static libraryMarc Chevrier2019-12-091-2/+4
| | | | Fixes: #20022
* Merge topic 'unity-HEADER_FILE_ONLY'Brad King2019-11-121-1/+8
|\ | | | | | | | | | | | | 9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4023
| * Unity: Don't include sources with HEADER_FILE_ONLY property setCristian Adam2019-11-111-1/+8
| | | | | | | | | | | | Fixes: #19946 Fixes: #19947 Co-authored-by: Craig Scott <craig.scott@crascit.com>
* | Merge topic 'modernize-memory-management'Kyle Edwards2019-11-061-10/+14
|\ \ | | | | | | | | | | | | | | | | | | 2a67ebf71b cmGeneratorTarget: modernize memory management Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3997
| * | cmGeneratorTarget: modernize memory managementMarc Chevrier2019-11-051-10/+14
| | |
* | | INSTALL_NAME_DIR: Add support for generator expressionsKyle Edwards2019-11-041-1/+2
|/ /
* | cmGeneratorTarget: Add GetAllConfigCompileLanguages methodBrad King2019-10-171-0/+4
| | | | | | | | | | Return all languages needed to compile sources in the target in any configuration.
* | cmGeneratorTarget: Return non-const sources from GetAllConfigSourcesBrad King2019-10-171-1/+1
|/ | | | | We need a non-const pointer to `cmSourceFile` instances in order to call `GetOrDetermineLanguage` on them.
* PCH: Generate sources during Compute stepCristian Adam2019-10-091-0/+9
|
* Revise include order using clang-format-6.0Kitware Robot2019-10-011-5/+5
| | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* Precompile Headers: Add REUSE_FROM signatureCristian Adam2019-09-171-0/+3
| | | | | | | Add the ability to share precompiled headers artifacts between targets. Fixes: #19659
* clang-tidy: modernize-deprecated-headersRegina Pfeifer2019-09-161-1/+1
|
* clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-14/+14
| | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-0/+5
| | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* PCH: add PRECOMPILE_HEADERS to special propertiesDaniel Pfeifer2019-08-261-0/+7
|
* Genex: Memoize usage requirement TARGET_PROPERTY existenceBrad King2019-07-231-0/+5
| | | | | | | | | | | | | | | For each usage requirement (such as `INTERFACE_COMPILE_DEFINITIONS` or `INTERFACE_INCLUDE_DIRECTORIES`), the value of the generator expression `$<TARGET_PROPERTY:target,prop>` includes the values of the same property from the transitive closure of link libraries of the target. In cases that a target's transitive closure of dependencies does not depend on the target being linked (the "head" target), we can memoize whether or not a usage requirement property exists at all for that target. When a usage requirement does not exist for a target, we can skip evaluating it for every consuming target. Fixes: #18964, #18965
* Genex: Optimize usage requirement TARGET_PROPERTY recursionBrad King2019-07-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In large projects the generation process spends a lot of time evaluating usage requirements through transitive interface properties on targets. This can be seen in a contrived example with deep dependencies: set(prev "") foreach(i RANGE 1 500) add_library(a${i} a.c) target_compile_definitions(a${i} PUBLIC A${i}) target_link_libraries(a${i} PUBLIC ${prev}) set(prev a${i}) endforeach() For each usage requirement (such as `INTERFACE_COMPILE_DEFINITIONS` or `INTERFACE_INCLUDE_DIRECTORIES`), the value of the generator expression `$<TARGET_PROPERTY:target,prop>` includes the values of the same property from the transitive closure of link libraries of the target. Previously we computed this by constructing a generator expression string like `$<TARGET_PROPERTY:lib,INTERFACE_COMPILE_DEFINITIONS>` and recursively evaluating it with the generator expression engine. Avoid the string construction and parsing by creating and using a dedicated evaluation method `cmGeneratorTarget::EvaluateInterfaceProperty` that looks up the properties directly. Issue: #18964, #18965
* De-duplicate checks for whether a platform uses Windows DLLsBrad King2019-07-121-1/+0
|
* Refactor checks for whether a target has an import libraryBrad King2019-07-121-2/+6
| | | | Use `HasImportLibrary` for such checks.
* BUILD_RPATH/INSTALL_RPATH: Add generator expression supportKyle Edwards2019-06-251-1/+7
| | | | Fixes: #19423
* Refactor: introduce method cmGeneratorTarget::GetFilePostfixMarc Chevrier2019-05-021-0/+3
|
* Refactor: Add new methods to retrieve prefix and suffixMarc Chevrier2019-04-101-0/+14
|
* Genex: Add capability to retrieve base name for various target artifactsMarc Chevrier2019-04-081-0/+3
| | | | This new capability is required to solve efficiently issue #18771
* Fix invalid ///! doxygen comment line startsSebastian Holtermann2019-03-311-3/+3
| | | | | In various places `///!` was used to start a comment line. This is not valid Doygen syntax. This patch replaces `///!` comment starts with `//!`.
* Create and use `cmGeneratorTarget::Names`Saleem Abdulrasool2019-02-111-6/+12
| | | | | | Rather than taking a number of out parameters for the various names, create a structure that is reused for both `GetLibraryNames` and `GetExecutableNames`. Replace uses according to the new interface.
* clang-tidy: Use `= delete`Regina Pfeifer2019-01-291-2/+3
|
* cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-5/+0
|
* clang-tidy: Use `= default`Regina Pfeifer2019-01-251-5/+5
| | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* cmTarget,cmGeneratorTarget: Add optional `before` parameter to AddSourceSebastian Holtermann2019-01-181-2/+2
| | | | | | The new optional `before` parameter in `cmTarget::AddSource` and `cmGeneratorTarget::AddSource` allows to prepend a source file to the sources list instead of appending it.