summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Modernize: Enable modernize-raw-string-literal in clang-tidyArtur Ryt2019-04-021-3/+3
|
* cmake_ninja_dyndep: don't duplicate slashesBen Boeckel2019-03-121-1/+1
|
* cmake: Teach --build mode to support multiple targetsBartosz Kosiorek2019-03-051-11/+17
| | | | Fixes: #16136
* cmGlobalGenerator: Change case of methods from GeneratedMakeCommand structBartosz Kosiorek2019-03-041-6/+6
|
* ninja: name dyndep internal files using the object fileBen Boeckel2019-02-251-4/+4
| | | | | Now that preprocessing outputs are not necessarily used all the way through, the output name is a better base name to use for these files.
* ninja: pass language to cmake_ninja_dependsBen Boeckel2019-02-251-37/+82
|
* ninja: make dyndep generation language awareBen Boeckel2019-02-251-11/+20
| | | | | A target may have multiple languages with dyndep rules, separate `.dd` files should be generated.
* Merge topic 'cmrange-improvements'Brad King2019-02-251-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | b8031308f3 cmRange: Add unit tests a8d51ef8b7 cmRange: Add functions filter and transform da4773e8b8 cmRange: Add functions all_of, any_of, none_of 17a367e77f cmRange: Stylistic cleanup 9eb0e73f46 cmRange: Move to dedicated header file Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Artur Ryt <artur.ryt@gmail.com> Merge-request: !2972
| * cmRange: Move to dedicated header fileRegina Pfeifer2019-02-211-0/+1
| |
* | cmSystemTools::Error: consolidate parameters into single std::stringVitaly Stakhovsky2019-02-201-31/+24
|/
* Merge topic 'fortran-submodule-names'Brad King2019-02-141-1/+11
|\ | | | | | | | | | | | | | | | | | | d80ecba5c2 Fortran: Fix submodule file names across compilers 72057d9c15 Fortran: Thread compiler id through to internal Fortran parser 7ae329e2ed Fortran: Factor out .mod and .smod file name construction Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Michael Hirsch, Ph.D. <michael@scivision.co> Merge-request: !2958
| * Fortran: Fix submodule file names across compilersBrad King2019-02-141-0/+6
| | | | | | | | | | | | | | | | | | The naming convention for submodule files varies across compilers. Add a table to the compiler information modules and thread the information through to the Fortran module dependency parser. Fill out the table for compiler ids known to support Fortran submodules. Fixes: #18746
| * Fortran: Thread compiler id through to internal Fortran parserBrad King2019-02-141-1/+5
| |
* | Modernize: Use ranged for-loops when possibleArtur Ryt2019-02-071-2/+1
|/ | | | | | | Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
* Ninja: Detect when ninja is new enough to support a multi-line depfileBrad King2019-01-301-0/+9
| | | | | | Ninja 1.9 supports the multi-line depfile format generated by the Intel Compiler for Windows. Teach the global generator to detect when the version is new enough to support this.
* Merge topic 'add_consistent_verbose_build_flag'Brad King2019-01-291-10/+7
|\ | | | | | | | | | | | | | | | | | | | | | | 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-10/+7
| | | | | | | | | | | | 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.
* | cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.Bruno Manganelli2019-01-271-1/+1
|/
* clang-tidy: Use emplaceRegina Pfeifer2019-01-171-5/+5
|
* Properties: Add CMAKE_ROLE global propertyKyle Edwards2019-01-171-1/+1
| | | | | This property allows scripts to determine whether they're in project mode, script mode, find-package mode, CTest, or CPack.
* Factor out enum MessageType into dedicated headerBruno Manganelli2019-01-161-5/+9
| | | | Reduce the number of files relying on `cmake.h`.
* clang-tidy: Remove redundant member initializationsRegina Pfeifer2018-12-151-2/+0
|
* clang-tidy: Fix readability-static-accessed-through-instanceRegina Pfeifer2018-11-211-3/+5
| | | | Enable the check in .clang-tidy and fix all warnings.
* clang-tidy: fix warnings from version 7Regina Pfeifer2018-11-201-3/+3
| | | | | Fix some warnings that are new since clang-tidy version 4, and update `.clang-tidy` to suppress the rest.
* Using front() and back() instead of calculationsCengizhan Pasaoglu2018-11-061-1/+1
|
* add_dependencies: Track backtraces internallyBrad King2018-10-181-3/+5
| | | | | Record backtraces for "utility" dependencies created by `add_dependencies` calls.
* Merge topic 'provide_explicit_source_and_build_command_line_options'Brad King2018-09-191-1/+1
|\ | | | | | | | | | | | | | | | | 638f00117a Add release note for the -S and -B options. de962cc00d CMake: Internally uses -S instead of -H to specify source directory a10d63d578 cmake: -S and -B can be used to specify source and build directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2358
| * CMake: Internally uses -S instead of -H to specify source directoryRobert Maynard2018-09-151-1/+1
| |
* | cmMakefile: Make GetSafeDefinition return std::string const&Vitaly Stakhovsky2018-09-181-6/+6
|/
* Merge topic 'lg-directory'Brad King2018-08-281-2/+1
|\ | | | | | | | | | | | | 50fbfee3a0 cmLocalGenerator: return directories as const std::string& Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2309
| * cmLocalGenerator: return directories as const std::string&Vitaly Stakhovsky2018-08-271-2/+1
| |
* | Merge topic 'ninja-generator-do-not-add-alias-matching-custom-command-output'Brad King2018-08-271-0/+6
|\ \ | |/ |/| | | | | | | | | | | 180c2f8de8 Ninja: Fix dupbuild error skipping alias with conflicting custom command Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Isaiah <isaiah.norton@gmail.com> Merge-request: !2276
| * Ninja: Fix dupbuild error skipping alias with conflicting custom commandJean-Christophe Fillion-Robin2018-08-091-0/+6
| | | | | | | | | | | | See-also: https://issues.slicer.org/view.php?id=4595 Reported-by: Isaiah Norton <inorton@bwh.harvard.edu>
* | cmGeneratedFileStream: clang-tidy applied to remove redundant ``c_str`` callsSebastian Holtermann2018-08-071-8/+7
|/ | | | | | | | | | | | | | | After changing the ``cmGeneratedFileStream`` methods to accept ``std::string const&`` instead of ``const char*`` we don't need to call ``std::string::c_str`` anymore when passing a ``std::string`` to a ``cmGeneratedFileStream`` method. This patch removes all redundant ``std::string::c_str`` calls when passing a string to a ``cmGeneratedFileStream`` method. It was generated by building CMake with clang-tidy enabled using the following options: -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy-4.0;-checks=-*,readability-redundant-string-cstr;-fix;-fix-errors
* Revise C++ coding style using clang-format-6.0Kitware Robot2018-06-011-3/+4
| | | | | | | | | | | | Run the `clang-format.bash` script to update all our C and C++ code to a new style defined by `.clang-format`. Use `clang-format` version 6.0. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* cmake: Add options for parallel builds to --build modeFlorian Maushart2018-05-251-1/+7
| | | | | | | While we already support `cmake --build . -- -j`, the options after `--` are specific to the native build tool. Add new options `--parallel [<N>]` and `-j [<N>]` to abstract this and map to the proper option for the native build tool.
* Ninja: Make assumed source dependencies order-onlyBrad King2018-04-261-3/+5
| | | | | | | | | | | Since its beginning the Ninja generator has handled `GENERATED` source files that have no custom command producing them by writing a dummy custom command for them that depends on the target ordering phony edge. Make the custom command's dependency order-only since the phony edge also has only order-only dependencies. The dummy custom command should never be considered "dirty" by `ninja`. Fixes: #17942
* Fortran: Refactor to treat .mod extension as part of module nameBrad King2018-04-201-1/+1
| | | | | | When tracking module names internally, include the `.mod` extension. This will later be useful to distinguish them from `.smod` extensions for submodules.
* Ninja: Drop unnecessary ident encoding logic for pathsBrad King2018-04-191-31/+9
| | | | | | The only uses of `EncodeIdent` are surrounding `EncodePath`, but the special ident encoding is not needed for path contexts in a ninja build manifest.
* Add glob verify support to XCode, VS, Ninja, and Makefile generatorsShane Parris2018-04-021-6/+71
|
* Document and extend the CMAKE_SUPPRESS_REGENERATION variableShane Parris2018-02-231-5/+10
| | | | Fixes: https://gitlab.kitware.com/cmake/cmake/issues/16815
* Ninja: Don't add custom command outputs to phony rule for CMake inputsPatrick Stewart2018-02-151-1/+7
|
* Reduce raw string pointers usage.Pavel Solodovnikov2018-01-311-2/+2
| | | | | | | | | | * Change some functions to take `std::string` instead of `const char*` in the following classes: `cmMakeFile`, `cmake`, `cmCoreTryCompile`, `cmSystemTools`, `cmState`, `cmLocalGenerator` and a few others. * Greatly reduce using of `const char*` overloads for `cmSystemTools::MakeDirectory` and `cmSystemTools::RelativePath`. * Remove many redundant `c_str()` conversions throughout the code.
* Reduce allocation of temporary values on heap.Pavel Solodovnikov2018-01-261-1/+1
| | | | | - Use `std::move` while inserting temporary results into vectors. - Change `push_back` to `emplace_back` where appropriate.
* cmGlobalNinjaGenerator: Avoid using deprecated std::ptr_funBrad King2017-12-211-2/+1
| | | | It was deprecated by C++11 and removed by C++17. Use a C++11 lambda.
* Retire std::auto_ptr and its macro CM_AUTO_PTRMatthias Maennich2017-09-251-5/+6
| | | | Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Ninja: Cache ConvertToNinjaPath results to avoid repeat workMatthias Maennich2017-09-191-4/+10
| | | | | | | | | | | | Calls to this method may dominate generation time in some cases. Measurements for configuring cmake itself show a cache hit rate of ~57% (7753 total calls, 4453 cache hits). For a larger project (that also makes use of custom targets as prerequisite for all compile targets), the measured cache hit ratio is ~96% (2530827 total calls, 2433124 cache hits). For this project the observable cmake runtime could be reduced from 40s to 30s. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Ninja: Improve performance with deeply-dependent custom targetsMatthias Maennich2017-09-191-23/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit v3.7.0-rc1~339^2 (Ninja: Fix inter-target order-only dependencies of custom command, 2016-07-20) might cause performance degradations for larger projects. Especially when using custom commands as an input for each compilation rule (e.g. generated headers). For reference in the following I am referring to Source/cmGlobalNinjaGenerator.cxx: -> cmGlobalNinjaGenerator::AppendTargetDependsClosure -> cmGlobalNinjaGenerator::ComputeTargetDependsClosure It turned out that the mentioned commit is doing (indirectly) some redundant work that might impact performance when generating large projects. Imagine the dependency tree of custom targets: A \ C - D - E / B For each target the transitive closure is calculated recursively, but as the TargetDependsClosures are only cached on the top most level, everything downstream has to be recalculated. I.e. A->C->D->E B->C->D->E This ultimately leads to a lot of redundant calls to AppendTargetOutputs. The recursive nature of the algorithm itself is not significant to the problem, but reducing the work to actually to be done work, eliminates the performance problem. This patch changes the way, intermediate results are cached. Rather than caching the closure of targets, we cache the closure of outputs. Such that in the example above at B->C the cache already would kick in. Caching the outputs has one disadvantage that the patch takes care of. In case of such a structure A E \ / \ C - D G / \ / B F the calling order for A would be A->C->D->E->G (at which time G is seen to the recursion) then the recursion returns until it reaches A->C->D->F (at which the seen G would prevent to recurse down to G) But this would poison the cache for F with a wrong value (without G). Hence we use a local result set to ensure the cache is still consistently populated. For a large C++ project with around 25k targets this reduced the CMake configure / generate time from ~40s to ~29s. Signed-off-by: Matthias Maennich <matthias@maennich.net>
* Meta: modernize old-fashioned loops to range-based `for`.Pavel Solodovnikov2017-09-121-170/+113
| | | | | | Changes done via `clang-tidy` with some manual fine-tuning for the variable naming and `auto` type deduction where appropriate.
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-2/+2
|