summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Merge branch 'backport-3.15-fix-EXCLUDE_FROM_ALL-subdir-all'Brad King2019-09-301-1/+1
|\ | | | | | | | | | | | | | | Resolve conflicts with changes since the 3.15 series: * Convert `cmSystemTools::IsOn` => `cmIsOn`. * Move one "EXCLUDE_FROM_ALL" target property logic fix to its new location in `cmMakefile::AddNewUtilityTarget`.
| * Merge branch 'backport-3.14-fix-EXCLUDE_FROM_ALL-subdir-all'Brad King2019-09-301-1/+1
| |\
| | * Restore "all" target in subdirectories marked EXCLUDE_FROM_ALLBrad King2019-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "all" target in each directory is supposed to have targets from that directory even if the directory itself is marked `EXCLUDE_FROM_ALL` in its parent. This was broken by commit dc6888573d (Pass EXCLUDE_FROM_ALL from directory to targets, 2019-01-15, v3.14.0-rc1~83^2) which made the participation of a target in "all" independent of context. Revert much of the logic change from that commit to restore the old behavior. Then re-implement the behavior intended by the commit to keep its test working. Extend the test to cover the old behavior too. Fixes: #19753
* | | Generators: Remove function declarations which do not have a definitionDaniel Eiband2019-09-211-2/+0
| | |
* | | cmExportSet: subsume cmExportSetMap source filesTushar Maheshwari2019-09-191-1/+1
| | |
* | | clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-041-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Automate the conversion with perl -i -0pe 's/typedef ([^;]*) ([^ ]+);/using $2 = $1;/g' then manually fix a few places.
* | | clang-tidy: Replace typedef with usingRegina Pfeifer2019-09-031-2/+2
| | |
* | | Refactor: Convert all instances of CMAKE_BUILD_WITH_CMAKE to CMAKE_BOOTSTRAPKitware Robot2019-08-091-4/+4
| | |
* | | cmStringAlgorithms: Move string functions to the new cmStringAlgorithms.hSebastian Holtermann2019-07-291-0/+1
| | | | | | | | | | | | | | | This adds the `cmStringAlgorithms.h` header and moves all string functions from `cmAlgorithms.h` to `cmStringAlgorithms.h`.
* | | IWYU: Fix handling of <memory> standard headerBrad King2019-07-101-0/+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.
* | | modermize: replace some raw pointers w/ `unique_ptr`Alex Turbov2019-06-241-1/+1
|/ /
* | Swift: disallow WIN32_EXECUTABLE propertiesSaleem Abdulrasool2019-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | Currently, the compiler does not synthesize the correct entry point for the application and passing the subsystem flag does not work the same way with the Swift linker language. Add a check to prevent the application of `WIN32_EXECUTABLE` to Swift executables until they can be properly supported. This will prevent the need for a future policy change. Closes: #19325
* | Use cmAppend to append ranges to std::vector instancesSebastian Holtermann2019-05-231-1/+1
| |
* | Fix invalid ///! doxygen comment line startsSebastian Holtermann2019-03-311-11/+11
| | | | | | | | | | In various places `///!` was used to start a comment line. This is not valid Doygen syntax. This patch replaces `///!` comment starts with `//!`.
* | cmake: Teach --build mode to support multiple targetsBartosz Kosiorek2019-03-051-9/+9
| | | | | | | | Fixes: #16136
* | cmGlobalGenerator: Optimize Printable() method from GeneratedMakeCommandBartosz Kosiorek2019-03-041-14/+1
| |
* | cmGlobalGenerator: Change case of methods from GeneratedMakeCommand structBartosz Kosiorek2019-03-041-3/+3
|/
* Merge topic 'tidy-use-equals-default'Brad King2019-01-291-2/+0
|\ | | | | | | | | | | | | | | | | 094f01d0f0 cleanup: Prefer compiler provided special member functions 55671b41d2 clang-tidy: Use `= default` Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Brad King <brad.king@kitware.com> Merge-request: !2841
| * cleanup: Prefer compiler provided special member functionsRegina Pfeifer2019-01-251-2/+0
| |
| * clang-tidy: Use `= default`Regina Pfeifer2019-01-251-2/+2
| | | | | | | | | | | | Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and `Source/cmUVHandlePtr.h` where a few older compilers require a user-defined default constructor (with `{}`).
* | Merge topic 'add_consistent_verbose_build_flag'Brad King2019-01-291-1/+53
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 66801f4d40 cmake: Add tests for verbose output to --build mode 439fe2e253 cmake: Add options for verbose output to --build mode 638667efa2 cmake: cmcmd.cxx fix "The arguments are" comments 3ca4402966 ctest: Fix --build-and-test without --build-target on Xcode cb6c233ecc cmake: Add -hideShellScriptEnvironment xcodebuild option 1a45266cb5 cmGlobalGenerator: Add a class that represent the build command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2708
| * | cmGlobalGenerator: Add a class that represent the build commandRobert Maynard2019-01-251-1/+53
| |/ | | | | | | | | | | This refactors a std::vector<std::string> into a class so that we can extend the features to represent things such as multiple chained commands in the future.
* | Merge topic 'max-recursion-depth'Brad King2019-01-251-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | a6982cff0d cmMakefile: Impose maximum recursion limit Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Juraj Oršulić <juraj.orsulic@fer.hr> Merge-request: !2746