summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Ninja: Generate scripts for long custom command sequencesRoger Leigh2018-02-061-1/+8
| | | | | | | | | | | | Ninja runs just one command line for every build statement, so the Ninja generator needs to `&&`-chain multiple commands together into one long string. For long custom command sequences this can exceed the maximum command-line length for the operating system. In such cases, write the commands out to a script instead, and then run the script from Ninja's one command line. Co-Author: Brad King <brad.king@kitware.com> Fixes: #15612
* Makefile,Ninja: De-duplicate ComputeObjectFilenames methodBrad King2018-01-291-5/+0
| | | | | Move the method implementation up to `cmLocalCommonGenerator` to avoid duplicating it in each generator.
* Use C++11 override instead of CM_OVERRIDEBrad King2017-09-151-7/+7
| | | | | | | | We now require C++11 support including `override`. Drop use of the old compatibility macro. Convert references as follows: git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' | xargs sed -i 's/CM_OVERRIDE/override/g'
* clang-format: format all code as Cpp11Daniel Pfeifer2017-08-301-1/+1
|
* IWYU: Mark cmConfigure.h with pragma: keepDaniel Pfeifer2017-08-261-1/+1
| | | | Also remove `#include "cmConfigure.h"` from most source files.
* Use C++11 nullptrDaniel Pfeifer2017-08-241-1/+1
|
* ninja: break unnecessary target dependenciesBen Boeckel2017-04-211-1/+3
| | | | | | | | | | | | | | | | | | Previously, given two libraries, X and Y where X depends on Y, all object compilations of X would require the Y library to have been linked before being compiled. This is not necessary and can instead be loosened such that object compilations of X only depend on the order-only dependencies of Y to be completed. This is to ensure that generated sources, headers, custom commands, etc. are completed before X starts to compile its objects. This should help build performance in projects with many libraries which cause a deep library dependency chain. Previously, a library at the bottom would not start compilation until after all other libraries completed, but now only its link step needs to wait and its compilation jobs can be run in parallel with other tasks. Fixes: #15555
* Use quotes for non-system includesDaniel Pfeifer2017-04-111-1/+1
| | | | | | | | | | | | | Automate with: git grep -l '#include <cm_' -- Source \ | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g' git grep -l '#include <cmsys/' -- Source \ | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g' git grep -l '#include <cm[A-Z]' -- Source \ | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
* Fix several include-what-you-use findingsDaniel Pfeifer2016-11-081-5/+5
|
* cmRulePlaceholderExpander: Port clients to direct-useStephen Kelly2016-10-151-0/+2
| | | | | | Add a factory function to cmLocalGenerator so that variableMappings can be provided from it, and so that Ninja can always have a hard-coded TargetImpLib.
* cmLocalGenerator: Remove the launcher from RuleVariablesStephen Kelly2016-10-151-6/+0
| | | | | | | | | This one is not like the others as it doesn't participate in substitutions. Keep ExpandRuleVariables doing only one thing and make callers responsible for inserting a launcher prefix, simplifying the code all-around. Remove now-obsolete InsertRuleLauncher method.
* cmLinkLineComputer: Extract from cmLocalGeneratorStephen Kelly2016-10-101-2/+0
| | | | | | | | | | | CMake has several classes which have too many responsibilities. cmLocalGenerator is one of them. Start to extract the link line computation. Create generator-specific implementations of the interface to account for generator-specific behavior. Unfortunately MSVC60 has different behavior to everything else and CMake still generates makefiles for it. Isolate it with MSVC60-specific names.
* cmLocalGenerator: Simplify ConvertToLinkReferenceStephen Kelly2016-10-061-3/+1
| | | | | Make conversion to output format the caller responsibility, so that the method only 'converts to a link reference'.
* Simplify CMake per-source license noticesBrad King2016-09-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* fix a load of include-what-you-use violationsDaniel Pfeifer2016-09-031-2/+16
|
* use CM_NULLPTRDaniel Pfeifer2016-06-281-1/+1
|
* mark functions with CM_OVERRIDEDaniel Pfeifer2016-06-271-11/+11
|
* Use enums defined in cmOutputConverter using their fully qualified name.Daniel Pfeifer2016-05-251-5/+7
| | | | | | | | | Mostly automated: values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT" "OutputFormat" "UNCHANGED" "MAKERULE" "SHELL" "WATCOMQUOTE" "RESPONSE" "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree") for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
* Revise C++ coding style using clang-formatKitware Robot2016-05-161-12/+13
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * 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.
* Source: Stabilize include orderBrad King2016-04-291-3/+4
| | | | | Each source file has a logical first include file. Include it in an isolated block so that tools that sort includes do not move them.
* Ninja: Fix non-determinism in generated build statement order (#15968)Brad King2016-02-111-0/+1
| | | | | | Generate custom command build statements in the order we encounter source files specifying them. Do not depend on pointer values of internally allocated structures for ordering.
* Ninja: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-4/+5
|
* cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget.Stephen Kelly2015-10-141-1/+2
|
* Ninja: Centralize path conversion in global generator (#15757)Brad King2015-09-251-15/+0
| | | | | | | | | | | | | | | | | In the Ninja generator we run all build rules from the top of the build tree rather than changing into each subdirectory. Therefore we convert all paths relative to the HOME_OUTPUT directory. However, the Convert method on cmLocalGenerator restricts relative path conversions to avoid leaving the build tree with a "../" sequence. Therefore conversions performed for "subdirectories" that are outside the top of the build tree always use full paths while conversions performed for subdirectories that are inside the top of the build tree may use relative paths to refer to the same files. Since Ninja always runs rules from the top of the build tree we should convert them using only the top-level cmLocalGenerator in order to remain consistent. Also extend the test suite with a case that fails without this fix.
* cmLocalGenerator: Create from already-constructed cmMakefile.Stephen Kelly2015-08-281-2/+1
| | | | Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
* cmLocalGenerator: Remove Parent pointer.Stephen Kelly2015-08-281-1/+1
|
* cmLocalCommonGenerator: Adopt ConfigName memberBrad King2015-07-091-6/+0
| | | | De-duplicate the member from the local Makefile and Ninja generators.
* Add common base classes to Makefile and Ninja generatorsBrad King2015-07-091-2/+2
| | | | Provide a place to move functionality common to both.
* cmLocalGenerator: De-virtualize Configure().Stephen Kelly2015-06-041-2/+0
| | | | | The generators that override it do so in order to populate data members which can instead be populated in Generate().
* cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.Stephen Kelly2015-05-271-1/+2
| | | | | | | | | | | Refactor the local generator creation API to accept a cmState::Snapshot. Adjust MakeLocalGenerator to use the 'current' snapshot in cases where there is no parent. Create the snapshot for subdirectories in cmMakefile::AddSubdirectory. This means that snapshots are now created at the point of extending the tree, as appropriate, and independently of the cmLocalGenerator and cmMakefile they represent the state for.
* Ninja: Remove some bogus comments.Stephen Kelly2015-05-231-9/+0
| | | | | | The virtual methods are overrides not overloads, the constructor is no longer a default variant, the destructor and GetCMakeInstance comments add no value, only a typo.
* cmLocalGenerator: Add abstraction to check if top-level.Stephen Kelly2015-05-141-3/+0
| | | | Move from the cmLocalNinjaGenerator. Fix the case of the name.
* cmLocalGenerator: Require a global generator in the constructor.Stephen Kelly2015-05-141-1/+1
| | | | Port generator factory methods to pass it.
* cmLocalGenerator: Require a parent in the constructor.Stephen Kelly2015-04-281-1/+1
| | | | | | | Pass the parent though cmGlobalGenerator::CreateLocalGenerator. This will make it easy to initialize state scopes independent of cmMakefile.
* strings: Remove redundant calls to std::string::c_str()Nils Gladitz2014-10-151-1/+1
| | | | | Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
* Ninja: Fix RC include directories regressionBrad King2014-10-131-1/+2
| | | | | | | | | | | | | | | | | Changes in commit b9aa5041 (cmLocalGenerator: Simplify GetIncludeFlags output formatting, 2014-03-04) caused Windows Resource Compiler include directories to be computed as relative paths in the Ninja generator. This breaks the cmcldeps handling of include paths. The reason for the regression is that several cmLocalGenerator::GetIncludeFlags callers treated the fourth "bool forResponseFile" argument as if it controlled whether include directories were a full path. It actually did control that by accident until the above commit. Add an explicit "bool forceFullPaths" argument to GetIncludeFlags and thread the value through ConvertToIncludeReference as needed. Update GetIncludeFlags call sites that really wanted to control the forResponseFile setting to be aware of the new argument. Extend the VSResource test to cover this case.
* Ninja: Use 'console' pool for CMake re-run if possible (#14915)Sylvain Joubert2014-10-031-0/+1
| | | | | | | | | The pre-defined 'console' pool is a non-buffered pool that runs with a depth of 1. CMake re-run cannot be run concurrently and it will eventually output something. A non-buffered pool allows to get it as soon as possible Also, generate the minimal required version of Ninja in the build file.
* ninja: Use string parametersBen Boeckel2014-05-021-1/+1
|
* cmLocalGenerator: Add ComputeObjectFilenames interface.Stephen Kelly2014-03-131-0/+4
| | | | | Implement it in the local generators and use it in the global generators.
* Generalize cmCustomCommandGenerator to more fieldsBrad King2014-03-121-3/+4
| | | | | | | Until now the cmCustomCommandGenerator was used only to compute the command lines of a custom command. Generalize it to get the comment, working directory, dependencies, and outputs of custom commands. Update use in all generators to support this.
* stringapi: Return a string reference for the configurationBen Boeckel2014-03-081-2/+2
|
* cmLocalGenerator: Add format option to ConvertToLinkReferenceBrad King2014-03-041-1/+2
| | | | Replace the hard-coded SHELL output format with an optional argument.
* cmLocalGenerator: Add format option to ConvertToIncludeReferenceBrad King2014-03-041-1/+2
| | | | Replace the hard-coded SHELL output format with an optional argument.
* Ninja: job pool support for compiling and linkingPeter Kümmel2013-11-251-0/+1
| | | | | Could be tested by setting the environment variable NINJA_STATUS=[%r]
* Ninja: run custom commands through launcher if availableNils Gladitz2013-10-311-0/+1
|
* Ninja: void function can't return a valuePeter Kümmel2012-07-191-2/+2
|
* Ninja: remove 'friend' in ninja codePeter Kümmel2012-07-181-31/+31
|
* Pre-compute object file names before Ninja generationBrad King2012-03-161-3/+0
| | | | | | Implement cmGlobalGenerator::ComputeTargetObjects in the Ninja generator to pre-compute all the object file names. Use the results during generation instead of re-computing it later.
* Ninja: Constify use of cmCustomCommandBrad King2012-03-131-3/+3
| | | | The generator never needs to modify custom command instances.
* Ninja: Add friend struct so it can access the private ConvertToNinjaPath.David Cole2012-03-071-0/+2
| | | | | The HP aCC compiler is apparently more strict than all our other dashboard compilers with respect to complaining about this.