Commit Graph

442 Commits

Author SHA1 Message Date
Stephen Kelly b9f9915516 cmMakefile: Remove VarUsageStack.
Store usage information in the cmDefintions value instead.  We already
pay for the memory as padding in the Def struct, so we might as well
use it.
2015-05-19 22:36:53 +02:00
Stephen Kelly 528d68021c cmMakefile: Use more suitable method name to log var usage. 2015-05-19 22:36:52 +02:00
Stephen Kelly 9118b53b79 cmMakefile: Move internal method to private scope. 2015-05-19 22:36:52 +02:00
Stephen Kelly bb1e8c3adf cmMakefile: Remove Print() debugging facilities.
They don't print things that are important in the modern implementation.
2015-05-19 22:36:50 +02:00
Stephen Kelly 8ab1cce704 cmMakefile: Rename method to something more appropriate.
Allow the name to be used for something more-suitable.
2015-05-19 22:36:49 +02:00
Stephen Kelly 2dd5d42f52 cmMakefile: Make the public ReadListFile method take one param.
Make the existing method a private overload. All external callers
invoke the method with only one argument.
2015-05-19 22:36:49 +02:00
Stephen Kelly f3e6a336f2 cmMakefile: Remove CurrentListFile member.
It is never read externally.  The CollapseFullPath removed in this commit
is a repeat of a similar call inside ReadListFile.
2015-05-19 22:36:48 +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 e96b5d14f9 cmListFileContext: Implement LessThanComparable.
Move wrapping existing code from cmMakefile, and simplify the
implementation there.
2015-05-18 23:55:43 +02:00
Stephen Kelly f9785e0cb6 cmMakefile: Simplify CMP0054 handling. 2015-05-18 23:55:43 +02:00
Stephen Kelly e17b5e4262 cmMakefile: Add access to the top-level execution context.
This is cheaper than getting the whole backtrace, and the cmListFileBacktrace
will not always be composed of cmListFileContext objects.
2015-05-18 23:55:41 +02:00
Stephen Kelly 9b4aefad41 cmMakefile: Replace deques with vectors. 2015-05-18 21:25:48 +02:00
Brad King 226df303f9 CTest: Stop telling 'make' to ignore errors with -i
Add policy CMP0061 to maintain compatibility for existing projects.
2015-05-12 09:06:49 -04:00
Brad King 82a55ff916 Merge topic 'refactor-cmMakefile-constructor'
42142d4f cmMakefile: Inline Intialize method in constructor
f39f0c0a cmMakefile: Initialize SuppressWatches member before use
2015-05-05 09:35:23 -04:00
Brad King 42142d4fd2 cmMakefile: Inline Intialize method in constructor
Since commit 80909041 (cmMakefile: Disable copy constructor, 2015-04-18)
the only call to cmMakefile::Initialize is in one constructor.  Inline
it and drop the separate method.
2015-05-04 10:22:01 -04:00
Stephen Kelly 0bb6dbe0c6 cmMakefile: Extract an accessor for the global generator.
Both for convenience, and because cmMakefile should not be the
way to get access to the local generator, so that should go away
in the future.
2015-05-03 11:41:59 +02:00
Stephen Kelly 46f6a5f458 cmState: Store the Current directories. 2015-04-28 07:57:21 +02:00
Stephen Kelly 3a041c5949 Introduce cmState::Snapshot.
Create snapshots for buildsystem directories during configure time.

