summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Ninja: Always re-run custom commands that have symbolic dependenciesBrad King2015-11-191-1/+11
| | | | | | | | | | | | If a custom command has a SYMBOLIC output (that is never actually created) then do not mark the custom command build statement as 'restat'. Otherwise other custom commands that depend on the symbolic output may not always re-run because after running the first custom command Ninja 'restat' will detect that the output timestamp did not change and skip its dependents. This was observed with the ExternalProject BUILD_ALWAYS option where Ninja would not re-run the 'install' step each time 'build' re-runs.
* Ninja: Add 'restat' parameter to custom command generation methodBrad King2015-11-191-0/+1
| | | | Pass 'true' from all call sites to preserve existing behavior.
* Merge topic 'minor-cleanups'Brad King2015-10-281-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 13a37f5f cmMakefile: Fix typo in comment 958508bb cmMakefile: Fix style 91a829c1 Makefiles: Remove unused variable e0213882 cmTarget: Remove obsolete member 0554c2c9 cmTarget: Fix style b22e5d0a Remove some obsolete declarations ce43ed2c Use LocalGenerator when possible d90c9738 Makefiles: Remove some unneeded casts 331023ae Export: Remove unused variable a03f3d0e cmFunctionBlocker: Constify method d50c4220 Xcode: Fix typo in comment 803f1901 Xcode: Remove trailing semicolon
| * Use LocalGenerator when possibleStephen Kelly2015-10-261-1/+1
| |
* | cmLocalGenerator: Add IsRootMakefile APIStephen Kelly2015-10-271-2/+2
|/
* Ninja: Port to cmGeneratorTarget.Stephen Kelly2015-10-241-5/+5
|
* cmLocalGenerator: Store a vector of generator targets.Stephen Kelly2015-10-211-6/+6
| | | | Not a map from cmTarget to cmGeneratorTarget.
* cmLocalGenerator: Don't store imported generator targetsStephen Kelly2015-10-201-2/+1
| | | | | No consumers need them. This makes GetGeneratorTargets more comparable to cmMakefile::GetTargets, which does not include imported targets.
* Merge topic 'clean-up-cmTarget'Brad King2015-10-161-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 55474e61 cmState: Move GetTargetTypeName from cmTarget. 38df5c36 Remove now-obsolete casts. 4ee2b267 cmGeneratorTarget: Use enum for GetType. eac15298 cmState: Move TargetType enum from cmTarget. 482b3811 cmTarget: Move link type enum out. 2ee1cb85 cmTarget: Move ImportInfoMap out of internal class. a48bcabd cmTarget: Move backtrace member out of internal class. 6694d993 cmTarget: Remove unneeded constructors. 983c00f8 Generators: Use GetType from the cmGeneratorTarget.
| * cmState: Move TargetType enum from cmTarget.Stephen Kelly2015-10-141-1/+1
| | | | | | | | | | | | | | Mostly automated: values=( "EXECUTABLE" "STATIC_LIBRARY" "SHARED_LIBRARY" "MODULE_LIBRARY" "OBJECT_LIBRARY" "UTILITY" "GLOBAL_TARGET" "INTERFACE_LIBRARY" "UNKNOWN_LIBRARY" "TargetType") for i in "${values[@]}"; do git grep -l cmTarget::$i | xargs sed -i "s|cmTarget::$i|cmState::$i|g"; done
| * Generators: Use GetType from the cmGeneratorTarget.Stephen Kelly2015-10-141-1/+1
| |
* | cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget.Stephen Kelly2015-10-141-2/+2
|/
* cmLocalGenerator: Store cmGeneratorTargets.Stephen Kelly2015-10-141-1/+1
| | | | Relieve cmMakefile of this responsibility.
* cmLocalGenerator: Add current binary directory accessor.Stephen Kelly2015-10-101-1/+1
|
* cmLocalGenerator: Add GetProjectName method.Stephen Kelly2015-10-081-1/+1
|
* Ninja: Centralize path conversion in global generator (#15757)Brad King2015-09-251-12/+6
| | | | | | | | | | | | | | | | | 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/+2
| | | | Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
* cmLocalGenerator: Remove Parent pointer.Stephen Kelly2015-08-281-2/+1
|
* Merge topic 'rm-Makefile-LocalGenerator'Brad King2015-08-111-1/+1
|\ | | | | | | | | | | 1689c91d cmMakefile: Remove unused method. dd11f72c cmGlobalGenerator: Base exclusion computation on cmGeneratorTarget.
| * cmGlobalGenerator: Base exclusion computation on cmGeneratorTarget.Stephen Kelly2015-08-061-1/+1
| |
* | Ninja: Centralized required Ninja version numbers and comparisons.James Johnston2015-08-091-7/+5
|/
* cmCustomCommandGenerator: Require cmLocalGenerator in API.Stephen Kelly2015-07-271-1/+1
|
* cmLocalCommonGenerator: Adopt ConfigName memberBrad King2015-07-091-17/+0
| | | | De-duplicate the member from the local Makefile and Ninja generators.
* Add common base classes to Makefile and Ninja generatorsBrad King2015-07-091-1/+1
| | | | Provide a place to move functionality common to both.
* cmMakefile: Move IsRoot API from cmLocalGenerator.Stephen Kelly2015-06-211-2/+2
|
* cmLocalGenerator: De-virtualize Configure().Stephen Kelly2015-06-041-19/+9
| | | | | 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-2/+3
| | | | | | | | | | | 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.
* cmMakefile: Port CurrentListFile clients to GetDefinition.Stephen Kelly2015-05-191-2/+2
| | | | There is no need to store this as a member variable.
* cmLocalGenerator: Add abstraction to check if top-level.Stephen Kelly2015-05-141-7/+2
| | | | Move from the cmLocalNinjaGenerator. Fix the case of the name.
* cmGlobalGenerator: Move some flags from cmLocalGenerator.Stephen Kelly2015-05-141-3/+0
| | | | | These flags are global, and so they belong here instead of being set on each local generator.
* cmLocalGenerator: Require a global generator in the constructor.Stephen Kelly2015-05-141-2/+3
| | | | Port generator factory methods to pass it.
* cmLocalGenerator: Require a parent in the constructor.Stephen Kelly2015-04-281-2/+2
| | | | | | | Pass the parent though cmGlobalGenerator::CreateLocalGenerator. This will make it easy to initialize state scopes independent of cmMakefile.
* cmMakefile: Port users of GetStart* methods to new names.Stephen Kelly2015-04-201-2/+2
|
* Port Global property interaction to cmState.Stephen Kelly2015-04-151-1/+3
|
* cmake: Remove the happy global property scope pattern.Stephen Kelly2015-04-151-2/+1
| | | | | | | | | Global properties are already global in scope, so remove the overload for specifying it and port users of the API. The call from cmMakefile::GetProperty can be simplified because the scope is only used during chaining, and there is no further chaining after processing global properties.
* Ninja: Improve internal check for generating at the top-level (#15436)Brad King2015-03-091-2/+1
| | | | | Simply check for whether the local generator has a parent instead of depending on a string comparison of directory names.
* Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-2/+2
| | | | All compilers hosting CMake support the std class.
* Add an option for explicit BYPRODUCTS of custom commands (#14963)Brad King2014-11-141-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common idiom in CMake-based build systems is to have custom commands that generate files not listed explicitly as outputs so that these files do not have to be newer than the inputs. The file modification times of such "byproducts" are updated only when their content changes. Then other build rules can depend on the byproducts explicitly so that their dependents rebuild when the content of the original byproducts really does change. This "undeclared byproduct" approach is necessary for Makefile, VS, and Xcode build tools because if a byproduct were listed as an output of a rule then the rule would always rerun when the input is newer than the byproduct but the byproduct may never be updated. Ninja solves this problem by offering a 'restat' feature to check whether an output was really modified after running a rule and tracking the fact that it is up to date separately from its timestamp. However, Ninja also stats all dependencies up front and will only restat files that are listed as outputs of rules with the 'restat' option enabled. Therefore an undeclared byproduct that does not exist at the start of the build will be considered missing and the build will fail even if other dependencies would cause the byproduct to be available before its dependents build. CMake works around this limitation by adding 'phony' build rules for custom command dependencies in the build tree that do not have any explicit specification of what produces them. This is not optimal because it prevents Ninja from reporting an error when an input to a rule really is missing. A better approach is to allow projects to explicitly specify the byproducts of their custom commands so that no phony rules are needed for them. In order to work with the non-Ninja generators, the byproducts must be known separately from the outputs. Add a new "BYPRODUCTS" option to the add_custom_command and add_custom_target commands to specify byproducts explicitly. Teach the Ninja generator to specify byproducts as outputs of the custom commands. In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets that link, the byproducts must be specified as outputs of the link rule that runs the commands. Activate 'restat' for such rules so that Ninja knows it needs to check the byproducts, but not for link rules that have no byproducts.
* Ninja: Implement USES_TERMINAL using the console pool if availablePeter Collingbourne2014-11-141-0/+1
|
* 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-2/+3
| | | | | | | | | | | | | | | | | 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/+25
| | | | | | | | | 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/+14
| | | | | Implement it in the local generators and use it in the global generators.
* Generalize cmCustomCommandGenerator to more fieldsBrad King2014-03-121-15/+18
| | | | | | | 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.
* cmCustomCommand: Return std::string from GetWorkingDirectoryBrad King2014-03-121-3/+3
|
* Remove some c_str() calls.Stephen Kelly2014-03-111-5/+5
| | | | | | Use the clang RemoveCStrCalls tool to automatically migrate the code. This was only run on linux, so does not have any positive or negative effect on other platforms.
* cmLocalGenerator: Add format option to ConvertToLinkReferenceBrad King2014-03-041-2/+3
| | | | Replace the hard-coded SHELL output format with an optional argument.
* cmLocalGenerator: Add format option to ConvertToIncludeReferenceBrad King2014-03-041-2/+3
| | | | Replace the hard-coded SHELL output format with an optional argument.
* Merge topic 'ninja-compile-link-pool'Brad King2013-11-261-0/+35
|\ | | | | | | | | 7605e37 Ninja: job pool support for compiling and linking