Commit Graph

280 Commits

Author SHA1 Message Date
Brad King 9e51147646 Merge topic 'global-generator-makefiles'
6d8a125e cmQtAutoGenerators: Prefer a generator to access global generator.
5f66900e cmGlobalGenerator: Port Find API to cmMakefile.
c5b8841f cmGlobalGenerator: Create global targets from cmMakefiles.
8f75ea3b cmGlobalGenerator: Port global target creation to cmMakefile.
56f0540b cmGlobalGenerator: Port Configure-time check to cmMakefile.
19b546ef cmGlobalGenerator: Base final target property computation on Makefiles.
f8be9ba9 cmGlobalGenerator: Base progress on Makefiles, not LocalGenerators.
bc1097e3 cmExportLibraryDependenciesCommand: Port to cmMakefile.
204aecdf cmGlobalGenerator: Port configure-time code to cmMakefile.
3dd6f0a5 cmake: Port configure-time code to cmMakefile.
73e4df99 cmGlobalGenerator: Store a container of cmMakefiles.
19369937 cmGeneratorTarget: Port internal type to cmGeneratorTarget.
32f131b0 cmGeneratorTarget: Prefer the local generator to access the global.
2015-08-11 08:47:10 -04:00
Brad King f33ccc270e Merge topic 'rm-Makefile-LocalGenerator'
1689c91d cmMakefile: Remove unused method.
dd11f72c cmGlobalGenerator: Base exclusion computation on cmGeneratorTarget.
2015-08-11 08:47:05 -04:00
Stephen Kelly 5f66900e71 cmGlobalGenerator: Port Find API to cmMakefile. 2015-08-07 04:10:29 +02:00
Stephen Kelly 73e4df99cb cmGlobalGenerator: Store a container of cmMakefiles.
For use at configure-time.
2015-08-07 04:10:28 +02:00
Stephen Kelly dd11f72ced cmGlobalGenerator: Base exclusion computation on cmGeneratorTarget. 2015-08-07 00:32:15 +02:00
James Johnston afeb4eb243 nmake/jom: Only warn about bad VS environment if compiler not found.
nmake and jom generators no longer warn about missing INCLUDE/LIB
environment variables unless the C/CXX compiler cannot be found.  This
is useful if the user does not want to use these generators with the
Visual C++ compiler, or they do not want to enable any language.
2015-08-06 17:32:43 +00:00
Stephen Kelly 6c0e9ee276 cmMakefile: Store EvaluationFiles.
Relieve the cmGlobalGenerator of this responsibility.  Evaluate
the generator expressions in the context of the cmLocalGenerator.
2015-08-01 13:07:11 +02:00
Stephen Kelly 5edb335485 cmGlobalGenerator: Virtualize the Compute step and override it. 2015-07-30 08:28:31 +02:00
Stephen Kelly fb9355c50e cmGlobalGenerator: Return from Compute whether to generate. 2015-07-29 10:43:33 -04:00
Stephen Kelly 29e8b7bfcc cmGlobalGenerator: Create a new Compute step before generation.
Replace the DoGenerate method.
2015-07-29 10:43:33 -04:00
Stephen Kelly 1ef9b2b600 cmGlobalGenerator: Remove the TargetManifest member. 2015-07-29 10:43:32 -04:00
Stephen Kelly 5c14f78005 cmGlobalGenerator: Remove unused manifest accessor. 2015-07-29 10:43:32 -04:00
Stephen Kelly 570938cbfd cmExportTryCompileFileGenerator: Create cmGeneratorTargets.
This is not a deprecated behavior, but only requires IMPORTED targets
be made.
2015-07-27 21:59:03 +02:00
Stephen Kelly 496f4cd07d cmGlobalGenerator: Create cmGeneratorTargets before QtAutomoc.
Add cmGeneratorTargets as needed in the QtAutomoc processing.
2015-07-27 21:58:49 +02:00
Stephen Kelly 57a69f9341 cmGlobalGenerator: Extract method to create generator objects. 2015-07-27 20:09:39 +02:00
Stephen Kelly 0e0258c8b9 cmGlobalGenerator: Split creation of generator object from initialization. 2015-07-27 20:09:38 +02:00
Stephen Kelly d4a8a554ea cmGlobalGenerator: Map local generators to generator targets. 2015-07-01 19:46:19 +02:00
Stephen Kelly faec4e611d cmComputeTargetDepends: Change API to use cmGeneratorTarget. 2015-07-01 19:46:19 +02:00
Stephen Kelly 8ec60c675a cmGlobalGenerator: Create GeneratorTargets with a local generator. 2015-06-22 13:23:45 -04:00
Stephen Kelly 7f3e16239f cmGlobalGenerator: Re-arrange data layout.
Size goes from 1488 to 1480 bytes.
2015-06-07 10:24:26 +02:00
Brad King 0886880e3b Merge topic 'cmMakefile-Configure'
7657e8b1 cmMakefile: Introduce a local cmMakefile variable.
4e8f242d cmMakefile: Store unconfigured cmMakefiles.
d65e0123 cmMakefile: Implement ConfigureSubDirectory in terms of cmMakefile.
f059ed16 cmMakefile: Move Configure responsibility from cmLocalGenerator.
a653611d cmake: Replace CurrentLocalGenerator concept with CurrentMakefile.
69a038a9 cmMakefile: Refactor directories specified with the subdirs command.
08637970 cmLocalGenerator: ComputeObjectMaxPath just before generating.
27e11c6f Merge Configure state with GeneratingBuildSystem state.
363caa2f cmLocalGenerator: De-virtualize Configure().
2015-06-04 09:13:35 -04:00
Stephen Kelly a653611db0 cmake: Replace CurrentLocalGenerator concept with CurrentMakefile. 2015-06-04 09:06:41 -04:00
Brad King c85367f408 VS: Compute project GUIDs deterministically
Compute deterministic GUIDs that are unique to the build tree by
hashing the path to the build tree with the GUID logical name.
Avoid storing them in the cache, but honor any found there.
This will allow project GUIDs to be reproduced in a fresh build
tree so long as its path is the same as the original, which may
be useful for incremental builds.
2015-06-04 08:40:08 -04:00
Stephen Kelly 3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
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.
2015-05-27 09:18:32 -04:00
Stephen Kelly e12afe766e cmState: Host some state from the cmGlobalGenerator. 2015-05-27 09:18:31 -04:00
Stephen Kelly c7b79aa16a cmGlobalGenerator: Require a cmake instance in ctor.
It is required anyway, so this makes it explicit.
2015-05-27 09:18:31 -04:00
Stephen Kelly aaeec642ca cmGlobalGenerator: De-virtualize methods with no overrides. 2015-05-24 11:09:58 +02:00
Brad King 594dd9b36a Merge topic 'use-std-unordered_map'
d7923b82 Use std::unordered_map instead of hash_map where available.
820777af Tests: Don't rely on ordering of targets in maps.
921d74d8 AutoGen: Don't iterate over a container while populating it.
2015-05-19 11:30:21 -04:00
Stephen Kelly d7923b82ad Use std::unordered_map instead of hash_map where available. 2015-05-19 00:07:02 +02:00
Stephen Kelly 684e5cefb2 cmGlobalGenerator: Host the MakeSilentFlag. 2015-05-18 20:06:20 +02:00
Stephen Kelly b659d161da cmGlobalGenerator: Add NVI wrapper to create local generator. 2015-05-16 05:18:25 +02:00
Stephen Kelly b17686d2bb cmGlobalGenerator: Move some flags from cmLocalGenerator.
These flags are global, and so they belong here instead of being
set on each local generator.
2015-05-14 20:36:28 +02:00
Brad King 957c2aac7f RC: Simplify selection of resource compiler based on C/C++ toolchain
Revert the refactoring by commit v2.8.11~105^2~1 (Ninja: use MinGW
generator code in EnableLanguage, 2013-03-09) and move the MinGW-
specific logic back to the "MinGW Makefiles" generator.  Instead teach
the platform information modules for GNU and MSVC on Windows to set the
preferred RC compiler just before enabling the RC language.  This way
we choose the RC compiler based on the C/C++ toolchain that is actually
enabled.
2015-05-07 11:43:02 -04:00
Brad King a588d1ee99 Merge topic 'fix-cmState-try_compile-languages'
27343e3b cmGlobalGenerator: Finish storing enabled languages in cmState
2015-05-01 13:16:12 -04:00
Brad King 27343e3b68 cmGlobalGenerator: Finish storing enabled languages in cmState
In commit 74de9a73 (cmGlobalGenerator: Delegate storage of enabled
languages to cmState, 2015-04-11) the original LanguageEnabled
member of cmGlobalGenerator was left behind by mistake.  One use
of it in EnableLanguagesFromGenerator (for try_compile) was left,
but the member is not populated anymore.  Drop the member and
teach EnableLanguagesFromGenerator to copy the list of enabled
languages from one cmState to the other.

