summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h67
1 files changed, 16 insertions, 51 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 40344ce..3067f2c 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -9,9 +9,10 @@
#include "cmListFileCache.h"
#include "cmNewLineStyle.h"
#include "cmPolicies.h"
-#include "cmState.h"
+#include "cmStateSnapshot.h"
#include "cmTarget.h"
#include "cmTargetLinkLibraryType.h"
+#include "cm_unordered_map.hxx"
#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -27,14 +28,6 @@
#include <string>
#include <vector>
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX_UNORDERED_MAP
-#include <unordered_map>
-#else
-#include <cmsys/hash_map.hxx>
-#endif
-#endif
-
class cmCommand;
class cmCompiledGeneratorExpression;
class cmCustomCommandLines;
@@ -70,7 +63,7 @@ public:
* Construct an empty makefile.
*/
cmMakefile(cmGlobalGenerator* globalGenerator,
- const cmState::Snapshot& snapshot);
+ const cmStateSnapshot& snapshot);
/**
* Destructor.
@@ -163,9 +156,10 @@ public:
/** Create a new imported target with the name and type given. */
cmTarget* AddImportedTarget(const std::string& name,
- cmState::TargetType type, bool global);
+ cmStateEnums::TargetType type, bool global);
- cmTarget* AddNewTarget(cmState::TargetType type, const std::string& name);
+ cmTarget* AddNewTarget(cmStateEnums::TargetType type,
+ const std::string& name);
/**
* Add an executable to the build.
@@ -197,15 +191,6 @@ public:
const char* comment = CM_NULLPTR, bool uses_terminal = false);
/**
- * Add a link library to the build.
- */
- void AddLinkLibrary(const std::string&);
- void AddLinkLibrary(const std::string&, cmTargetLinkLibraryType type);
- void AddLinkLibraryForTarget(const std::string& tgt, const std::string&,
- cmTargetLinkLibraryType type);
- void AddLinkDirectoryForTarget(const std::string& tgt, const std::string& d);
-
- /**
* Add a subdirectory to the build.
*/
void AddSubDirectory(const std::string& fullSrcDir,
@@ -232,7 +217,7 @@ public:
void AddDefinition(const std::string& name, const char* value);
///! Add a definition to this makefile and the global cmake cache.
void AddCacheDefinition(const std::string& name, const char* value,
- const char* doc, cmState::CacheEntryType type,
+ const char* doc, cmStateEnums::CacheEntryType type,
bool force = false);
/**
@@ -260,7 +245,8 @@ public:
/**
* Set the name of the library.
*/
- cmTarget* AddLibrary(const std::string& libname, cmState::TargetType type,
+ cmTarget* AddLibrary(const std::string& libname,
+ cmStateEnums::TargetType type,
const std::vector<std::string>& srcs,
bool excludeFromAll = false);
void AddAlias(const std::string& libname, const std::string& tgt);
@@ -447,7 +433,7 @@ public:
/**
* Get a list of preprocessor define flags.
*/
- const char* GetDefineFlags() const { return this->DefineFlags.c_str(); }
+ std::string GetDefineFlags() const { return this->DefineFlags; }
/**
* Make sure CMake can write this file
@@ -760,7 +746,7 @@ public:
void ClearMatches();
void StoreMatches(cmsys::RegularExpression& re);
- cmState::Snapshot GetStateSnapshot() const;
+ cmStateSnapshot GetStateSnapshot() const;
const char* GetDefineFlagsCMP0059() const;
@@ -781,7 +767,7 @@ public:
protected:
// add link libraries and directories to the target
- void AddGlobalLinkInformation(const std::string& name, cmTarget& target);
+ void AddGlobalLinkInformation(cmTarget& target);
// Check for a an unused variable
void LogUnused(const char* reason, const std::string& name) const;
@@ -790,24 +776,12 @@ protected:
// libraries, classes, and executables
mutable cmTargets Targets;
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX_UNORDERED_MAP
- typedef std::unordered_map<std::string, cmTarget*> TargetMap;
-#else
- typedef cmsys::hash_map<std::string, cmTarget*> TargetMap;
-#endif
-#else
- typedef std::map<std::string, cmTarget*> TargetMap;
-#endif
std::map<std::string, std::string> AliasTargets;
std::vector<cmSourceFile*> SourceFiles;
// Tests
std::map<std::string, cmTest*> Tests;
- // The link-library paths. Order matters, use std::vector (not std::set).
- std::vector<std::string> LinkDirectories;
-
// The set of include directories that are marked as system include
// directories.
std::set<std::string> SystemIncludeDirectories;
@@ -815,8 +789,6 @@ protected:
std::vector<std::string> ListFiles;
std::vector<std::string> OutputFiles;
- cmTarget::LinkLibraryVectorType LinkLibraries;
-
std::vector<cmInstallGenerator*> InstallGenerators;
std::vector<cmTestGenerator*> TestGenerators;
@@ -841,7 +813,7 @@ private:
cmMakefile(const cmMakefile& mf);
cmMakefile& operator=(const cmMakefile& mf);
- cmState::Snapshot StateSnapshot;
+ cmStateSnapshot StateSnapshot;
cmListFileBacktrace Backtrace;
void ReadListFile(cmListFile const& listFile,
@@ -875,6 +847,7 @@ private:
friend class cmParseFileScope;
std::vector<cmTarget*> ImportedTargetsOwned;
+ typedef CM_UNORDERED_MAP<std::string, cmTarget*> TargetMap;
TargetMap ImportedTargets;
// Internal policy stack management.
@@ -911,16 +884,8 @@ private:
*/
cmSourceFile* LinearGetSourceFileWithOutput(const std::string& cname) const;
-// A map for fast output to input look up.
-#if defined(CMAKE_BUILD_WITH_CMAKE)
-#ifdef CMake_HAVE_CXX_UNORDERED_MAP
- typedef std::unordered_map<std::string, cmSourceFile*> OutputToSourceMap;
-#else
- typedef cmsys::hash_map<std::string, cmSourceFile*> OutputToSourceMap;
-#endif
-#else
- typedef std::map<std::string, cmSourceFile*> OutputToSourceMap;
-#endif
+ // A map for fast output to input look up.
+ typedef CM_UNORDERED_MAP<std::string, cmSourceFile*> OutputToSourceMap;
OutputToSourceMap OutputToSource;
void UpdateOutputToSourceMap(std::vector<std::string> const& outputs,