summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | Merge topic 'msbuildUtf8Support'Brad King2020-04-151-1/+5
|\ \ | |/ |/| | | | | | | | | bc877a7e94 Add support to indicate UTF-8 custom command pipe output encoding Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4587
| * Add support to indicate UTF-8 custom command pipe output encodingJustin Goshi2020-04-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | clang-tidy: address bugprone-sizeof-expression lintBen Boeckel2020-04-131-2/+4
|/
* cmMakefile::GetProperty: return cmPropVitaly Stakhovsky2020-04-011-4/+4
|
* cmTarget::GetProperty: return cmPropVitaly Stakhovsky2020-03-301-3/+2
|
* cmState::GetGlobalProperty: return cmPropVitaly Stakhovsky2020-03-251-9/+8
|
* Merge topic 'export-repeat'Brad King2020-03-201-10/+9
|\ | | | | | | | | | | | | 8affe9aa33 export: Fix use-after-free on multiple calls overwriting same FILE Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4494
| * export: Fix use-after-free on multiple calls overwriting same FILEBrad King2020-03-191-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | cmMakefile::AddCacheDefinition: Add overload that accepts std::string valueVitaly Stakhovsky2020-03-111-2/+2
|/
* Generator: Don't allow Ninja Multi-Config variables on other generatorsKyle Edwards2020-02-271-0/+35
| | | | | | 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: Fix issue with framework dependencies and AutogenKyle Edwards2020-02-171-1/+1
| | | | Fixes: #20345
* Refactor: Allow generators to decide default configuration for buildKyle Edwards2020-02-041-2/+6
| | | | And allow them to read any cache values they need.
* Merge topic 'ninja-1.10'Brad King2020-01-281-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | ccaa0bccc4 Ninja: Do not clean metadata when re-generating inside a running build 657820a00b Ninja: Track when running to re-generate during a build b12b013028 Ninja: Factor metadata cleanup into dedicated method 5d92e60d81 Ninja: Skip cleandead and recompact if build.ninja is missing dd0a4718fd Ninja: Fix CMAKE_NINJA_OUTPUT_PATH_PREFIX with Ninja 1.10 0944caaebb Tests: Fix RunCMake.CMP0037 test with Ninja 1.10 9d4883cce5 Tests: Fix RunCMake.Ninja test for Ninja 1.10 Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4290
| * Ninja: Track when running to re-generate during a buildBrad King2020-01-271-0/+1
| | | | | | | | | | Tell CMake explicitly when it is re-running inside a `ninja` invocation to re-generate the build system.
* | AppendProperty: convert value param to std::stringVitaly Stakhovsky2020-01-251-1/+3
|/
* Merge topic 'realpath-cache'Brad King2020-01-201-0/+11
|\ | | | | | | | | | | | | 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/+11
| | | | | | | | | | Cache the results of `realpath()` system calls in `cmGlobalGenerator` to avoid repeating such calls for the same paths over and over.
* | Merge topic 'cmake-ctest-arguments'Brad King2020-01-171-0/+7
|\ \ | | | | | | | | | | | | | | | | | | 4153d8445b Add CMAKE_CTEST_ARGUMENTS variable to pass command-line arguments to ctest Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4168
| * | Add CMAKE_CTEST_ARGUMENTS variable to pass command-line arguments to ctestRobert Goulet2020-01-151-0/+7
| | | | | | | | | | | | Fixes: #20172
* | | cmMakefile: modernize memory managementMarc Chevrier2020-01-141-4/+4
|/ /
* | GlobalGenerator family: modernize memory managementMarc Chevrier2020-01-071-2/+2
| |
* | cmGlobalGenerator: modernize memrory managemenbtMarc Chevrier2019-12-301-34/+37
|/
* Merge topic 'stdstring-target'Brad King2019-12-171-1/+1
|\ | | | | | | | | | | | | c34b4497f8 cmTarget: add std::string overloads Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4137
| * cmTarget: add std::string overloadsVitaly Stakhovsky2019-12-141-1/+1
| |
* | Ninja: Add multi-config variantKyle Edwards2019-12-131-1/+3
|/ | | | Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
* cmLocalGenerator: modernize memory managementMarc Chevrier2019-12-091-35/+33
|
* Merge branch 'backport-unity-object-libraries' into unity-object-librariesBrad King2019-12-081-1/+12
|\
| * Unity: Proper handling of object librariesCristian Adam2019-12-071-0/+9
| | | | | | | | Fixes: #20051
| * Unity/PCH: Skip more target types when adding automatic sourcesCristian Adam2019-12-071-1/+3
| | | | | | | | | | Besides INTERFACE_LIBRARY, skip also UTILITY and GLOBAL_TARGET target types
* | cmCustomCommand: Explicitly pass backtrace on constructionDaniel Eiband2019-11-241-2/+2
| |
* | cmMakefile: Delay CheckTargetProperties and FinalPass to generate timeDaniel Eiband2019-11-241-18/+17
| |
* | FileAPI: Add "multiConfig" parameter to index fileKyle Edwards2019-11-201-0/+1
| |
* | cmLocalGenerator: modernize memory managementMarc Chevrier2019-11-111-17/+19
| |
* | cmake: Teach --build mode to load CMAKE_GENERATOR_TOOLSETAlexander Boczar2019-10-151-2/+2
|/ | | | | Extend the `cmGlobalGenerator::SetGeneratorToolset` signature to indicate when it is called from `cmake::build`.
* PCH: Generate sources during Compute stepCristian Adam2019-10-091-0/+1
|
* file(GENERATE): Create output file structures even earlierBrad King2019-10-071-8/+1
| | | | | | | | | | | | | | 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/+18
| | | | | | | | 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-4/+6
|\ | | | | | | | | | | | | | | | | | | 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-4/+6
| | | | | | | | | | 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/+40
|/ | | | | Reusable precompile headers require specific COMPILE_PDB_NAME property values. Report error if the user tries to set a different value.