Reported-by: Matt McCormick <matt.mccormick@kitware.com>
2015-04-30 09:08:25 -04:00
Stephen Kelly a48aebcb67 cmLocalGenerator: Require a parent in the constructor.
Pass the parent though cmGlobalGenerator::CreateLocalGenerator.

This will make it easy to initialize state scopes independent of
cmMakefile.
2015-04-28 07:50:52 +02:00
Stephen Kelly 55ecd818f6 cmGlobalGenerator: Store languages as vector, not map.
The second component of the map is never used.
2015-04-12 20:08:42 +02:00
Gregor Jasny ce935ebe50 cmake: Teach --build to honor CMAKE_VERBOSE_MAKEFILE for Ninja
The Ninja build system does not support a in-file verbositiy switch.
Instead teach 'cmake --build' to extract the CMAKE_VERBOSE_MAKEFILE
setting and pass it as an optional '-v' argument to Ninja.  This can
serve as a reasonable fallback.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-02-26 09:51:11 -05:00
Brad King ce331bab92 find_library: Fix repeat call after changing directory content (#15293)
We use cmGlobalGenerator::GetDirectoryContent to avoid repeating
directory listings.  However, GetDirectoryContent loads content from
disk at most once.  This breaks find_library calls that occur when disk
content has changed since preceding find_library calls.

Teach cmGlobalGenerator::GetDirectoryContent to save the directory
modification time when content is loaded and re-load content if it
changes.

Create a RunCMake.find_library test with a case covering this.
2014-12-08 15:35:50 -05:00
Ruslan Baratov e6db4c5a4e file: Add LOCK subcommand to do file and directory locking
Provide options to fail without blocking or to block up to a timeout.
Provide options to specify the scope containing the lock so it can be
released automatically at the end of a function, file, or process.

Extend the RunCMake.file test with cases covering the file(LOCK) command
usage and error cases.
2014-12-03 09:47:44 -05:00
Peter Collingbourne 4d1fedf46e Give the interactive cache editor the USES_TERMINAL property 2014-11-14 11:56:33 -05:00
Stephen Kelly b80557c7bd file(GENERATE): Evaluate early to allow generating source files
The evaluation files must be known before cmTargetTraceDependencies
attempts to find them, but we must actually generate the files after
cmTargetTraceDependencies, as that can add to target SOURCES.  The
limitation is that the generated output name must not depend on the
SOURCES of a target if the generated file is used by that target.

Mark the output files as GENERATED so that trace dependencies does
not expect them to already exist in the filesystem.

Move the invokation of ForceLinkerLanguage in the Generate logic
to after the generated file names are known.  ForceLinkerLanguage
tries to determine the sources of a target (in order to determine
an already-known language) and otherwise fails to get information
about the generated file.

Test that the output of file(GENERATE) can be used as a target source
file and that accessing the target SOURCES in the name of the output
file is an error.  Accessing the TARGET_OBJECTS would be a similar
error if it was legal to use that generator expression in this
context.  That is not currently possible and is a different error
condition, so test the current error output as a reminder to change
the expected output if that becomes possible in the future.  Test
that generated rule files resulting from cmTargetTraceDependencies
appear in the SOURCES generated in the output file.
2014-11-12 22:36:45 +01:00
Geoff Viola bef23e8181 Fix some spelling errors in comments 2014-10-13 10:00:53 -04:00
Brad King 0f1f1271e6 CMake: Add CMAKE_GENERATOR_PLATFORM option
Reject the option by default.  It will be implemented on a per-generator
basis.  Pass the setting into try_compile project generation.  Add cache
entry CMAKE_GENERATOR_PLATFORM and associated variable documentation to
hold the value persistently.

Add a RunCMake.GeneratorPlatform test to cover basic use cases for the
option.  Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and
that it is rejected when the generator does not support a user setting.
2014-09-05 14:38:05 -04:00
Brad King 30983ebec1 cmGlobalGenerator: Take Build output argument by reference
No call sites pass NULL to the output argument, so take it by
reference to avoid the if(output) conditions.  Propagate the
change through the TryCompile APIs that call it.
2014-07-31 12:49:51 -04:00
Brad King f5c0efdbe4 cmGlobalGenerator: Create a non-virtual 'DoGenerate' method
Make the virtual 'Generate' method protected.  Make 'DoGenerate'
the main entry point to generation.  This gives cmGlobalGenerator
a chance to do some early operations before the individual
generator-specific implementations take over.
2014-07-22 15:05:36 -04:00
Brad King ecb34faaab Tell generators about CMAKE_SYSTEM_NAME as soon as it is known
Add a cmGlobalGenerator::SetSystemName virtual method.  Call it from
cmGlobalGenerator::EnableLanguage as soon as CMAKE_SYSTEM_NAME is known.
This will give generators a chance to adapt themselves to the target
system.  Pass the cmMakefile instance to the method so that the
generator can update it accordingly.  Return early from EnableLanguage
if SetSystemName returns false.
2014-07-17 16:01:41 -04:00
Brad King 8a205b980c cmTarget: Compile old-style link dependencies only for VS 6
Compile all the "ForVS6" cmTarget members only on Windows.  No other
platforms support the VS 6 generator.
2014-07-14 14:39:20 -04:00
Brad King d57be904ae cmTarget: Run old-style link dependencies only for VS 6
Invoke it at runtime only with the VS 6 generator.  No other generators
need it.
2014-07-14 14:38:58 -04:00
Brad King 5fba44cf41 VS: Move VS-only API out of cmGlobalGenerator
Move the IsDependedOn method to cmGlobalVisualStudio7Generator
since that is the only caller.
2014-06-12 10:26:35 -04:00