summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Ninja: Fix mixed Swift/CXX library target generationEvan Wilde2022-09-161-7/+14
| | | | | | | | | | | | | | | | With how things were before, mixed Swift/C++ libraries would result in a broken ninja file. `cpp.cpp.o` was emitted by the compiler, but was also being included in the `linkBuild.Outputs` list, so it was being emitted by multiple targets. The fix checks that the source language is Swift before adding it to the list of additional outputs. If it is Swift, this isn't a problem. If it isn't Swift, we don't include it in the list of outputs. On the other side, the C++ file was also being passed as a source file, which the Swift compiler can't compile. So we add the C++ object file as an explicit dependency and the object file is then added to the list of Swift sources.
* remove unused variableRobert Maynard2022-07-131-1/+0
|
* Ninja: Avoid duplicating /DEF: linker flag with MSVC toolsBrad King2022-05-311-3/+0
| | | | | | | | | | In commit 9a0d5a828a (Ninja: add /DEF: flag to linker call, 2012-03-10, v2.8.8~22^2~7) the logic should have been added to `GetTargetFlags` in place of the older logic in that method from commit 7cef36c628 (ENH: add the ability to generate custom commands for a language that is not supported by an IDE, 2004-10-21, v2.4.0~2655). Fixes: #23570
* cmLocalGenerator: Adopt AppendModuleDefinitionFlag methodBrad King2022-05-311-2/+2
| | | | Migrate from `cmCommonTargetGenerator::AddModuleDefinitionFlag`.
* Provide guidance when trying to use non-enabled languageRobert Maynard2022-05-041-7/+3
| | | | Fixes #23463
* CUDA: Support CMP0105 on ClangRaul Tambre2021-11-081-0/+15
| | | | | | | Add link flags during the "device compile" step. Enabled the relevant tests. The disable reasons regarding separable compilation were outdated and the actual failure case was device link flags support.
* CUDA: Use local shorthands for variables in Clang device link codeRaul Tambre2021-11-071-12/+10
| | | | Helps reduce wrapping of lines making code more readable.
* CUDA: Avoid unnecessary allocation and GetLinkLanguage()Raul Tambre2021-11-071-10/+8
| | | | | There's no reason to allocate the cmNinjaLinkLineDeviceComputer on the heap. We can also assume the link language as CUDA in cmLocalGenerator::GetDeviceLinkFlags().
* CUDA: Ignore USE_WATCOM_QUOTE for device link rulesRaul Tambre2021-11-071-3/+0
| | | | It's useless as the Watcom compiler isn't supported by NVCC.
* Ninja: Fix creation of Windows import library directoryBrad King2021-11-031-2/+2
| | | | | | | Call `EnsureParentDirectoryExists` with our internal representation of the path, not the representation quoted/encoded for Ninja. Fixes: #22841
* Rename cmProp in cmValueMarc Chevrier2021-09-211-13/+13
|
* Merge topic 'cuda_separable_clang_make'Brad King2021-07-291-5/+5
|\ | | | | | | | | | | | | | | 3975678fcc CUDA/Clang: Simplify --register-link-binaries logic 0b1cea66cd CUDA/Clang: Fix separable compilation in non-root directories with Makefiles Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6400
| * CUDA/Clang: Simplify --register-link-binaries logicroot2021-07-291-5/+5
| | | | | | | | | | | | | | Move the logic for appending cubin afterwards, so the check can simply be empty(). With the Makefile generator the option is now at the front instead of being intermixed with the actual bins.
* | LINK_WHAT_YOU_USE feature: externalize configurationMarc Chevrier2021-07-091-14/+22
|/ | | | | | | | Currently, this feature is only supported on ELF platforms. So, the property LINK_WHAT_YOU_USE will be ignored for other plateforms. Moreover, flags and commands are now controled by CMake variables. Fixes: #20174
* Ninja: Fix LINK_WHAT_YOU_USE link flag placementĐoàn Trần Công Danh2021-06-251-6/+3
| | | | | | | Move `-Wl,--no-as-needed` from the `<FLAGS>` placeholder to `<LINK_FLAGS>`, as it is in the Makefile generators. Fixes: #22342
* Launchers: Support setting linker launchersBobby D Reynolds2021-05-281-0/+5
| | | | Fixes: #18316
* cmNinjaNormalTargetGenerator: Fix "Language" rule variableBobby D Reynolds2021-05-281-1/+1
| | | | Fixes: commit 3bc63e99e4 (Refactor: Prepare Ninja generator for multi-config, 2019-11-14, v3.17.0-rc1~290^2~3)
* cmNinjaNormalTargetGenerator: Factor out build event byproduct collectionBrad King2021-05-251-9/+10
| | | | | This was left out of commit 68e5f92cad (cmGlobalNinjaGenerator: Factor out custom command output collection, 2021-05-18).
* cmNinjaTargetGenerator: Rename source file path lookup method for clarityBrad King2021-05-251-3/+5
| | | | | | The `GetSourceFilePath` method is meant only for compiled sources, and automatically handles converting it to a path for the Ninja build manifest. Rename the method to clarify both.
* Ninja/Swift: Remove redundant calls to ConvertToNinjaPathBrad King2021-05-251-5/+3
| | | | `GetSourceFilePath` already handles converting to a Ninja path.
* Merge topic 'ninja-multi-long-command-line-config'Brad King2021-05-031-11/+19
|\ | | | | | | | | | | | | ad08f93ee4 Ninja Multi-Config: Split long command lines by config Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6067
| * Ninja Multi-Config: Split long command lines by configKyle Edwards2021-04-301-11/+19
| | | | | | | | Fixes: #22123
* | Ninja: Escape SONAME on linker command lineAlexander Stein2021-03-041-2/+4
|/ | | | | | | | | | | If the shared object name contains spaces, they need to be properly escaped, or link command will fail. This was already done for soname symlink creation in commit 13c92b4a30 (Ninja: Fix creation of library symlinks in folders with spaces, 2019-05-20, v3.15.0-rc1~87^2). Fixes: #20331
* Ninja Multi-Config: Run POST_BUILD when BYPRODUCTS don't overlapKyle Edwards2021-01-071-8/+12
| | | | Fixes: #21252
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-29/+31
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* cmLocalGenerator::GetRuleLauncher: return cmPropvvs314152020-11-021-4/+4
|
* CUDA: Clang separable compilationRaul Tambre2020-09-241-24/+200
| | | | | | | | | | | | For NVCC the compiler takes care of device linking when passed the "-dlink" flag. Clang doesn't support such magic and requires the buildsystem to do the work that NVCC does behind the scenes. The implementation is based on Bazel's device linking documentation: https://github.com/tensorflow/tensorflow/blob/7cabcdf073abad8c46e9dda62bb8fa4682d2061e/third_party/nccl/build_defs.bzl.tpl#L259 Closes: #20726
* ISPC: Support generation for multiple instruction setsRobert Maynard2020-09-041-1/+6
|
* cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-11/+11
|
* Merge topic 'ninja-multi-rsp-remove-path'Brad King2020-08-061-10/+2
|\ | | | | | | | | | | | | | | cdb50af2f6 Ninja: Restore shorter path to response files Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: alcroito <alexandru.croitor@qt.io> Merge-request: !5094
| * Ninja: Restore shorter path to response filesKyle Edwards2020-08-031-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | In commit 99ed39b011 (Ninja Multi-Config: Make link response files per-config, 2020-07-15, v3.17.4~3^2), we added the target directory to the response file under the mistaken assumption that two different targets with the same name could be in different directories. However, this causes the path to the response file to be too long to fit on a command line. Take the path back out, while leaving in the per-config split. Fixes: #21050
* | Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-1/+1
| |
* | Ninja: Remove parameter default for cmNinjaTargetDependsKyle Edwards2020-07-241-3/+4
| |
* | Merge topic 'ninja-multi-rsp'Brad King2020-07-171-4/+14
|\ \ | |/ | | | | | | | | | | 99ed39b011 Ninja Multi-Config: Make link response files per-config Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5020
| * Ninja Multi-Config: Make link response files per-configKyle Edwards2020-07-161-4/+14
| | | | | | | | Fixes: #20961
* | cmNonempty: Convenience inlines to check for non-empty stringVitaly Stakhovsky2020-07-141-2/+2
| |
* | Merge topic 'getdef-expand'Brad King2020-06-021-9/+6
|\ \ | | | | | | | | | | | | | | | | | | 7ed8c9ebe3 cmMakefile: add GetDefExpandList() that splits value into std::vector Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4819
| * | cmMakefile: add GetDefExpandList() that splits value into std::vectorVitaly Stakhovsky2020-05-301-9/+6
| | | | | | | | | | | | Combines cmMakefile:GetDefinition() and cmExpandList()
* | | Merge topic 'cmprop'Brad King2020-06-021-0/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | b36d1bdd9d Single location for cmProp typedef Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4829
| * | | Single location for cmProp typedefVitaly Stakhovsky2020-06-011-0/+1
| |/ /
* | | GetDefinition: avoid duplicate callsVitaly Stakhovsky2020-05-291-2/+2
|/ /
* | cmGeneratorTarget: Remove default config from Get* methodsBrad King2020-05-181-1/+1
| | | | | | | | Ensure all call sites pass an explicit configuration.
* | cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-6/+6
| |
* | CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-26/+10
| | | | | | | | | | | | | | | | | | | | 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
* | cmState::GetTargetTypeName: return type is *cmPropVitaly Stakhovsky2020-03-191-12/+15
| |
* | Merge branch 'backport-swift-ninja-multiconfig' into swift-ninja-multiconfigKyle Edwards2020-03-091-3/+3
|\ \ | |/
| * Swift: support Ninja Multi-ConfigSaleem Abdulrasool2020-03-091-3/+3
| | | | | | | | | | Enable support for multi-configuration builds using Ninja when building Swift.
* | Add support for FRAMEWORK_MULTI_CONFIG_POSTFIX_<CONFIG>Alexandru Croitor2020-03-041-1/+13
|/
* Merge branch 'backport-cuda-non-device-link'Brad King2020-02-241-2/+2
|\
| * Ninja: Do not use nvcc response files with non-nvcc toolsFrancisco Facioni2020-02-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since commit d91b5a72cd (Ninja: Add support for CUDA nvcc response files, 2019-05-30, v3.15.0-rc1~8^2) we use NVCC's `--options-file` option to avoid long link command lines via a response file. However, for non-device linking the host tools are used and the option does not make sense. Update the logic to use `--options-file` only for device linking. Linking with the host tools already has its own logic for response files. Fixes: #19954