summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Add options to specify linker toolMarc Chevrier2023-10-131-0/+3
| | | | | | | | | | | | | | | | | | Offer the capability, through variable `CMAKE_LINKER_TYPE`, as well as the target property `LINKER_TYPE` to specify which linker must be used. The implementation of this capability is specified by variables specific to the language and linker type: `CMAKE_<LANG>_USING_LINKER_<TYPE>`. Some definitions are provided as part of `CMake`. For example, to select the `LLVM` linker rather than the standard one, the type `LLD` should be specified through the variable `CMAKE_LINKER_TYPE`. And, on `Apple`, `Linux` and some environments on `Windows`, the variable `CMAKE_<LANG>_USING_LINKER_LLD` has value `-fuse-ld=lld`. And for `Windows` environments based on `MSVC`, where the linker is used directly, the tool `lld-link.exe` will be used rather than `link.exe`. Fixes: #19174, #24254, #24990
* CreateRulePlaceholderExpander(): enhance memory managementMarc Chevrier2023-05-041-4/+4
| | | | This method returns now a std::unique_ptr instance rather than a raw pointer.
* Link step: use linker dependency linker fileMarc Chevrier2023-05-031-0/+2
| | | | | | Based on work done by @ben.boeckel (!8051) Fixes: #22217
* CMake code rely on cmList class for CMake lists management (part. 2)Marc Chevrier2023-04-291-7/+7
|
* Makefile: Don't pass the CUDA compiler response files with UTF8_BOMRobert Maynard2023-02-281-4/+5
| | | | Fixes #24544
* RULE_LAUNCH_*: Add support for generator expressionsKyle Edwards2023-02-031-6/+8
|
* Watcom: Replace WATCOMQUOTE format by UseWatcomQuote attributeJiri Malak2023-01-241-4/+1
| | | | | | | Replace WATCOMQUOTE output format by UseWatcomQuote attribute to properly handle single quote This attribute is used globaly only for Watcom linker to handle single-quote separator instead of double-quote it doesn't mean different output format only change of quoting separator It is now applied to any output form SHELL/RESPONSE/NINJAMULTI if Watcom linker is used otherwise double-quote is used
* CUDA: Add Device LTO support for nvccRobert Maynard2022-07-221-8/+9
| | | | Fixes #22200
* CUDA: Support response files with nvccRobert Maynard2022-06-131-4/+6
|
* cmLocalGenerator: Adopt AppendModuleDefinitionFlag methodBrad King2022-05-311-2/+3
| | | | Migrate from `cmCommonTargetGenerator::AddModuleDefinitionFlag`.
* Merge topic 'aix-exe-exports'Brad King2022-03-281-3/+3
|\ | | | | | | | | | | | | a8dae21ac1 AIX: Fix executable ENABLE_EXPORTS in Makefile generators Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7120
| * AIX: Fix executable ENABLE_EXPORTS in Makefile generatorsBrad King2022-03-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit afcd9fe669 (AIX: Add an option to disable automatic exports from shared libraries, 2020-01-30, v3.17.0-rc1~47^2) the population of the `<AIX_EXPORTS>` rule variable placeholder was accidentally added to the device linking rule rather than the main linking rule. This caused our `ExportImportList` script on AIX, when called for executables with `ENABLE_EXPORTS` set, to be given an `AIX_EXPORTS` file name that does not exist, leading to a warning from the `dump` tool. Move the population of the `<AIX_EXPORTS>` placeholder in the Makefile generators to the main link rule. Issue: #20290
* | CUDA: Ignore USE_WATCOM_QUOTE for device link rulesRaul Tambre2021-11-071-9/+3
| | | | | | | | It's useless as the Watcom compiler isn't supported by NVCC.
* | Rename cmProp in cmValueMarc Chevrier2021-09-211-6/+6
| |
* | LINK_WHAT_YOU_USE feature: externalize configurationMarc Chevrier2021-07-091-9/+14
|/ | | | | | | | 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
* Launchers: Support setting linker launchersBobby D Reynolds2021-05-281-0/+6
| | | | Fixes: #18316
* cmLocalGenerator: Factor out relative path conversion helpersBrad King2021-05-131-40/+26
| | | | | | Most calls to `MaybeConvertToRelativePath` use one of our common work directories (e.g. top of the build tree) as the local path. Add helpers for each of the common cases to simplify and clarify call sites.
* Per-language Win32/Console flagsRaul Tambre2021-03-171-2/+5
| | | | | | | | Allows using different compilers with different flags for different languages. For example Clang with GNU-like commandline for CXX and MSVC as host compiler for CUDA. Should help with #21914.
* cmLocalGenerator::GetRuleLauncher: return cmPropvvs314152020-11-021-6/+7
|
* CUDA: Clang separable compilationRaul Tambre2020-09-241-22/+31
| | | | | | | | | | | | 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
* WIN32_EXECUTABLE: Add support for generator expressionsKyle Edwards2020-08-211-1/+2
|
* cmNonempty: Convenience inlines to check for non-empty stringVitaly Stakhovsky2020-07-141-2/+2
|
* cmMakefile: add GetDefExpandList() that splits value into std::vectorVitaly Stakhovsky2020-05-301-3/+1
| | | | Combines cmMakefile:GetDefinition() and cmExpandList()
* CUDA: Device linking use now link optionsMarc Chevrier2020-04-191-21/+5
| | | | | | | | | | 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-1/+1
|
* AIX: Add an option to disable automatic exports from shared librariesBrad King2020-01-311-0/+3
| | | | | | | | | | Since commit 0f150b69d3 (AIX: Explicitly compute shared object exports for both XL and GNU, 2019-07-11, v3.16.0-rc1~418^2~2) we always export all symbols from shared libraries by default. Add a new target property called `AIX_EXPORT_ALL_SYMBOLS` that can be explicitly set to OFF to suppress this behavior and export no symbols by default. Fixes: #20290
* cmGlobalGenerator: modernize memrory managemenbtMarc Chevrier2019-12-301-4/+4
|
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-4/+4
|
* Refactor: Prepare Ninja generator for multi-configKyle Edwards2019-12-131-26/+29
|
* PCH: Generate sources during Compute stepCristian Adam2019-10-091-2/+0
|
* Unity build: Generate sources during Compute stepBrad King2019-10-031-1/+0
| | | | | | | | The unity build sources need to be added for all generators. Create them during `cmGlobalGenerator::Compute` to avoid duplicating the calls in every generator. We already handle Qt autogen there too. Issue: #19789
* cmstd: Modernize CMake system headersMarc Chevrier2019-09-201-1/+1
| | | | | | | | | | | | | | Provide a standardized way to handle the C++ "standard" headers customized to be used with current CMake C++ standard constraints. Offer under directory `cm` headers which can be used as direct replacements of the standard ones. For example: #include <cm/string_view> can be used safely for CMake development in place of the `<string_view>` standard header. Fixes: #19491
* cmLocalGenerator: Remove AppendFlags 'const char*' overloadBrad King2019-09-051-4/+5
| | | | | Update call sites to ensure the `std::string` argument can be constructed safely.
* Unity build: Add support for Ninja and Makefile generatorsCristian Adam2019-08-291-0/+1
|
* Precompile headers: Add methods to generate PCH sourcesCristian Adam2019-08-281-0/+2
| | | | Co-Author: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Source sweep: Use cmStrCat for string concatenationSebastian Holtermann2019-08-221-35/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is generated by a python script that uses regular expressions to search for string concatenation patterns of the kind ``` std::string str = <ARG0>; str += <ARG1>; str += <ARG2>; ... ``` and replaces them with a single `cmStrCat` call ``` std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...); ``` If any `<ARGX>` is itself a concatenated string of the kind ``` a + b + c + ...; ``` then `<ARGX>` is split into multiple arguments for the `cmStrCat` call. If there's a sequence of literals in the `<ARGX>`, then all literals in the sequence are concatenated and merged into a single literal argument for the `cmStrCat` call. Single character strings are converted to single char arguments for the `cmStrCat` call. `std::to_string(...)` wrappings are removed from `cmStrCat` arguments, because it supports numeric types as well as string types. `arg.substr(x)` arguments to `cmStrCat` are replaced with `cm::string_view(arg).substr(x)`
* avoid adding multiple consecutive string literals to std::stringRolf Eike Beer2019-08-181-6/+5
| | | | While at it change some single character additions to be of type char.
* Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgumentSebastian Holtermann2019-08-141-3/+3
|
* Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-1/+1
|
* clang-tidy: Enable performance-inefficient-string-concatenationSebastian Holtermann2019-08-051-2/+3
| | | | | | | Enables the clang-tidy test performance-inefficient-string-concatenation and replaces all inefficient string concatenations with `cmStrCat`. Closes: #19555
* Merge topic 'cleanup-gen-lookups'Brad King2019-07-151-3/+2
|\ | | | | | | | | | | | | | | | | 7ff9ab3b10 Makefile: De-duplicate executable link rule lookup 79f5ef19fe De-duplicate checks for whether a platform uses Windows DLLs 22d3eb5d5e Refactor checks for whether a target has an import library Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3550
| * Makefile: De-duplicate executable link rule lookupBrad King2019-07-121-3/+2
| | | | | | | | Use `GetCreateRuleVariable` instead of duplicating the variable lookup.
* | Introduce memory management helper: cm_memory.hxxMarc Chevrier2019-07-141-1/+2
|/
* IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-1/+1
| | | | | | | | An old workaround for `std::allocator_traits<>::value_type` lints from IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`. Convert the workaround to use the same approach we already use for a workaround of `std::__decay_and_strip<>::::__type` lints. Then update the `<memory>` inclusions to follow the now-correct IWYU lints.
* CUDA: Do not device link if CUDA is not an enabled languageRobert Maynard2019-07-011-5/+1
| | | | | | | | | | | | | Checks added in commit 81b4d10d8f (CUDA: More exhaustive checks to determine when to do device linking, 2019-05-09, v3.15.0-rc1~82^2) assumed that CUDA properties would be set only if CUDA is enabled. We cannot do a device link step if we do not have the CUDA language enabled. This was discovered as some projects unconditionally set CUDA properties such as `CUDA_RESOLVE_DEVICE_SYMBOLS` even when the CUDA language has not been enabled. Fixes: #19432
* Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-3/+3
|
* Merge topic 'remove_unneeded_device_link_calls'Brad King2019-05-221-15/+3
|\ | | | | | | | | | | | | | | 81b4d10d8f CUDA: More exhaustive checks to determine when to do device linking 3205c7c950 cmNinjaLinkLineDeviceComputer now lives in the correct source file Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3320
| * CUDA: More exhaustive checks to determine when to do device linkingRobert Maynard2019-05-211-15/+3
| | | | | | | | | | | | | | | | | | Previously CMake used fairly naive logic to determine when to do device linking which caused unnecessary device linking to occur frequently. We now use a more exhaustive algorithm to determine when we have a need for device linking. Fixes: #19238
* | Merge topic 'string-cleanup'Brad King2019-05-171-1/+1
|\ \ | |/ |/| | | | | | | | | | | 23e8364aed Source: std::string related cleanup Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3324
| * Source: std::string related cleanupVitaly Stakhovsky2019-05-151-1/+1
| |