Commit Graph

297 Commits

Author SHA1 Message Date
Brad King 130f116340 Merge topic 'fix-qtautogen-with-object-library-Ninja'
9bc6eb8e cmGlobalGenerator: Initialize generator targets on construction (#15729)
2015-09-29 10:08:13 -04:00
Brad King ee1b041108 Merge topic 'simplify-qt-autogen'
1fe39020 QtAutogen: Port away from cmLocalGenerator.
59a729b2 QtAutogen: Split initializer class into separate file.
1e83a963 QtAutogen: Split initializer methods into separate class.
12f0e13c QtAutogen: Simplify generator initialization API.
65ff75d3 QtAutogen: Remove unnecessary dereference.
64b78c14 QtAutogen: Move Source initialization to prior loop.
c3c20d3c QtAutogen: Add _automoc.cpp sources before initializing.
8b6ec29d QtAutogen: Move initialization condition to caller.
9470b056 QtAutogen: Move condition to prior loop.
b7491b1c QtAutogen: Move condition to prior loop.
e791c854 QtAutogen: Make some methods static.
6210ec64 QtAutogen: Make internal method private.
a3ceb998 QtAutogen: Don't use members to initialize automoc targets.
dced2fe1 QtAutogen: Rename variable.
f9a77e76 QtAutogen: Don't use a member to store skipped uic files.
c3633e7a QtAutogen: Add missing includes and forward declarations.
2015-09-29 10:08:10 -04:00
Stephen Kelly 9bc6eb8e1f cmGlobalGenerator: Initialize generator targets on construction (#15729)
The Ninja generator and Visual Studio generators are special-cased for the
QtAutogen feature.  In order to reduce the number of custom targets, the Visual
Studio generators prefer to create custom commands instead, and in order to
create appropriate Ninja files, generated rcc files are listed as byproducts.

This requires the use of the GetConfigCommonSourceFiles API of the
cmGeneratorTarget for those generators when initializing the autogen target.
The initializer method is called from Compute() after the cmGeneratorTarget
objects are created, however the initialization of the object directory occurs
later in the InitGeneratorTargets method.  That means that the resulting object
locations are computed incorrectly and cached before the object directory is
determined, so the generated buildsystem can not find the object files.

The initialization of the object directory was split from the creation of
cmGeneratorTarget instances in commit 0e0258c8 (cmGlobalGenerator: Split
creation of generator object from initialization., 2015-07-25).  The motivation
for the split was to do only what is essential to do early in cases where
cmGeneratorTargets need to be created at configure-time.  That is required for
the purpose of implementing policies CMP0024 and CMP0026, and for
try_compile(LINK_LIBRARIES).  However, the split was not really necessary.

Compute the object directory in the cmGeneratorTarget constructor instead.

The QtAutogen unit test already tests the use of TARGET_OBJECTS with AUTOMOC,
and that test already passes on Ninja.  The reason it already passes is that
the QtAutogen target also uses the AUTORCC feature, and specifies several qrc
files in its SOURCES.  Later in the Compute algorithm (after the
InitGeneratorTargets call), the rcc files are determined and target->AddSource
is called.  The AddSource call clears the previously mentioned cache of source
files, causing it to be regenerated when next queried, this time taking account
of the object directory.

Extend the test suite with a new target which does not make use of AUTORCC with
qrc files so that the test added alone would break without the fix in this
commit.
2015-09-29 09:56:34 -04:00
Stephen Kelly 8544f16d1e cmGlobalGenerator: Devirtualize method. 2015-09-27 12:08:06 +02:00
Stephen Kelly 12f0e13c5f QtAutogen: Simplify generator initialization API. 2015-09-26 19:32:54 +02:00
Stephen Kelly 194bb06803 cmGlobalGenerator: Remove unused method. 2015-09-24 09:39:39 +02:00
Stephen Kelly c5f07e0537 cmGlobalGenerator: Create local generators after all makefiles configured. 2015-09-24 09:39:38 +02:00
Stephen Kelly b98f7712ea cmGlobalGenerator: Add API for the configure step being finished. 2015-09-18 20:48:15 +02:00
Stephen Kelly ebf8d0a99a cmGlobalGenerator: Rename method. 2015-08-28 18:44:39 +02:00
Stephen Kelly ff8ac8ee6a cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
2015-08-28 18:44:39 +02:00
Stephen Kelly 92041eec49 cmGlobalGenerator: Remove MakeLocalGenerator method.
Inline implementation to callers.
2015-08-28 18:44:38 +02:00
Stephen Kelly 9b6a743b80 cmLocalGenerator: Remove Parent pointer. 2015-08-28 18:44:38 +02:00
Brad King 445077cbd2 Merge topic 'minor-cleanups'
7f551b4f cmGlobalGenerator: Implement VS6 check without virtual method.
cd6293cd cmMakefile: Fix style.
de6b2895 cmTarget: Remove vestigal method declaration.
e35ee02d cmTarget: Fix indentation.
00f2298f Reduce uses of cmMakefile::GetGlobalGenerator.
6254ba95 cmMakefile: Remove Internal class.
cf0a78dc cmGeneratorTarget: Issue messages through the local generator.
2015-08-27 10:04:12 -04:00
Stephen Kelly 7f551b4f26 cmGlobalGenerator: Implement VS6 check without virtual method.
Don't require existence of a global generator for this check.
2015-08-25 23:06:33 +02:00
Stephen Kelly be56feb618 cmGlobalGenerator: Extract new IsExcluded overload. 2015-08-24 20:03:29 +02:00
Stephen Kelly 2394584ce2 cmGlobalGenerator: Rename progress initializer method. 2015-08-23 18:05:13 +02:00
Stephen Kelly b9eb3cd140 cmGlobalGenerator: Move LG to target map to subclass.
This is the only user.
2015-08-23 18:05:01 +02:00
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