This class will be extended in follow up commits to snapshot
all values in the cmState.
2015-04-28 07:57:01 +02:00
Stephen Kelly 86f3cd0f7e cmMakefile: Require the localGenerator in the constructor.
Move the contents of cmMakeile::SetLocalGenerator to the Initialize
method.
2015-04-28 07:50:57 +02:00
Stephen Kelly e4c78b37ce cmMakefile: Inline SetHome* methods into last remaining caller. 2015-04-28 07:50:02 +02:00
Stephen Kelly 410f39a43e cmMakefile: Delegate storage of Home dirs to the cmake class.
There is no need to duplicate these on every cmMakefile.
2015-04-28 07:50:01 +02:00
Brad King 5a5ef00106 Merge topic 'clean-up-cmMakefile'
8dc3a67c cmMakefile: Out-of-line the directory methods.
0f3c8cfa cmMakefile: Use method abstraction to access directories.
b288a997 cmMakefile: Rename SetStart* directory API to SetCurrent*.
932d53bc cmMakefile: Remove redundant method duplication.
32b8f03a cmMakefile: Port users of GetStart* methods to new names.
54d6a918 cmMakefile: Rename GetCurrent{Output,Binary}Directory.
55d80d0a cmMakefile: Rename GetCurrent{,Source}Directory.
b23cf06f cmake: Remove redundant start directories.
fcf246ac cmMakefile: Populate Home directories on initialize.
8878bea7 cmake: Initialize Home directories on cmake for find-package mode.
044dc815 Use the Home directories from the cmake class where intended.
d67e8f24 cmake: Fix directory used to find the cache
1ea085d1 cmMakefile: Initialize dir definitions early.
f034bb2f Remove redundant calls to MakeStartDirectoriesCurrent.
3a68c323 cmMakefile: Fix wrong parameter names.
2015-04-21 09:42:07 -04:00
Stephen Kelly 8dc3a67c9c cmMakefile: Out-of-line the directory methods. 2015-04-21 09:41:27 -04:00
Stephen Kelly 8090904198 cmMakefile: Disable copy constructor.
It is no longer necessary to be able to copy it.  Additionally, this
gives us one less reason to copy cmTarget.
2015-04-21 00:26:37 +02:00
Stephen Kelly b288a997e9 cmMakefile: Rename SetStart* directory API to SetCurrent*. 2015-04-21 00:15:20 +02:00
Stephen Kelly 932d53bc02 cmMakefile: Remove redundant method duplication. 2015-04-21 00:15:20 +02:00
Stephen Kelly 54d6a9187f cmMakefile: Rename GetCurrent{Output,Binary}Directory.
Match names used in CMake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly 55d80d0a85 cmMakefile: Rename GetCurrent{,Source}Directory.
Match the names used in cmake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly 1ea085d1b6 cmMakefile: Initialize dir definitions early. 2015-04-21 00:12:51 +02:00
Stephen Kelly 3a68c323ba cmMakefile: Fix wrong parameter names. 2015-04-21 00:12:51 +02:00
Stephen Kelly 6e23a4bddd cmMakefile: Remove always-null first parameter to ReadListFile. 2015-04-18 15:31:18 +02:00
Stephen Kelly 813cd719c4 cmMakefile: Determine the file to read before calling Internal. 2015-04-18 15:29:18 +02:00
Stephen Kelly 0d9555779d cmMakefile: Delegate ListFile reading to internal method. 2015-04-18 15:29:17 +02:00
Stephen Kelly a2f2aeee2f cmMakefile: Add wrapper for reading listfiles which have an origin.
Such files are delegates from other files, and so they set the
CMAKE_PARENT_LIST_FILE to the originator.  They also may set a
policy scope.
2015-04-18 15:29:17 +02:00
Stephen Kelly 68f791cd06 cmMakefile: Add a method for processing buildsystem files.
These are different from other ListFiles in that a project() command is
required if it is top-level.
2015-04-18 15:29:17 +02:00
Stephen Kelly 5bb4248a80 cmMakefile: Remove fullPath parameter from ReadListFile.
There is no reason for this to be a responsibility of
ReadListFile.  Additionally, the only user of it already computes
it itself.
2015-04-18 15:29:17 +02:00
Stephen Kelly 0aec491328 Port cmCommand consumers to cmState. 2015-04-15 11:43:49 -04:00
Stephen Kelly b159bff732 Move property definition to cmState. 2015-04-13 20:13:13 +02:00
Brad King 62c5e6f1a1 Merge topic 'introduce-cmState'
f081c5bd cmState: Move CacheEntryType enum from cmCacheManager.
f71fdf0e cmMakefile: Remove unused CacheManager accessor.
ff7169a0 Port to cmState.
a6b1ad13 Introduce cmState class.
2015-04-13 11:45:02 -04:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04:00
Stephen Kelly f71fdf0ec8 cmMakefile: Remove unused CacheManager accessor.
Remove unneeded friend declarations from cmCacheManager.
2015-04-13 11:44:15 -04:00
Stephen Kelly a6b1ad1309 Introduce cmState class.
At this point, it is an interface to the cache.  It will be extended
to be a universal interface for access to and manipulation of
configuration-time data (defintions, properties on targets,
directories, source files etc).

This will allow porting all command implementations away
from the cmMakefile and cmTarget classes, and result in something
more-purely related to configuration-time processing of cmake
commands.  That should serve at least the following goals:

 * Split the CMake implementation more definitively into three
   stages: Configuration, computation and generation, and be able to
   implement each optimally for memory access patterns etc.
 * Make better IDE integration possible by making more configuration
   data available.
 * Make it possiblte to use a smaller library than CMakeLib.a in
   cpack and ctest, resulting in smaller executables.
 * Make it possible to run the configure step multiple times in
   the same CMake run (#14539).

Manage its lifetime in the cmake class, and add a convenience accessor
to cmMakefile.
2015-04-13 11:44:14 -04:00
Stephen Kelly ea819b29f8 cmMakefile: Remove unused method. 2015-04-12 23:10:45 +02:00
Stephen Kelly 7bb4e3db06 cmMakefile: Out-of-line Home directory accessors. 2015-04-12 23:10:44 +02:00
Stephen Kelly 1f2c12ebd1 cmMakefile: Remove cache version accessors.
They are only used by legacy code. Inline them there to simplify
cmMakefile.
2015-04-07 23:25:35 +02:00
Brad King 3347c5e4f9 Revert topic 'refactor-cache-api'
This topic was never tested without some follow-up commits.  The
GetCacheEntryValue API returns a pointer to memory freed on return.
It will have to be revised along with the rest of the original topic.
2015-04-07 17:15:04 -04:00
Stephen Kelly 08c642c6ae cmMakefile: Remove cache version accessors.
They are only used by legacy code. Inline them there to simplify
cmMakefile.
2015-04-06 17:58:54 +02:00
Stephen Kelly c37cf7fa9e cmCacheManager: Remove unused method 2015-04-05 10:26:10 +02:00
Stephen Kelly a469bf7b98 cmMakefile: Remove one wrong and one insufficiently helpful comment. 2015-04-04 18:31:03 +02:00