summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.h
Commit message (Collapse)AuthorAgeFilesLines
* target_link_libraries: Place $<TARGET_OBJECTS> before librariesBrad King2021-05-291-0/+1
| | | | | | | | | Linkers always use object files explicitly specified on the command line regardless of where they appear. Move them to the front of the list of linked libraries in so that symbols required by the object files can be resolved by any library. Issue: #22149
* cmGeneratorTarget: Refactor link item lookupBrad King2021-05-281-3/+2
| | | | | Look up items individually so the call sites can do something with the result besides appending to a vector.
* Genex: Add TARGET_RUNTIME_DLLS genexKyle Edwards2021-02-241-0/+5
| | | | Co-Authored-by: Brad King <brad.king@kitware.com>
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-1/+2
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* cmGeneratorTarget: Make GetConfigCommonSourceFiles Xcode-specificBrad King2020-12-161-2/+3
| | | | | | The Xcode generator is the only place left that we do not support per-config sources. Make the corresponding helper Xcode-specific to avoid any other new uses.
* Compile with explicit language flag when source LANGUAGE property is setBrad King2020-12-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | This change was originally made by commit 74b1c9fc8e (Explicitly specify language flag when source LANGUAGE property is set, 2020-06-01, v3.19.0-rc1~722^2), but it was reverted by commit 30aa715fac (Revert "specify language flag when source LANGUAGE property is set", 2020-11-19) to restore compatibility with pre-3.19 behavior. Implement the change again, but add policy CMP0119 to make this change while preserving compatibility with existing projects. Note that the `Compiler/{Clang,Intel,MSVC}-CXX` modules do not need to specify `-TP` for their MSVC-like variants because we already use the flag in `CMAKE_CXX_COMPILE_OBJECT`. Similarly for `Compiler/XL-CXX` and `Platform/Windows-Embarcadero`. Note also that this does not seem possible to implement for XL C. Even with `-qsourcetype=c`, `xlc` complains about an unknown suffix: `1501-218 (W) file /.../AltExtC.zzz contains an incorrect file suffix`. It returns non-zero even with `-qsuppress=1501-218`. Co-Author: Robert Maynard <robert.maynard@kitware.com> Fixes: #14516, #20716
* Merge topic 'cuda_vs_skip_computation'Brad King2020-10-271-0/+2
|\ | | | | | | | | | | | | dd77dec18d VS: Don't compute CUDA options unless necessary Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5422
| * 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
* | Merge topic 'refactor-cmprop'Brad King2020-09-291-6/+6
|\ \ | | | | | | | | | | | | | | | | | | c88dde2869 cmGeneratorTarget: internal refactoring Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5289
| * | cmGeneratorTarget: internal refactoringvvs314152020-09-281-6/+6
| | |
* | | cmGeneratorTarget: Include Cache now occurs per language+configRobert Maynard2020-09-251-0/+2
|/ / | | | | | | | | Previously only occurred per config which broke per-language system includes.
* | OBJECT libraries: Properly recognize if sources depend on configurationDeniz Bahadir2020-09-231-1/+11
| | | | | | | | Fixes: #21198
* | cmGeneratorTarget: Better name for internal variableDeniz Bahadir2020-09-221-1/+1
| |
* | Merge topic 'ispc_improvements'Brad King2020-09-081-0/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | a020787a9b ISPC: Support generation for multiple instruction sets 5a1750017e ISPC: Add compiler launcher support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5173
| * | ISPC: Support generation for multiple instruction setsRobert Maynard2020-09-041-0/+9
| | |
* | | Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* | Merge topic 'ispc_lang_support'Brad King2020-09-011-0/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | ISPC: Support ISPC header generation byproducts and parallel buildsRobert Maynard2020-08-281-0/+8
| | |
* | | WIN32_EXECUTABLE: Add support for generator expressionsKyle Edwards2020-08-211-0/+3
| | |
* | | Add option to optimize link dependencies for static librariesKyle Edwards2020-08-121-0/+6
|/ / | | | | | | | | | | | | | | | | Add an `OPTIMIZE_DEPENDENCIES` target property and supporting `CMAKE_OPTIMIZE_DEPENDENCIES` variable to optionally enable pruning and flattening of outgoing dependencies from static libraries. Since they do not actually link, they only depend on side effects of their dependencies. Therefore we can drop dependencies that contribute no side effects.
* | Factor out generator checks for filtering on non-compiling targetsBrad King2020-07-231-0/+1
| | | | | | | | | | Add a `cmGeneratorTarget::CanCompileSources` helper method to tell generators whether a target might compile anything.
* | Factor out generator checks for filtering out interface librariesBrad King2020-07-231-0/+1
| | | | | | | | | | | | Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell generators whether a target should participate in the generated build system.
* | GetFeature(): return cmPropVitaly Stakhovsky2020-07-111-2/+2
| |
* | fileapi: Support multiple backtraces for language standardJustin Goshi2020-07-061-2/+2
| |
* | Add backtrace support for language standardJustin Goshi2020-06-221-1/+4
| |
* | cmGeneratorTarget: Clarify name of language property lookup helperJustin Goshi2020-06-221-2/+2
| |
* | Refactor language standard computationJustin Goshi2020-06-161-0/+17
|/ | | | | Instead of mutating the configure-time cmTarget's properties at generate time, compute and store it in a cmGeneratorTarget field.
* 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>