summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-11-06 11:33:17 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-11-09 19:30:46 (GMT)
commitdcac9be6aa33601db1b32f4efd9f724a97f8844b (patch)
tree328ce0d30d14cfd24f0f215524f948b6860bff58
parent19a8a3c4c8105c85527da8651729f6300c054d74 (diff)
downloadCMake-dcac9be6aa33601db1b32f4efd9f724a97f8844b.zip
CMake-dcac9be6aa33601db1b32f4efd9f724a97f8844b.tar.gz
CMake-dcac9be6aa33601db1b32f4efd9f724a97f8844b.tar.bz2
Make accessors for compile-related information const.
These can be moved to cmGeneratorTarget in CMake 4.0.
-rw-r--r--Source/cmTarget.cxx27
-rw-r--r--Source/cmTarget.h12
2 files changed, 20 insertions, 19 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9162d17..dc65297 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -138,16 +138,16 @@ public:
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
- std::map<std::string, std::vector<TargetPropertyEntry*> >
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceIncludeDirectoriesEntries;
- std::map<std::string, std::vector<TargetPropertyEntry*> >
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceCompileOptionsEntries;
- std::map<std::string, std::vector<TargetPropertyEntry*> >
+ mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
CachedLinkInterfaceCompileDefinitionsEntries;
- std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
- std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
- std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
+ mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
};
//----------------------------------------------------------------------------
@@ -1598,7 +1598,7 @@ void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry,
}
//----------------------------------------------------------------------------
-static void processIncludeDirectories(cmTarget *tgt,
+static void processIncludeDirectories(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &includes,
std::set<std::string> &uniqueIncludes,
@@ -1767,7 +1767,8 @@ static void processIncludeDirectories(cmTarget *tgt,
}
//----------------------------------------------------------------------------
-std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
+std::vector<std::string>
+cmTarget::GetIncludeDirectories(const char *config) const
{
std::vector<std::string> includes;
std::set<std::string> uniqueIncludes;
@@ -1899,7 +1900,7 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
}
//----------------------------------------------------------------------------
-static void processCompileOptionsInternal(cmTarget *tgt,
+static void processCompileOptionsInternal(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
@@ -1958,7 +1959,7 @@ static void processCompileOptionsInternal(cmTarget *tgt,
}
//----------------------------------------------------------------------------
-static void processCompileOptions(cmTarget *tgt,
+static void processCompileOptions(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
@@ -1971,7 +1972,7 @@ static void processCompileOptions(cmTarget *tgt,
//----------------------------------------------------------------------------
void cmTarget::GetCompileOptions(std::vector<std::string> &result,
- const char *config)
+ const char *config) const
{
std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
@@ -2070,7 +2071,7 @@ void cmTarget::GetCompileOptions(std::vector<std::string> &result,
}
//----------------------------------------------------------------------------
-static void processCompileDefinitions(cmTarget *tgt,
+static void processCompileDefinitions(cmTarget const* tgt,
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
std::vector<std::string> &options,
std::set<std::string> &uniqueOptions,
@@ -2084,7 +2085,7 @@ static void processCompileDefinitions(cmTarget *tgt,
//----------------------------------------------------------------------------
void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
- const char *config)
+ const char *config) const
{
std::set<std::string> uniqueOptions;
cmListFileBacktrace lfbt;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index fbb4914..b516a0a 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -445,7 +445,7 @@ public:
const char* GetExportMacro();
void GetCompileDefinitions(std::vector<std::string> &result,
- const char *config);
+ const char *config) const;
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
@@ -512,7 +512,7 @@ public:
std::string GetAppBundleDirectory(const char* config,
bool contentOnly) const;
- std::vector<std::string> GetIncludeDirectories(const char *config);
+ std::vector<std::string> GetIncludeDirectories(const char *config) const;
void InsertInclude(const cmValueWithOrigin &entry,
bool before = false);
void InsertCompileOption(const cmValueWithOrigin &entry,
@@ -523,7 +523,7 @@ public:
void AppendBuildInterfaceIncludes();
void GetCompileOptions(std::vector<std::string> &result,
- const char *config);
+ const char *config) const;
bool IsNullImpliedByLinkLibraries(const std::string &p) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
@@ -679,9 +679,9 @@ private:
bool DLLPlatform;
bool IsApple;
bool IsImportedTarget;
- bool DebugIncludesDone;
- bool DebugCompileOptionsDone;
- bool DebugCompileDefinitionsDone;
+ mutable bool DebugIncludesDone;
+ mutable bool DebugCompileOptionsDone;
+ mutable bool DebugCompileDefinitionsDone;
mutable std::set<std::string> LinkImplicitNullProperties;
bool BuildInterfaceIncludesAppended;