summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmCustomCommand: Track main dependency explicitlyNAKAMURA Takumi2021-12-141-20/+8
| | | | | | | Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
* cmLocalGenerator: Remove unused IncludePathStyle infrastructureBrad King2021-12-011-6/+3
| | | | | | It is unused since commit c564a3e3ff (Ninja: Always compile sources using absolute paths, 2021-05-19, v3.21.0-rc1~129^2), which left behind a FIXME comment to eventually remove it.
* cmLocalGenerator: Simplify Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-95/+21
|
* cmMakefile: Simplify detail:::Add{Custom,Utility}CommandNAKAMURA Takumi2021-11-181-112/+94
| | | | | | | | | Note 1: `detail::AddCustomCommandToTarget()` resets cc, since cc is not moved away. Note 2: In `detail::AddUtilityCommand()`, a few vars are preserved before using. Their refs will be alive in most cases, but cc might be destroyed in the future.
* cmCustomCommand: Move constructor arguments to individual settersNAKAMURA Takumi2021-11-181-6/+17
| | | | | | | | Make `cmCustomCommand` have just only default constructor. Use each setter instead. This follows the builder pattern. Introduce `cc::SetOutputs(std::string output)`. This will be used later, as substitution for `cc::SetOutputs({output})`.
* Unity Build: Fix per-config sources in multi-config generatorsBrad King2021-11-111-29/+58
| | | | | | | | | | | | | | | Single-config generators already support unity builds with per-config sources because they compute sources using `CMAKE_BUILD_TYPE` as the configuration. Each original source is either included in the unity build source, or not. Teach multi-config generators to compute the list of sources for inclusion in unity builds using all configurations. Previously they only used the empty string as the configuration. Each original source may be included in some configurations, but not others. Use preprocessor conditions to guard their inclusion when necessary. Fixes: #22892
* cmLocalGenerator: Add dedicated types to hold unity source infoBrad King2021-11-111-36/+53
|
* cmLocalGenerator: Clarify name of method to write unity source include linesBrad King2021-11-101-5/+7
|
* cmLocalGenerator: Simplify unity source copy-if-different logicBrad King2021-11-101-13/+8
|
* cmLocalGenerator: De-duplicate unity source file generationBrad King2021-11-101-40/+32
|
* Merge topic 'cuda_clang_cmp0105'Brad King2021-11-091-5/+3
|\ | | | | | | | | | | | | | | | | | | 4707ecbe6f CUDA: Support CMP0105 on Clang 15fde4c420 CUDA: Use local shorthands for variables in Clang device link code cf7e68087d CUDA: Avoid unnecessary allocation and GetLinkLanguage() 5b0693411e CUDA: Ignore USE_WATCOM_QUOTE for device link rules Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6709
| * CUDA: Avoid unnecessary allocation and GetLinkLanguage()Raul Tambre2021-11-071-5/+3
| | | | | | | | | | There's no reason to allocate the cmNinjaLinkLineDeviceComputer on the heap. We can also assume the link language as CUDA in cmLocalGenerator::GetDeviceLinkFlags().
* | Merge topic 'nmc-reuse-from'Brad King2021-11-091-3/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | 244550997f PCH: Fixed Ninja Multi-Config and REUSE_FROM for MSVC Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !6713
| * | PCH: Fixed Ninja Multi-Config and REUSE_FROM for MSVCCristian Adam2021-11-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The copy_idb_pdb.cmake script would be executed for every configuration for all configurations. Debug would still want to get the RelWithDebInfo files, and the other way around.
* | | Merge topic 'msvc-pch-reuse-config'Brad King2021-11-091-2/+2
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | 95fa27d94d PCH: Fix REUSE_FROM when Debug and RelWithDebInfo configs differ Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6712
| * | PCH: Fix REUSE_FROM when Debug and RelWithDebInfo configs differCristian Adam2021-11-081-2/+2
| |/ | | | | | | | | | | | | If the Debug configuration contains `/ZI` but the RelWithDebInfo doesn't then the copy_pdb_idb.cmake script will cause problems due to the fact that it was common for both configurations but they are incompatible with each other.
* | bootstrap: Do not declare cmSystemTools functions that are not implementedBrad King2021-10-271-1/+4
| | | | | | | | Convert runtime error messages into compile-time errors.
* | Source: Replace most calls to sprintf with snprintfSean McBride2021-10-251-2/+2
|/
* Source: Fix clang -Wimplicit-fallthrough warningsSean McBride2021-09-281-2/+3
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-81/+82
|
* remove cmToCStr functionMarc Chevrier2021-09-191-5/+4
|
* cmSystemTools::VersionCompare: use std::string for argumentsMarc Chevrier2021-09-171-6/+6
|
* PCH: MSVC: Restrict OBJECT library INTERFACE_LINK_LIBRARIES usageCristian Adam2021-09-151-1/+2
| | | | | | | | The pch object file could cause problems when the reused pch is passed through an OBJECT library, which would use INTERFACE_LINK_LIBRARIES to link the pch object file. Fixes: #22630
* Merge topic 'pch-xcode-multiple-languages'Brad King2021-09-141-0/+15
|\ | | | | | | | | | | | | | | bbcdac4e5d PCH: Fix all-language precompile header support in Xcode Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6435
| * PCH: Fix all-language precompile header support in XcodeCristian Adam2021-09-131-0/+15
| | | | | | | | Fixes: #22384
* | Refactor: Use new SetProperty signaturesMarc Chevrier2021-08-251-6/+6
| |
* | Refactor: reduce cmToCStr usageMarc Chevrier2021-08-191-17/+15
|/
* Merge topic 'LWYU-externalization'Brad King2021-07-121-0/+24
|\ | | | | | | | | | | | | | | | | 14e57e9637 LINK_WHAT_YOU_USE feature: externalize configuration 9c5132a586 PGI: Fix "LINKER:" prefix generated separator 8a93de080c cmGeneratorTarget: Add method for LINKER: prefix translation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6306
| * LINK_WHAT_YOU_USE feature: externalize configurationMarc Chevrier2021-07-091-0/+24
| | | | | | | | | | | | | | | | 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
* | Do not exclude include directory symlinks to entries of CPATHAlexander Grund2021-07-071-3/+13
| | | | | | | | | | | | | | | | | | | | | | Extend the fix from commit 2d0b0e2b9d (Do not exclude include directories made implicit by CPATH, 2019-05-29, v3.14.5~2^2) to cover include directories that are symlinks to paths listed in `CPATH`. Compare resolved paths against resolved entries of `CPATH`. Resolve the entries as late as possible in case symlinks change. Fixes: #22383
* | cmLocalGenerator: Simplify CPATH lookup loopAlexander Grund2021-07-071-3/+2
| |
* | cmLocalGenerator: Clarify check for membership in multiple setsAlexander Grund2021-07-071-3/+3
| |
* | cmLocalGenerator: Remove unnecessary parentheses in a conditionAlexander Grund2021-07-071-4/+4
| |
* | cmLocalGenerator: Store realpath lookup result in a variableAlexander Grund2021-07-071-2/+3
| |
* | cmLocalGenerator: Factor out repeated condition into local variableAlexander Grund2021-07-061-3/+4
|/
* Compiler/MSVC: use the `-external:I` flag for system includesBen Boeckel2021-06-181-0/+8
| | | | See: #17904
* HIP: Add language to CMakeRobert Maynard2021-06-071-5/+7
|
* add_custom_command: Target-dependent generator expression supportRaul Tambre2021-05-311-0/+1
| | | | | | | | | OUTPUT variant with a TARGET given to allow resolving target-based generator expressions wouldn't work because OUTPUT is resolved before generator targets are created, i.e. FindGeneratorTargetToUse() returns nullptr. This is a known limitation, see #21364. Implements #21336.
* install: Implement new install(CODE|SCRIPT) option ALL_COMPONENTSNils Gladitz2021-05-191-2/+2
| | | | | | | | | | | In a per-component installation the generated installation scripts are invoked once for each component. Per default custom installation script code added by install(CODE|SCRIPT) only runs for one specific component in this context. The new ALL_COMPONENTS option allows custom script code to be run once for each component being installed.
* cmOutputConverter: Adopt relative path conversion helpersBrad King2021-05-171-19/+0
| | | | Move them up from cmLocalGenerator and out of cmStateDirectory.
* cmLocalGenerator: De-duplicate StateSnapshot memberBrad King2021-05-171-1/+0
| | | | We have the member from the cmOutputConverter parent.
* cmLocalGenerator: Remove unused MaybeRelativeToCurSrcDir methodBrad King2021-05-171-6/+0
| | | | | | | With the recent update to `GetObjectFileNameWithoutTarget`, we no longer have any call sites for `MaybeRelativeToCurSrcDir`. It does not make sense for the generator to produce paths relative to the source tree in general, so remove the method.
* cmLocalGenerator: Localize logic mapping source path to object file nameBrad King2021-05-171-2/+19
| | | | | | | | We select an object file name based on the path to its source file. Localize the logic for shortening this via relative paths. It does not need to use the generator-wide relative path conversion rules because we are not actually generating a relative path that needs to be consistent with anything else.
* INTERFACE_POSITION_INDEPENDENT_CODE must be transitive for OBJECT libraryMarc Chevrier2021-05-141-7/+0
| | | | Fixes: #22174
* cmLocalGenerator: Factor out relative path conversion helpersBrad King2021-05-131-9/+23
| | | | | | 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.
* cmStateDirectory: Rename ConvertToRelPathIf{Not => }ContainedBrad King2021-05-121-1/+1
| | | | The "Not" in the method name is backward from its logic.
* Source: Minor code improvementsVitaly Stakhovsky2021-05-111-1/+1
|
* Source: Remove unnecessary comparisons to nullptrVitaly Stakhovsky2021-05-101-3/+3
|
* Source: Fix typos and spelling in commentsJosef Angstenberger2021-05-071-3/+3
|
* Merge topic 'objc-osx-architectures'Brad King2021-05-061-1/+1
|\ | | | | | | | | | | | | 5972094708 ObjectiveC: Respect OSX_ARCHITECTURES for OBJC Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6090