summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Genex: Add TARGET_RUNTIME_DLLS genexKyle Edwards2021-02-241-0/+14
| | | | Co-Authored-by: Brad King <brad.king@kitware.com>
* Genex: LINK_LANGUAGE respects LINKER_LANGUAGE propertyMarc Chevrier2021-02-231-1/+5
| | | | | | | If target property LINKER_LANGUAGE is set, LINK_LANGUAGE generator expression evaluation must be always successful. This fix can be helpful to elaborate a solution for issue #21818.
* AIX: Enable XCOFF editing to replace RPATH on installationBrad King2021-02-031-9/+18
| | | | Avoid relinking before installation.
* Ninja Multi-Config: Enable relink diagnostic messageBrad King2021-02-031-2/+1
| | | | | We already have a message for the "Ninja" generator, but it applies to the "Ninja Multi-Config" generator too.
* Rename CMAKE_USE_ELF_PARSER to CMake_USE_ELF_PARSERBrad King2021-02-031-1/+1
| | | | We use the `CMake_` prefix for options affecting CMake itself.
* Merge topic 'clang-tidy-fixes'Brad King2021-01-271-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | ef935b17ab clang-tidy: fix `readability-use-anyofallof` warnings 9ac8dbbb94 clang-tidy: fix `readability-simplify-boolean-expr` warnings ca505718f4 clang-tidy: fix `readability-redundant-string-init` warnings b3b6ede6a1 clang-tidy: fix `readability-redundant-access-specifiers` warnings cdfc4e3195 clang-tidy: fix `readability-qualified-auto` warnings 808b17b120 clang-tidy: fix `readability-make-member-function-const` warnings 4470eb5179 clang-tidy: fix `performance-trivially-destructible` warnings 4f396e6528 clang-tidy: fix `performance-no-automatic-move` warnings ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5731
| * clang-tidy: fix `readability-qualified-auto` warningsBen Boeckel2021-01-271-2/+2
| |
* | OUTPUT_DIRECTORY: Support tgt genex in output artifact varsAsit Dhal2021-01-261-4/+3
|/ | | | | | | | | Following variables now support target dependent generator expressions. - CMAKE_RUNTIME_OUTPUT_DIRECTORY - CMAKE_LIBRARY_OUTPUT_DIRECTORY - CMAKE_ARCHIVE_OUTPUT_DIRECTORY Fixes: #18055
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-5/+5
| | | | | 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-1/+1
| | | | | | 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.
* Ninja Multi-Config: Add support for cross-config custom commandsKyle Edwards2020-12-151-1/+1
| | | | Co-Author: Brad King <brad.king@kitware.com>
* cmLocalGenerator: Refactor custom command generator constructionBrad King2020-12-151-7/+8
| | | | | | | Add support for constructing and using multiple generators for one custom command. cmGeneratorTarget contains a code path that needs this behavior when used with Ninja but not other generators, so use virtual dispatch through cmLocalGenerator.
* Merge topic 'correct_ispc_path_computation'Brad King2020-12-081-1/+6
|\ | | | | | | | | | | | | | | 9af93fef11 ISPC: Handle OBJECT sources in different directories 72ae15ebcb ISPC: Ninja properly compute ISPC_HEADER_DIRECTORY location Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5581
| * ISPC: Handle OBJECT sources in different directoriesRobert Maynard2020-12-071-1/+6
| |
| * Merge topic 'cuda_vs_skip_computation' into release-3.19Brad King2020-10-271-0/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | dd77dec18d VS: Don't compute CUDA options unless necessary e9109dec36 Merge branch 'ninja-multi-per-config-sources' into release-3.18 7c0de4175b Merge branch 'cmake-E-cat-binary' into release-3.18 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5422
* | | Compile with explicit language flag when source LANGUAGE property is setBrad King2020-12-021-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Reduce the scope of temporary cmProp variables and other improvementsVitaly Stakhovsky2020-11-051-3/+2
| | |
* | | cmGeneratorTarget: Refactor custom command dependency evaluationBrad King2020-10-291-64/+15
| | | | | | | | | | | | | | | | | | Previously we only used cmCustomCommandGenerator to evaluate generator expressions for dependencies. Use it for command lines too. It also collects target references for us, with backtraces.
* | | Merge topic 'cuda_vs_skip_computation'Brad King2020-10-271-0/+8
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 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/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'per-config-source-TARGET_FILE'Brad King2020-10-261-6/+11
|\ \ \ | | |/ | |/| | | | | | | | | | | | | cd33bfcad5 add_custom_command: Properly recognize if sources depend on config Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5410
| * | add_custom_command: Properly recognize if sources depend on configDeniz Bahadir2020-10-221-6/+11
| | | | | | | | | | | | Fixes: #21349
* | | Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-3/+3
| | |
* | | CMP0115: Require source file extensions to be explicitKyle Edwards2020-10-131-2/+6
| | |
* | | cmLocalGenerator: Migrate custom command output lookup from cmMakefileBrad King2020-10-081-2/+3
|/ / | | | | | | | | | | | | Since commit 777ceaea94 (cmMakefile: Delay custom command creation, 2019-10-17, v3.17.0-rc1~352^2) we process custom command declarations at generate time. Therefore we do not need to look up what source file holds the custom command producing a given output until generate time.
* | Merge topic 'macos-arm64'Brad King2020-10-011-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | b6c60f14b6 macOS: Default to arm64 architecture on Apple Silicon hosts 383e81aa60 Tests: Teach RunCMake to ignore Xcode internal objc warnings 8f75912176 Tests: Enable Assembler test case when CMAKE_OSX_ARCHITECTURES has one value Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5291
| * | macOS: Default to arm64 architecture on Apple Silicon hostsBrad King2020-09-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Detect `arm64` hardware using a method that pierces Rosetta. If `CMAKE_OSX_ARCHITECTURES` is not set, pass explicit flags to the toolchain to use `arm64` instead of letting the toolchain pick. Fixes: #20989
* | | Merge topic 'refactor-cmprop'Brad King2020-09-291-23/+21
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | c88dde2869 cmGeneratorTarget: internal refactoring Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5289
| * | | cmGeneratorTarget: internal refactoringvvs314152020-09-281-23/+21
| |/ /
* | | cmGeneratorTarget: Include Cache now occurs per language+configRobert Maynard2020-09-251-4/+3
|/ / | | | | | | | | Previously only occurred per config which broke per-language system includes.
* | OBJECT libraries: Properly recognize if sources depend on configurationDeniz Bahadir2020-09-231-5/+13
| | | | | | | | Fixes: #21198
* | cmGeneratorTarget: Better name for internal variableDeniz Bahadir2020-09-221-4/+4
| |
* | Merge topic 'pch-instantiate-templates'Brad King2020-09-101-0/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | PCH: Template instantiation supportTobias Hieta2020-09-021-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | cmGeneratorTarget: Avoid missing nullptr checkvvs314152020-09-081-22/+12
| | | | | | | | | | | | | | | | | | | | | Revise logic in `ComputeOutputDir` that was previously missing a check for nullptr before constructing a `std::string`. Fixes: #21165
* | | Merge topic 'ispc_improvements'Brad King2020-09-081-0/+55
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+55
| | | |
* | | | Refactor: Use cmToCStr()Vitaly Stakhovsky2020-09-031-9/+5
|/ / /
* | | cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-17/+17
| | |
* | | Merge topic 'ispc_lang_support'Brad King2020-09-011-28/+94
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-8/+77
| | |
| * | Refactor some swift only logic to be re-used by other languagesRobert Maynard2020-08-071-26/+23
| | | | | | | | | | | | | | | The logic in AddSwiftInterfaceIncludeDirectories is something that other languages will want going forward
* | | WIN32_EXECUTABLE: Add support for generator expressionsKyle Edwards2020-08-211-0/+6
| | |
* | | Add option to optimize link dependencies for static librariesKyle Edwards2020-08-121-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge topic 'osx-archs-apple-only'Brad King2020-08-111-0/+3
|\ \ \ | | |/ | |/| | | | | | | | | | | | | 70ce1ad64a PCH: Avoid Apple-specific architecture flags on other platforms Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5118
| * | PCH: Avoid Apple-specific architecture flags on other platformsBrad King2020-08-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit f593b354da (PCH: Add support for multi architecture iOS projects, 2020-04-02, v3.18.0-rc1~414^2) the `OSX_ARCHITECTURES` target property (and corresponding `CMAKE_OSX_ARCHITECTURES` variable) affects flags on non-Apple platforms by accident. Add a missing condition to avoid this. Fixes: #21072
* | | Add INTERFACE libraries to generated buildsystem if they have SOURCESBrad King2020-08-071-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INTERFACE libraries were created with the intention of collecting usage requirements for use by other targets via `target_link_libraries`. Therefore they were not allowed to have SOURCES and were not included in the generated buildsystem. In practice, this has become limiting: * Header-only libraries do have sources, they just do not compile. Developers should be able to edit those sources (the header files) in their IDE. * Header-only libraries may need to generate some of their header files via custom commands. Some projects work around these limitations by pairing each interface library with an `add_custom_target` that makes the header files and custom commands appear in the generated buildsystem and in IDEs. Lift such limitations by allowing INTERFACE libraries to have SOURCES. For those with sources, add a corresponding build target to the generated buildsystem. Fixes: #19145
* | | Remove filtering of allowed INTERFACE library propertiesBrad King2020-08-031-5/+0
| |/ |/| | | | | | | | | | | | | | | | | | | Previously we disallowed use of arbitrary properties on INTERFACE libraries. The goal was to future-proof projects using them by not allowing properties to be set that may affect their future inclusion in the generated buildsystem. In order to prepare to actually include INTERFACE libraries in the generated buildsystem, drop the filter and allow arbitrary properties to be set. Issue: #19145
* | Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-1/+1
| |
* | cmGeneratorTarget: Skip computing link implementation for custom targetsBrad King2020-07-271-4/+16
| | | | | | | | | | Targets created by `add_custom_target` cannot be used with `target_link_libraries` and so have no link implementation.