summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* cmTarget: Add `HasKnownObjectFileLocation()` shorthandHyper Nova Sun2022-04-111-4/+7
| | | | | | | | Allow `cmGlobalGenerator`s to decide `HasKnownObjectFileLocation()` per given `cmTarget` - `cmGlobalGenerator::HasKnownObjectFileLocation()` now takes an optional `cmGeneratorTarget` - `cmTarget::HasKnownObjectFileLocation()` added as a shorthand
* FILE_SET: Add VERIFY_HEADER_SETS target propertyKyle Edwards2022-03-291-0/+2
| | | | Fixes: #23338
* GenEx/LINK_LIBRARY: Add features for framework support on AppleMarc Chevrier2022-02-151-2/+5
|
* cmGlobalGenerator: Add helper to split framework pathMarc Chevrier2022-02-131-0/+4
| | | | | cmComputeLinkInformation and cmGlobalXCodeGenerator now rely on this method to handle framework paths.
* cmBuildOptions: Split build arguments into separate object.Carsten Rudolph2022-01-221-3/+5
|
* CMP0028: Report the target whose link interface has an offending itemBrad King2021-12-161-0/+1
| | | | | | | | | | | | Previously items linked via the link interface of a dependency were reported in CMP0028 messages as if directly linked by a target. Clarify the messages to indicate that an offending item is actually in the link interface of a given target, regardless of its consumer. Move the check to the end of generation and look through the final set of link implementations and link interfaces that were used for generation. This avoids repeating messages on link interfaces that have multiple consumers.
* Ninja Multi-Config: Fix cross-config custom command dependency tracingBrad King2021-11-041-0/+2
| | | | | | Process `CMAKE_CROSS_CONFIGS` and friends to properly configure the generator for cross-config behavior before custom command dependency tracing.
* Restore honoring CMAKE_GENERATOR_INSTANCE in toolchain fileBrad King2021-10-201-11/+0
| | | | | | | | | | | | | | | Revert the changes from commit d5b5c19278 (cmGlobalGenerator: FindMakeProgram() before CMakeDetermineSystem, 2020-06-15, v3.19.0-rc1~619^2~3) and commit ef91fb02f3 (cmGlobalGenerator: FindMakeProgram() at a generator-specific time, 2020-11-23, v3.19.1~2^2). We must delay selecting the location of MSBuild until after an instance of Visual Studio has been selected. It is now safe to revert the ordering because the motivating use case (sysroot detection in Platform/Android-Determine) has been implemented another way. Fixes: #22782
* cmGlobalGenerator: Add method to check if generator is at least VS 10Brad King2021-10-201-0/+2
|
* Rename cmProp in cmValueMarc Chevrier2021-09-211-3/+3
|
* cmGlobalGenerator::PrintCompilerAdvice: use cmProp as augmentMarc Chevrier2021-09-191-1/+1
|
* Refactor: cmGlobalGenerator::GetGlobalSetting returns cmPropMarc Chevrier2021-08-091-1/+2
|
* cmGlobalGenerator: Use cmMakefile::CreateNewTarget to add global targetsNAKAMURA Takumi2021-07-081-1/+1
| | | | `cmMakefile::CreateNewTarget` updates also `cmMakefile::OrderedTargets`.
* Source: Add cmInstallRuntimeDependencySetKyle Edwards2021-06-041-0/+11
|
* cmGlobalGenerator: Add parallel parameter to GenerateCMakeBuildCommandfriendlyanon2021-05-011-1/+5
|
* Ninja Multi-Config: Enable relink diagnostic messageBrad King2021-02-031-0/+2
| | | | | We already have a message for the "Ninja" generator, but it applies to the "Ninja Multi-Config" generator too.
* Code style: add missed explicit 'this->'Oleksandr Koval2021-01-051-4/+4
| | | | | CMake uses explicit 'this->' style. Using custom clang-tidy check we can detect and fix places where 'this->' was missed.
* Merge topic 'make-GENERATED-visible-from-any-scope'Brad King2020-11-301-0/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 573d51201a GENERATED prop: Set CMP0118 to NEW for some (unrelated) tests 6624b65b3f GENERATED prop: Add implementation for policy CMP0118 being set to NEW b14fe704f8 GENERATED prop: Simplify determining the language of a source file ca4ce458a3 GENERATED prop: Check CMP0118 policy and warn in certain situations 0eb30f175e GENERATED prop: Introducing policy CMP0118 and its documentation 78c8d95605 GENERATED prop: Add some tests before introducing changes with CMP0118 e01527619f Simplify code by calling a function directly instead of duplicating it 75cb8615e9 Fix typo in function name Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5308
| * GENERATED prop: Add implementation for policy CMP0118 being set to NEWDeniz Bahadir2020-11-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Adding implementation for policy CMP0118 being set to `NEW`. * Adding new tests for policy CMP0118 being set to `NEW`. * Checking the `GENERATED` property with `get_source_file_property` or `get_property` now always returns exactly `1` or `0`. No other values will be returned. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * Additionally, as `get_source_file_property` and `get_property` now always check if a source-file was marked globally visible, even when CMP0118 is unset or set to `OLD`, they possibly return `1` where they might have returned `0` before the changes introduced by this commit. Note, that this is a backwards-incompatible change, even when policy CMP0118 is unset or set to `OLD`. * As a consequence, the tests for policy CMP0118 being unset or set to `OLD` got slightly adjusted, too, to reflect these changes in behavior.
* | Merge topic 'fix-find-make-program'Brad King2020-11-241-0/+11
|\ \ | |/ |/| | | | | | | | | | | ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Frank Dana <ferdnyc@gmail.com> Merge-request: !5529
| * cmGlobalGenerator: FindMakeProgram() at a generator-specific timeKyle Edwards2020-11-231-0/+11
| | | | | | | | | | | | | | | | | | | | d5b5c192 moved FindMakeProgram() to an earlier time, which resulted in CMAKE_MAKE_PROGRAM not being read from the toolchain file. Change it to only call FindMakeProgram() early in the specific cases of Visual Studio and Xcode, and restore the old behavior for all other generators. Fixes: #21486
* | Constify some code as suggested by clang-tidyCengizhan Pasaoglu2020-10-191-3/+4
| |
* | cmCustomCommandGenerator: Add option to transform depfileKyle Edwards2020-10-131-0/+6
|/
* cmake_language: Add signature to DEFER calls to later timesBrad King2020-09-291-0/+5
| | | | Fixes: #19575
* cmGlobalGenerator: Compute a global target ordering respecting dependenciesBrad King2020-09-041-0/+8
| | | | | Move this up from `cmGlobalXCodeGenerator`. It will be useful for all generators.
* Modernize: Use #pragma once in all header filesKitware Robot2020-09-031-4/+1
| | | | | | | | | | | | | | | | #pragma once is a widely supported compiler pragma, even though it is not part of the C++ standard. Many of the issues keeping #pragma once from being standardized (distributed filesystems, build farms, hard links, etc.) do not apply to CMake - it is easy to build CMake on a single machine. CMake also does not install any header files which can be consumed by other projects (though cmCPluginAPI.h has been deliberately omitted from this conversion in case anyone is still using it.) Finally, #pragma once has been required to build CMake since at least August 2017 (7f29bbe6 enabled server mode unconditionally, which had been using #pragma once since September 2016 (b13d3e0d)). The fact that we now require C++11 filters out old compilers, and it is unlikely that there is a compiler which supports C++11 but does not support #pragma once.
* Allow generator expressions in the EXCLUDE_FROM_ALL target propertyJoerg Bornemann2020-07-211-1/+2
| | | | | | | | | This allows for setting EXCLUDE_FROM_ALL, conditional on the build configuration. However, only the Ninja Multi-Config generator supports different property values per config. All other multi-config generators will yield an error in that situation. Fixes: #20923
* cmTarget: Replace "perConfig" constructor boolean with enumBrad King2020-05-181-1/+1
|
* Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-1/+1
| | | | Fixes: #20666
* Add support to indicate UTF-8 custom command pipe output encodingJustin Goshi2020-04-131-0/+1
| | | | | | | | | | | | | | | | | Adds a flag to indicate that pipe output from a custom command should be interpreted as UTF-8 encoded. This change does not introduce a public way to set the flag, but generators that create internally-generated commands know if they are calling cmake, which uses UTF-8 pipes. MSBuild added support for interpreting output of PreBuildEvent, PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need to add the StdOutEncoding tag. MSBuild treats these as property bags so if we emit the tag for earlier versions of Visual Studio it would be safely ignored. This change emits the StdOutEncoding tag and sets it to UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes globalization issues when the output from cmake contained characters that required MSBuild to interpret as UTF-8 before displaying them.
* cmState::GetGlobalProperty: return cmPropVitaly Stakhovsky2020-03-251-1/+1
|
* export: Fix use-after-free on multiple calls overwriting same FILEBrad King2020-03-191-6/+4
| | | | | | | | | | | | | | | | | | | | | CMake 3.16 and below allow multiple `export()` calls with the same output file even without using `APPEND`. The implementation worked by accident by leaking memory. Refactoring in commit 5444a8095d (cmGlobalGenerator: modernize memrory managemenbt, 2019-12-29, v3.17.0-rc1~239^2) cleaned up that memory leak and converted it to a use-after-free instead. The problem is caused by using the `cmGlobalGenerator::BuildExportSets` map to own `cmExportBuildFileGenerator` instances. It can own only one instance per output FILE name at a time, so repeating use of the same file now frees the old `cmExportBuildFileGenerator` instance and leaves the pointer in the `cmMakefile::ExportBuildFileGenerators` vector dangling. Move ownership of the instances into `cmMakefile`'s vector since its entries are not replaced on a repeat output FILE. In future work we should introduce a policy to error out on this case. For now simply fix the use-after-free to restore CMake <= 3.16 behavior. Fixes: #20469
* Generator: Don't allow Ninja Multi-Config variables on other generatorsKyle Edwards2020-02-271-0/+7
| | | | | | We may want to enable these variables later on with specific semantics. To avoid breaking backwards compatibility, make it an error to use them for now.
* Ninja Multi-Config: Add support for DEPFILE option in add_custom_command()Kyle Edwards2020-02-071-0/+2
| | | | And give other generators a path forward to add support in the future.
* Refactor: Allow generators to decide default configuration for buildKyle Edwards2020-02-041-0/+10
| | | | And allow them to read any cache values they need.
* Merge topic 'multi-ninja-pch'Brad King2020-01-201-0/+2
|\ | | | | | | | | | | | | a55df20499 Multi-Ninja: Add precompile headers support Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4201
| * Multi-Ninja: Add precompile headers supportCristian Adam2020-01-171-0/+2
| | | | | | | | Fixes: #19789
* | Merge topic 'realpath-cache'Brad King2020-01-201-0/+4
|\ \ | |/ |/| | | | | | | | | 9d5a554cc9 cmGlobalGenerator: Add cache for realpath() results Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4220
| * cmGlobalGenerator: Add cache for realpath() resultsTim Blechmann2020-01-161-0/+4
| | | | | | | | | | Cache the results of `realpath()` system calls in `cmGlobalGenerator` to avoid repeating such calls for the same paths over and over.
* | GlobalGenerator family: modernize memory managementMarc Chevrier2020-01-071-1/+1
| |
* | cmGlobalGenerator: modernize memrory managemenbtMarc Chevrier2019-12-301-9/+11
|/
* Refactoring: use append functions from cmext/algorithmMarc Chevrier2019-12-171-2/+3
|
* Ninja: Add multi-config variantKyle Edwards2019-12-131-0/+6
| | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* cmLocalGenerator: modernize memory managementMarc Chevrier2019-12-091-5/+7
|
* cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSETAlexander Boczar2019-10-151-1/+2
| | | | | Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to indicate when it is called from `cmake::build`.
* file(GENERATE): Create output file structures even earlierBrad King2019-10-071-2/+0
| | | | | | | | | | | | | | Since commit b80557c7bd (file(GENERATE): Evaluate early to allow generating source files, 2014-11-04, v3.2.0-rc1~398^2) we create the `cmSourceFile` instances marked with a `GENERATED` source file property before tracing source dependencies. Move it to even earlier so that steps in `cmGlobalGenerator::AddAutomaticSources` can operate on all sources. This also avoids the accidental `O(n^2)` calls for `n` local generators that we had previously. This is also needed since commit 83c1657ff7 (Unity build: Generate sources during Compute step, 2019-10-03) to support `file(GENERATE)` outputs as sources in a target with `UNITY_BUILD` enabled.
* Unity build: Generate sources during Compute stepBrad King2019-10-031-0/+2
| | | | | | | | 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
* Merge topic 'clang-format-normalize-headers-presentation'Brad King2019-10-021-2/+4
|\ | | | | | | | | | | | | | | | | | | ed98209ddc Revise include order using clang-format-6.0 185fe49f29 clang-format: Normalize headers presentation 42ef28b4f3 Remove unused uid_t/gid_t types on Windows Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3851
| * Revise include order using clang-format-6.0Kitware Robot2019-10-011-2/+4
| | | | | | | | | | Run the `clang-format.bash` script to update our C and C++ code to a new include order `.clang-format`. Use `clang-format` version 6.0.
* | PCH: Report error when setting COMPILE_PDB_NAME propertyCristian Adam2019-10-011-0/+1
|/ | | | | Reusable precompile headers require specific COMPILE_PDB_NAME property values. Report error if the user tries to set a different value.