summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
Commit message (Collapse)AuthorAgeFilesLines
* target_link_libraries: Restore transitive out-of-dir linkingBrad King2021-06-291-6/+8
| | | | | | | | | | | | Refactoring in commit 7f506b95a7 (cmGeneratorTarget: Refactor link item lookup, 2021-05-26, v3.21.0-rc1~103^2~4) accidentally dropped the persistent lookup scope tracking across multiple items that was added by commit f0e67da061 (target_link_libraries: Fix out-of-dir linking of a list of targets, 2020-01-14, v3.17.0-rc1~149^2). This broke a transitive out-of-dir linking case not covered by our test suite. Restore the scope tracking and add a test case. Fixes: #22363
* HIP: analyze output of `hipcc` to determine default GPU architectureZack Galbreath2021-06-071-0/+6
|
* HIP: Automatically inject the `hip::device` runtime targetRobert Maynard2021-06-071-26/+170
| | | | | Any target that might need to link to hip code needs the `hip::device` target
* HIP: Add language to CMakeRobert Maynard2021-06-071-3/+21
|
* cmGeneratorTarget: Clear cached link implementation when a source is addedBrad King2021-06-041-0/+1
| | | | | | Adding a source file at generate time can cause the linker language or other settings to change that affect `GetLinkImplementationLibraries` and friends.
* target_link_libraries: Place $<TARGET_OBJECTS> before librariesBrad King2021-05-291-5/+33
| | | | | | | | | 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-14/+23
| | | | | Look up items individually so the call sites can do something with the result besides appending to a vector.
* cmGeneratorTarget: Give temporary link impl item an explicit nameBrad King2021-05-281-2/+2
|
* Xcode: Enable multi-arch TARGET_OBJECTS genex in [INTERFACE_]LINK_LIBRARIESBrad King2021-05-261-0/+2
| | | | This was an oversight in the original implementation.
* Framework: Fix $<TARGET_SONAME_FILE:...> for imported frameworksKyle Edwards2021-05-201-3/+26
|
* Source: Remove unnecessary comparisons to nullptrVitaly Stakhovsky2021-05-101-6/+5
|
* Merge topic 'CUDA-device-link'Brad King2021-04-011-8/+52
|\ | | | | | | | | | | | | bb96984ec9 CUDA Device link: Ensure all link options are correctly formatted Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5962
| * CUDA Device link: Ensure all link options are correctly formattedMarc Chevrier2021-03-311-8/+52
| | | | | | | | Fixes: #21994
* | 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
| | | |