summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge topic 'make-GENERATED-visible-from-any-scope'Brad King2020-11-301-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1/+8
|\ \ | |/ |/| | | | | | | | | | | 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-1/+8
| | | | | | | | | | | | | | | | | | | | 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/+3
|/
* cmake_language: Add signature to DEFER calls to later timesBrad King2020-09-291-0/+7
| | | | Fixes: #19575
* cmake::GetCacheDefinition: Return cmPropvvs314152020-09-281-5/+6
|
* {get,set}_property: Add support for referencing binary directoriesBrad King2020-09-231-5/+5
| | | | | | | Index directories by their binary directory path in addition to their source directory path. Fixes: #19262
* Merge topic 'file-GENERATE-earlier'Brad King2020-09-111-0/+2
|\ | | | | | | | | | | | | aee2c51224 file(GENERATE): Create output file structures for all directories first Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5209
| * file(GENERATE): Create output file structures for all directories firstJosef Angstenberger2020-09-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 36ded610af (PCH: Generate sources during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup is done earlier than before. Its parent commit f1fb63b306 (file(GENERATE): Create output file structures even earlier, 2019-10-07, v3.16.0-rc1~2^2~1) prepared for that. However, that commit did not account for generating and using files in separate subdirectories. Fix this by evaluating all generated files before adding automatic files. Fixes: #21144
* | cmGlobalGenerator: Compute a global target ordering respecting dependenciesBrad King2020-09-041-0/+46
| | | | | | | | | | Move this up from `cmGlobalXCodeGenerator`. It will be useful for all generators.
* | cmMakefile::GetDefinition: return cmPropVitaly Stakhovsky2020-09-021-28/+26
| |
* | Merge topic 'ispc_lang_support'Brad King2020-09-011-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5ece12b7e4 gitlab-ci: add ISPC to the Fedora CI image 8976817d6d ISPC: Update help documentation to include ISPC 2368f46ba4 ISPC: Support building with the MSVC toolchain e783bf8aa6 ISPC: Support ISPC header generation byproducts and parallel builds 34cc6acc81 Add ISPC compiler support to CMake 419d70d490 Refactor some swift only logic to be re-used by other languages Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5065
| * | ISPC: Support ISPC header generation byproducts and parallel buildsRobert Maynard2020-08-281-0/+1
| | |
* | | WIN32_EXECUTABLE: Add support for generator expressionsKyle Edwards2020-08-211-3/+3
|/ /
* | Merge topic 'compiler_flags'Brad King2020-08-061-0/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f76c20da63 Toolchain: Test compiler initial settings db486da265 Toolchain: Update documentation for initial compiler flags deec2f587c Toolchain: Take CMAKE_<lang>_FLAGS_INIT into account during compiler detection ca899af3e2 Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILER 12ba89e142 Toolchain: Make `/path/comp;-argn' behave the same as 'comp;-argn' 6f1af899db Toolchain: Capture all arguments from CMAKE_<LANG>_COMPILER ec1d3bc0b6 cmake: avoid exception when printing "changed variables" message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4136
| * | Toolchain: Handle repeated invocations of CMake with -DCMAKE_C_COMPILERFred Baksik2020-07-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Repeated invocations of `cmake ... -DCMAKE_C_COMPILER=gcc` should not trigger a "You have changed variables" message even though the cache value of CMAKE_C_COMPILER changes from '/path/to/gcc' to 'gcc'. Make repeated invocations of `cmake ... -DCMAKE_C_COMPILER=gcc;-pipe` not trigger the warning by comparing the compiler name portion of the list to the compiler being used.
* | | Merge topic 'use-nonempty'Brad King2020-07-291-5/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | f37c14e930 Source: use cmNonempty() Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5072
| * | | Source: use cmNonempty()Vitaly Stakhovsky2020-07-281-5/+5
| | | |
* | | | Avoid duplicate calls to GetDefinitionVitaly Stakhovsky2020-07-281-4/+2
|/ / /
* | | Merge topic 'cleanup-target-types'Brad King2020-07-281-14/+6
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ef796cc743 cmGeneratorTarget: Skip computing link implementation for custom targets 45158b2afe cmGeneratorTarget: Simplify logic in ComputeLinkInterfaceLibraries d6b1f5704e cmGeneratorTarget: Add missing nullptr checks 7695b67500 cmComputeTargetDepends: Add missing nullptr check 95b5df8646 cmGeneratorTarget: Skip computing languages for custom targets 2f0790df50 Factor out generator checks for filtering on non-compiling targets 422d9a0ab2 Factor out generator checks for filtering out interface libraries bce82df0aa cmGeneratorTarget: Remove unnecessary target type check in dependency tracing ... Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Kyle Edwards <kyle.edwards@kitware.com> Merge-request: !5038
| * | | Factor out generator checks for filtering on non-compiling targetsBrad King2020-07-231-12/+4
| | | | | | | | | | | | | | | | | | | | Add a `cmGeneratorTarget::CanCompileSources` helper method to tell generators whether a target might compile anything.
| * | | Factor out generator checks for filtering out interface librariesBrad King2020-07-231-2/+2
| |/ / | | | | | | | | | | | | | | | Add a `cmGeneratorTarget::IsInBuildSystem` helper method to tell generators whether a target should participate in the generated build system.
* | | Merge topic 'EXCLUDE_FROM_ALL-genex'Brad King2020-07-271-1/+1
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | 22bd267388 Help: Add release note for EXCLUDE_FROM_ALL genex support 807c8aa9f0 Tests: Simplify RunCMake.ExcludeFromAll single-config case 36743436cf Tests: Fix RunCMake.ExcludeFromAll test program warning 99c131c5a3 cmGlobalGenerator: Fix spelling of EXCLUDE_FROM_ALL in error message Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5049
| * | cmGlobalGenerator: Fix spelling of EXCLUDE_FROM_ALL in error messageBrad King2020-07-231-1/+1
| | |
* | | cmGlobalGenerator: Simplify CheckTargetsForMissingSourcesBrad King2020-07-221-11/+1
|/ / | | | | | | | | Use `GetAllConfigSources` instead of collecting all configurations ourselves.
* | Allow generator expressions in the EXCLUDE_FROM_ALL target propertyJoerg Bornemann2020-07-211-3/+28
| | | | | | | | | | | | | | | | | | 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
* | cmIsOn: add overload accepting const std::string*Vitaly Stakhovsky2020-07-141-12/+4
| |
* | cmMakefile: Refactor API to better handle empty config valuesRobert Maynard2020-07-031-16/+16
| |
* | cmGlobalGenerator: FindMakeProgram() before CMakeDetermineSystemKyle Edwards2020-06-181-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to 147d36c, the build tool was found before the toolset was selected, but was changed to be found after in order to support a 64-bit MSBuild (introduced in da402a0.) However, a bug was found in 64-bit MSBuild, which resulted in da402a0 being reverted in f3cedf3 (but 147d36c was not reverted.) Move FindMakeProgram() even earlier than it was before 147d36c, before CMakeDetermineSystem is called, so that the Visual Studio Android support can report its sysroot, giving Android-Determine the information it needs to inspect the NDK. When the bug in 64-bit MSBuild is fixed, we will have a chicken-and- egg problem, but we don't need to worry about it for now.
* | Refactor language standard computationJustin Goshi2020-06-161-6/+4
| | | | | | | | | | Instead of mutating the configure-time cmTarget's properties at generate time, compute and store it in a cmGeneratorTarget field.
* | cmake --build: Fix exit code when building multiple targetslumberyard-employee-dm2020-06-121-2/+3
|/ | | | | | | | Updated the cmGlobalGenerator::Build method to check the return `retVal` parameter supplied to the `cmSystemTools::RunSingleCommand` to validate that each invocation of the build command returned an exit code of zero. Fixes: #20790
* Merge topic 'getdef-expand'Brad King2020-06-021-3/+2
|\ | | | | | | | | | | | | 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-3/+2
| | | | | | | | 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
| |/
* | Merge topic 'pch-fix-bad-ClearSourcesCache'Brad King2020-06-011-1/+17
|\ \ | |/ |/| | | | | | | | | | | 902858367f Merge branch 'backport-3.16-pch-fix-bad-ClearSourcesCache' fa7b041eca PCH: Fix logic error that incorrectly clears sources during VS generation Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4815
| * Merge branch 'backport-3.16-pch-fix-bad-ClearSourcesCache'Brad King2020-05-291-1/+17
| |\
| | * PCH: Fix logic error that incorrectly clears sources during VS generationBrad King2020-05-291-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 729d997f10 (Precompile Headers: Add REUSE_FROM signature, 2019-08-30, v3.16.0-rc1~101^2), `GetPchFileObject` handles the case that it is called first for another target's `REUSE_FROM` by calling `AddSource` to make sure `GetObjectName` can produce the correct object name. However, `AddSource` causes `ClearSourcesCache` to be called, which since commit a9f4f58f0c (cmGeneratorTarget: Clear AllConfigSources in ClearSourcesCache, 2020-05-15, v3.16.7~2^2) now correctly erases the `AllConfigSources` structure. This is okay during `AddPchDependencies`, but there is another code path in which it is problematic. When the Visual Studio generator's `WriteAllSources` method is looping over the sources, the `cmake_pch.cxx` source is encountered first. This causes `OutputSourceSpecificFlags` to call `GetPchCreateCompileOptions`, which calls `GetPchFile`, which under MSVC with `CMAKE_LINK_PCH` calls `GetPchFileObject`. That leads to `ClearSourcesCache` erasing the structure over which `WriteAllSources` is iterating! This bug is caught by our `RunCMake.PrecompileHeaders` test when run with the VS generator as of the commit that exposed it by fixing `ClearSourcesCache`. However, that change was backported to the CMake 3.16 series after testing only with later versions versions that contain commit a55df20499 (Multi-Ninja: Add precompile headers support, 2020-01-10, v3.17.0-rc1~136^2). By adding proper multi-config support for PCH, that commit taught `cmLocalGenerator::AddPchDependencies` to call `GetPchFile` with the real set of configurations instead of just the empty string. This allows the `GetPchFile` cache of PCH sources to be populated up front so that the later calls to it in the `WriteAllSources` loop as described above do not actually call `GetPchFileObject` or `ClearSourcesCache`. That hid the problem. Fix this by re-ordering calls to `AddPchDependencies` to handle `REUSE_FROM` targets only after the targets whose PCH they re-use. Remove the now-unnecessary call to `AddSource` from `GetPchFileObject` so that `ClearSourcesCache` is never called during `WriteAllSources`. Update the PchReuseFrom test case to cover an ordering of targets that causes generators to encounter a `REUSE_FROM` target before the target whose PCH it re-uses. Fixes: #20770
* | | AutoMoc: Configure AutoMoc after generated sources (PCH, Unity)Cristian Adam2020-05-261-4/+4
| | | | | | | | | | | | Fixes: #20119
* | | cmTarget: Replace "perConfig" constructor boolean with enumBrad King2020-05-181-2/+2
| | |
* | | cmGlobalGenerator: Fix CheckTargetsForMissingSources after refactoringBrad King2020-05-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactoring in commit 01b2d6ab74 (Modernize: Use ranged for-loops when possible, 2019-02-07, v3.15.0-rc1~575^2) accidentally changed a loop condition in this method from "keep iterating if srcs.empty()" to "stop iterating if srcs.empty()". Switch it back. The bug could only manifest in very subtle conditions in a multi-config generator. Add one such case to the test suite. Fixes: #20706
* | | Refactoring: Third-parties public headers are under cm3p prefixMarc Chevrier2020-05-071-2/+2
| | | | | | | | | | | | Fixes: #20666
* | | Merge topic 'cmprop-state'Brad King2020-05-011-4/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | e267c3fddf cmState::GetInitializedCacheValue: return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4696
| * | | cmState::GetInitializedCacheValue: return cmPropVitaly Stakhovsky2020-04-301-4/+3
| | | | | | | | | | | | | | | | cmProp alias is used; no actual change in type
* | | | GetSafeProperty: return std::string const&Vitaly Stakhovsky2020-04-301-2/+2
|/ / /
* | | cmGeneratorTarget::GetProperty: return cmPropVitaly Stakhovsky2020-04-291-8/+16
| | |
* | | Refactoring: add cm::contains to <cmext/algorithm>Marc Chevrier2020-04-171-5/+6
| | |
* | | Merge topic 'cmprop-source'Brad King2020-04-151-2/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | e64fa5f1b6 cmSourceFile::GetProperty: return cmProp fc223f9860 cmGlobalXCodeGenerator: Fix genex interpreter overloads Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4603
| * | | cmSourceFile::GetProperty: return cmPropVitaly Stakhovsky2020-04-141-2/+2
| | | |