[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5380-g218d8d1
Stephen Kelly
steveire at gmail.com
Tue Nov 19 12:27:26 EST 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 218d8d1050ce71029c55d2d911f735e9e50502bf (commit)
via 1de4dc46e4d79d508537dd10dc643715f0d1881f (commit)
via d42c0ee84225a13cc75770799298011c5d7bdc81 (commit)
via ae56fe69c6a95997f032ae61dadf0536884af88e (commit)
via 261a7ca316020310d2fdbbd166788c94d8ce5e67 (commit)
via d3e5b5ddaa4ee8b49286335e4c358af2b3dc73a0 (commit)
via ba276f21b8664ff4d44b0fe082b15e3c8d8e3bb2 (commit)
via 78c6af2cdd1619acdcd007064e89c891fc88cc3c (commit)
via 284a234250d752e24c1c9ab6227ecff6fb739759 (commit)
via 757db44810e8d474d12c135ce87247d029507c43 (commit)
via 0f876439e941c18f7fc264fbf02f5df9bc531f90 (commit)
from d6bb45d1a9b005da1bdf997091de199b8cc90219 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=218d8d1050ce71029c55d2d911f735e9e50502bf
commit 218d8d1050ce71029c55d2d911f735e9e50502bf
Merge: d6bb45d 1de4dc4
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 12:27:19 2013 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 19 12:27:19 2013 -0500
Merge topic 'constify' into next
1de4dc4 cmTarget: Trivially make more API const.
d42c0ee cmTarget: Make GetExportMacro const.
ae56fe6 cmTarget: Make NameResolvesToFramework const.
261a7ca cmGlobalGenerator: Make NameResolvesToFramework const.
d3e5b5d cmMakefile: Make FindTarget const.
ba276f2 cmMakefile: Make IsAlias const.
78c6af2 cmTarget: Make GetInterfaceLinkLibraries const.
284a234 cmTarget: Make GetTargetSourceFileFlags const.
757db44 cmTarget: Make custom command accessors API const.
0f87643 cmGeneratorTarget: Make GetIncludeDirectories const.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1de4dc46e4d79d508537dd10dc643715f0d1881f
commit 1de4dc46e4d79d508537dd10dc643715f0d1881f
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:50:23 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmTarget: Trivially make more API const.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f8cf079..cf68e38 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -438,7 +438,7 @@ bool cmTarget::IsExecutableWithExports() const
}
//----------------------------------------------------------------------------
-bool cmTarget::IsLinkable()
+bool cmTarget::IsLinkable() const
{
return (this->GetType() == cmTarget::STATIC_LIBRARY ||
this->GetType() == cmTarget::SHARED_LIBRARY ||
@@ -834,7 +834,7 @@ void cmTarget::GetInterfaceLinkLibraries(const char *config,
//----------------------------------------------------------------------------
std::string cmTarget::GetDebugGeneratorExpressions(const std::string &value,
- cmTarget::LinkLibraryType llt)
+ cmTarget::LinkLibraryType llt) const
{
if (llt == GENERAL)
{
@@ -2276,7 +2276,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
}
//----------------------------------------------------------------------------
-void cmTarget::CheckProperty(const char* prop, cmMakefile* context)
+void cmTarget::CheckProperty(const char* prop, cmMakefile* context) const
{
// Certain properties need checking.
if(strncmp(prop, "LINK_INTERFACE_LIBRARIES", 24) == 0)
@@ -2382,7 +2382,7 @@ std::string cmTarget::GetDirectory(const char* config, bool implib) const
}
//----------------------------------------------------------------------------
-std::string cmTarget::GetPDBDirectory(const char* config)
+std::string cmTarget::GetPDBDirectory(const char* config) const
{
if(OutputInfo const* info = this->GetOutputInfo(config))
{
@@ -2453,7 +2453,7 @@ const char* cmTarget::NormalGetLocation(const char* config) const
}
//----------------------------------------------------------------------------
-void cmTarget::GetTargetVersion(int& major, int& minor)
+void cmTarget::GetTargetVersion(int& major, int& minor) const
{
int patch;
this->GetTargetVersion(false, major, minor, patch);
@@ -2461,7 +2461,7 @@ void cmTarget::GetTargetVersion(int& major, int& minor)
//----------------------------------------------------------------------------
void cmTarget::GetTargetVersion(bool soversion,
- int& major, int& minor, int& patch)
+ int& major, int& minor, int& patch) const
{
// Set the default values.
major = 0;
@@ -2489,7 +2489,7 @@ void cmTarget::GetTargetVersion(bool soversion,
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetFeature(const char* feature, const char* config)
+const char* cmTarget::GetFeature(const char* feature, const char* config) const
{
if(config && *config)
{
@@ -3145,7 +3145,7 @@ bool cmTarget::HasMacOSXRpath(const char* config) const
}
//----------------------------------------------------------------------------
-bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config)
+bool cmTarget::IsImportedSharedLibWithoutSOName(const char* config) const
{
if(this->IsImported() && this->GetType() == cmTarget::SHARED_LIBRARY)
{
@@ -3597,14 +3597,14 @@ void cmTarget::GetExecutableNames(std::string& name,
}
//----------------------------------------------------------------------------
-bool cmTarget::HasImplibGNUtoMS()
+bool cmTarget::HasImplibGNUtoMS() const
{
return this->HasImportLibrary() && this->GetPropertyAsBool("GNUtoMS");
}
//----------------------------------------------------------------------------
bool cmTarget::GetImplibGNUtoMS(std::string const& gnuName,
- std::string& out, const char* newExt)
+ std::string& out, const char* newExt) const
{
if(this->HasImplibGNUtoMS() &&
gnuName.size() > 6 && gnuName.substr(gnuName.size()-6) == ".dll.a")
@@ -3976,7 +3976,7 @@ bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out) const
}
//----------------------------------------------------------------------------
-bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib)
+bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib) const
{
std::string dir;
return this->ComputeOutputDir(config, implib, dir);
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index cbd5f58..35ec680 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -219,14 +219,14 @@ public:
* Set the path where this target should be installed. This is relative to
* INSTALL_PREFIX
*/
- std::string GetInstallPath() {return this->InstallPath;}
+ std::string GetInstallPath() const {return this->InstallPath;}
void SetInstallPath(const char *name) {this->InstallPath = name;}
/**
* Set the path where this target (if it has a runtime part) should be
* installed. This is relative to INSTALL_PREFIX
*/
- std::string GetRuntimeInstallPath() {return this->RuntimeInstallPath;}
+ std::string GetRuntimeInstallPath() const {return this->RuntimeInstallPath;}
void SetRuntimeInstallPath(const char *name) {
this->RuntimeInstallPath = name; }
@@ -253,9 +253,9 @@ public:
const char *GetProperty(const char *prop) const;
const char *GetProperty(const char *prop, cmProperty::ScopeType scope) const;
bool GetPropertyAsBool(const char *prop) const;
- void CheckProperty(const char* prop, cmMakefile* context);
+ void CheckProperty(const char* prop, cmMakefile* context) const;
- const char* GetFeature(const char* feature, const char* config);
+ const char* GetFeature(const char* feature, const char* config) const;
bool IsImported() const {return this->IsImportedTarget;}
@@ -337,7 +337,7 @@ public:
If the configuration name is given then the generator will add its
subdirectory for that configuration. Otherwise just the canonical
pdb output directory is given. */
- std::string GetPDBDirectory(const char* config = 0);
+ std::string GetPDBDirectory(const char* config = 0) const;
/** Get the location of the target in the build tree for the given
configuration. This location is suitable for use as the LOCATION
@@ -347,12 +347,13 @@ public:
/** Get the target major and minor version numbers interpreted from
the VERSION property. Version 0 is returned if the property is
not set or cannot be parsed. */
- void GetTargetVersion(int& major, int& minor);
+ void GetTargetVersion(int& major, int& minor) const;
/** Get the target major, minor, and patch version numbers
interpreted from the VERSION or SOVERSION property. Version 0
is returned if the property is not set or cannot be parsed. */
- void GetTargetVersion(bool soversion, int& major, int& minor, int& patch);
+ void
+ GetTargetVersion(bool soversion, int& major, int& minor, int& patch) const;
/**
* Make sure the full path to all source files is known.
@@ -384,7 +385,7 @@ public:
/** Test for special case of a third-party shared library that has
no soname at all. */
- bool IsImportedSharedLibWithoutSOName(const char* config);
+ bool IsImportedSharedLibWithoutSOName(const char* config) const;
/** Get the full path to the target according to the settings in its
makefile and the configuration type. */
@@ -406,12 +407,12 @@ public:
std::string& pdbName, const char* config) const;
/** Does this target have a GNU implib to convert to MS format? */
- bool HasImplibGNUtoMS();
+ bool HasImplibGNUtoMS() const;
/** Convert the given GNU import library name (.dll.a) to a name with a new
extension (.lib or ${CMAKE_IMPORT_LIBRARY_SUFFIX}). */
bool GetImplibGNUtoMS(std::string const& gnuName, std::string& out,
- const char* newExt = 0);
+ const char* newExt = 0) const;
/**
* Compute whether this target must be relinked before installing.
@@ -466,10 +467,10 @@ public:
bool IsExecutableWithExports() const;
/** Return whether this target may be used to link another target. */
- bool IsLinkable();
+ bool IsLinkable() const;
/** Return whether or not the target is for a DLL platform. */
- bool IsDLLPlatform() { return this->DLLPlatform; }
+ bool IsDLLPlatform() const { return this->DLLPlatform; }
/** Return whether or not the target has a DLL import library. */
bool HasImportLibrary() const;
@@ -500,7 +501,7 @@ public:
/** Return whether this target uses the default value for its output
directory. */
- bool UsesDefaultOutputDir(const char* config, bool implib);
+ bool UsesDefaultOutputDir(const char* config, bool implib) const;
/** @return the mac content directory for this target. */
std::string GetMacContentDirectory(const char* config,
@@ -553,7 +554,7 @@ public:
const char *config) const;
std::string GetDebugGeneratorExpressions(const std::string &value,
- cmTarget::LinkLibraryType llt);
+ cmTarget::LinkLibraryType llt) const;
void AddSystemIncludeDirectories(const std::set<cmStdString> &incs);
void AddSystemIncludeDirectories(const std::vector<std::string> &incs);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d42c0ee84225a13cc75770799298011c5d7bdc81
commit d42c0ee84225a13cc75770799298011c5d7bdc81
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:49:42 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmTarget: Make GetExportMacro const.
The std::string member is only used for memory management.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index e063125..f8cf079 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -4037,7 +4037,7 @@ std::string cmTarget::GetFrameworkVersion() const
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetExportMacro()
+const char* cmTarget::GetExportMacro() const
{
// Define the symbol for targets that export symbols.
if(this->GetType() == cmTarget::SHARED_LIBRARY ||
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index d78fe35..cbd5f58 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -449,7 +449,7 @@ public:
/** Get the macro to define when building sources in this target.
If no macro should be defined null is returned. */
- const char* GetExportMacro();
+ const char* GetExportMacro() const;
void GetCompileDefinitions(std::vector<std::string> &result,
const char *config) const;
@@ -678,7 +678,7 @@ private:
bool HaveInstallRule;
std::string InstallPath;
std::string RuntimeInstallPath;
- std::string ExportMacro;
+ mutable std::string ExportMacro;
std::set<cmStdString> Utilities;
bool RecordDependencies;
mutable cmPropertyMap Properties;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae56fe69c6a95997f032ae61dadf0536884af88e
commit ae56fe69c6a95997f032ae61dadf0536884af88e
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:48:55 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmTarget: Make NameResolvesToFramework const.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index b0caf16..e063125 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -769,9 +769,9 @@ void cmTarget::ClearDependencyInformation( cmMakefile& mf,
}
//----------------------------------------------------------------------------
-bool cmTarget::NameResolvesToFramework(const std::string& libname)
+bool cmTarget::NameResolvesToFramework(const std::string& libname) const
{
- return this->GetMakefile()->GetLocalGenerator()->GetGlobalGenerator()->
+ return this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
NameResolvesToFramework(libname);
}
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index aeb8703..d78fe35 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -197,7 +197,7 @@ public:
void ClearDependencyInformation(cmMakefile& mf, const char* target);
// Check to see if a library is a framework and treat it different on Mac
- bool NameResolvesToFramework(const std::string& libname);
+ bool NameResolvesToFramework(const std::string& libname) const;
void AddLinkLibrary(cmMakefile& mf,
const char *target, const char* lib,
LinkLibraryType llt);
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=261a7ca316020310d2fdbbd166788c94d8ce5e67
commit 261a7ca316020310d2fdbbd166788c94d8ce5e67
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:48:19 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmGlobalGenerator: Make NameResolvesToFramework const.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 2f16e9c..7366c09 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1989,15 +1989,16 @@ bool cmGlobalGenerator::IsAlias(const char *name) const
//----------------------------------------------------------------------------
cmTarget*
cmGlobalGenerator::FindTarget(const char* project, const char* name,
- bool excludeAliases)
+ bool excludeAliases) const
{
// if project specific
if(project)
{
- std::vector<cmLocalGenerator*>* gens = &this->ProjectMap[project];
- for(unsigned int i = 0; i < gens->size(); ++i)
+ std::map<cmStdString, std::vector<cmLocalGenerator*> >::const_iterator
+ gens = this->ProjectMap.find(project);
+ for(unsigned int i = 0; i < gens->second.size(); ++i)
{
- cmTarget* ret = (*gens)[i]->GetMakefile()->FindTarget(name,
+ cmTarget* ret = (gens->second)[i]->GetMakefile()->FindTarget(name,
excludeAliases);
if(ret)
{
@@ -2010,14 +2011,14 @@ cmGlobalGenerator::FindTarget(const char* project, const char* name,
{
if (!excludeAliases)
{
- std::map<cmStdString, cmTarget*>::iterator ai
+ std::map<cmStdString, cmTarget*>::const_iterator ai
= this->AliasTargets.find(name);
if (ai != this->AliasTargets.end())
{
return ai->second;
}
}
- std::map<cmStdString,cmTarget *>::iterator i =
+ std::map<cmStdString,cmTarget *>::const_iterator i =
this->TotalTargets.find ( name );
if ( i != this->TotalTargets.end() )
{
@@ -2033,7 +2034,8 @@ cmGlobalGenerator::FindTarget(const char* project, const char* name,
}
//----------------------------------------------------------------------------
-bool cmGlobalGenerator::NameResolvesToFramework(const std::string& libname)
+bool
+cmGlobalGenerator::NameResolvesToFramework(const std::string& libname) const
{
if(cmSystemTools::IsPathToFramework(libname.c_str()))
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 15bc366..eb720a8 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -207,14 +207,14 @@ public:
///! Find a target by name by searching the local generators.
cmTarget* FindTarget(const char* project, const char* name,
- bool excludeAliases = false);
+ bool excludeAliases = false) const;
void AddAlias(const char *name, cmTarget *tgt);
bool IsAlias(const char *name) const;
/** Determine if a name resolves to a framework on disk or a built target
that is a framework. */
- bool NameResolvesToFramework(const std::string& libname);
+ bool NameResolvesToFramework(const std::string& libname) const;
/** If check to see if the target is linked to by any other
target in the project */
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d3e5b5ddaa4ee8b49286335e4c358af2b3dc73a0
commit d3e5b5ddaa4ee8b49286335e4c358af2b3dc73a0
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:47:36 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmMakefile: Make FindTarget const.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4a2153d..6be1fdd 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3822,21 +3822,19 @@ const char* cmMakefile::GetFeature(const char* feature, const char* config)
return 0;
}
-cmTarget* cmMakefile::FindTarget(const char* name, bool excludeAliases)
+cmTarget* cmMakefile::FindTarget(const char* name, bool excludeAliases) const
{
if (!excludeAliases)
{
- std::map<std::string, cmTarget*>::iterator i
+ std::map<std::string, cmTarget*>::const_iterator i
= this->AliasTargets.find(name);
if (i != this->AliasTargets.end())
{
return i->second;
}
}
- cmTargets& tgts = this->GetTargets();
-
- cmTargets::iterator i = tgts.find ( name );
- if ( i != tgts.end() )
+ cmTargets::iterator i = this->Targets.find( name );
+ if ( i != this->Targets.end() )
{
return &i->second;
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 76958ca..44aaa66 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -533,7 +533,7 @@ public:
this->GeneratorTargets = targets;
}
- cmTarget* FindTarget(const char* name, bool excludeAliases = false);
+ cmTarget* FindTarget(const char* name, bool excludeAliases = false) const;
/** Find a target to use in place of the given name. The target
returned may be imported or built within the project. */
@@ -902,7 +902,7 @@ protected:
std::string ProjectName; // project name
// libraries, classes, and executables
- cmTargets Targets;
+ mutable cmTargets Targets;
std::map<std::string, cmTarget*> AliasTargets;
cmGeneratorTargetsType GeneratorTargets;
std::vector<cmSourceFile*> SourceFiles;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ba276f21b8664ff4d44b0fe082b15e3c8d8e3bb2
commit ba276f21b8664ff4d44b0fe082b15e3c8d8e3bb2
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:32:30 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmMakefile: Make IsAlias const.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a160336..2f16e9c 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1981,7 +1981,7 @@ void cmGlobalGenerator::AddAlias(const char *name, cmTarget *tgt)
}
//----------------------------------------------------------------------------
-bool cmGlobalGenerator::IsAlias(const char *name)
+bool cmGlobalGenerator::IsAlias(const char *name) const
{
return this->AliasTargets.find(name) != this->AliasTargets.end();
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ae139ed..15bc366 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -210,7 +210,7 @@ public:
bool excludeAliases = false);
void AddAlias(const char *name, cmTarget *tgt);
- bool IsAlias(const char *name);
+ bool IsAlias(const char *name) const;
/** Determine if a name resolves to a framework on disk or a built target
that is a framework. */
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78c6af2cdd1619acdcd007064e89c891fc88cc3c
commit 78c6af2cdd1619acdcd007064e89c891fc88cc3c
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:13:04 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmTarget: Make GetInterfaceLinkLibraries const.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 26b1e76..b0caf16 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -811,7 +811,7 @@ void cmTarget::GetDirectLinkLibraries(const char *config,
//----------------------------------------------------------------------------
void cmTarget::GetInterfaceLinkLibraries(const char *config,
- std::vector<std::string> &libs, cmTarget *head)
+ std::vector<std::string> &libs, cmTarget *head) const
{
const char *prop = this->GetProperty("INTERFACE_LINK_LIBRARIES");
if (prop)
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index e67edd7..aeb8703 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -186,7 +186,7 @@ public:
cmTarget const* head) const;
void GetInterfaceLinkLibraries(const char *config,
std::vector<std::string> &,
- cmTarget *head);
+ cmTarget *head) const;
/** Compute the link type to use for the given configuration. */
LinkLibraryType ComputeLinkType(const char* config) const;
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=284a234250d752e24c1c9ab6227ecff6fb739759
commit 284a234250d752e24c1c9ab6227ecff6fb739759
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:11:15 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmTarget: Make GetTargetSourceFileFlags const.
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index c9905b6..26b1e76 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -91,8 +91,8 @@ public:
}
~cmTargetInternals();
typedef cmTarget::SourceFileFlags SourceFileFlags;
- std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
- bool SourceFileFlagsConstructed;
+ mutable std::map<cmSourceFile const*, SourceFileFlags> SourceFlagsMap;
+ mutable bool SourceFileFlagsConstructed;
// The backtrace when the target was created.
cmListFileBacktrace Backtrace;
@@ -577,7 +577,7 @@ void cmTarget::ProcessSourceExpression(std::string const& expr)
//----------------------------------------------------------------------------
struct cmTarget::SourceFileFlags
-cmTarget::GetTargetSourceFileFlags(const cmSourceFile* sf)
+cmTarget::GetTargetSourceFileFlags(const cmSourceFile* sf) const
{
struct SourceFileFlags flags;
this->ConstructSourceFileFlags();
@@ -591,7 +591,7 @@ cmTarget::GetTargetSourceFileFlags(const cmSourceFile* sf)
}
//----------------------------------------------------------------------------
-void cmTarget::ConstructSourceFileFlags()
+void cmTarget::ConstructSourceFileFlags() const
{
if(this->Internal->SourceFileFlagsConstructed)
{
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index bafcb15..e67edd7 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -162,7 +162,8 @@ public:
/**
* Get the flags for a given source file as used in this target
*/
- struct SourceFileFlags GetTargetSourceFileFlags(const cmSourceFile* sf);
+ struct SourceFileFlags
+ GetTargetSourceFileFlags(const cmSourceFile* sf) const;
/**
* Add sources to the target.
@@ -742,7 +743,7 @@ private:
friend class cmTargetTraceDependencies;
cmTargetInternalPointer Internal;
- void ConstructSourceFileFlags();
+ void ConstructSourceFileFlags() const;
void ComputeVersionedName(std::string& vName,
std::string const& prefix,
std::string const& base,
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=757db44810e8d474d12c135ce87247d029507c43
commit 757db44810e8d474d12c135ce87247d029507c43
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Tue Nov 19 11:05:47 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmTarget: Make custom command accessors API const.
Add specific mutators instead of providing non-const refs.
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 65a7118..a160336 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2407,7 +2407,7 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
// Store the custom command in the target.
cmCustomCommand cc(0, no_outputs, no_depends, *commandLines, 0,
workingDirectory);
- target.GetPostBuildCommands().push_back(cc);
+ target.AddPostBuildCommand(cc);
target.SetProperty("EchoString", message);
std::vector<std::string>::iterator dit;
for ( dit = depends.begin(); dit != depends.end(); ++ dit )
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ac8381c..4a2153d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -903,13 +903,13 @@ cmMakefile::AddCustomCommandToTarget(const char* target,
switch(type)
{
case cmTarget::PRE_BUILD:
- ti->second.GetPreBuildCommands().push_back(cc);
+ ti->second.AddPreBuildCommand(cc);
break;
case cmTarget::PRE_LINK:
- ti->second.GetPreLinkCommands().push_back(cc);
+ ti->second.AddPreLinkCommand(cc);
break;
case cmTarget::POST_BUILD:
- ti->second.GetPostBuildCommands().push_back(cc);
+ ti->second.AddPostBuildCommand(cc);
break;
}
}
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 015654b..d8e9b34 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -534,7 +534,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
}
- std::vector<cmCustomCommand> *cmdLists[3] = {
+ const std::vector<cmCustomCommand> *cmdLists[3] = {
&this->GetTarget()->GetPreBuildCommands(),
&this->GetTarget()->GetPreLinkCommands(),
&this->GetTarget()->GetPostBuildCommands()
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 36cb368..35717ce 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -257,7 +257,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target)
workingDirectory.c_str());
cc.SetEscapeOldStyle(false);
cc.SetEscapeAllowMakeVars(true);
- target->GetPreBuildCommands().push_back(cc);
+ target->AddPreBuildCommand(cc);
}
else
#endif
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index b516a0a..bafcb15 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -114,12 +114,18 @@ public:
/**
* Get the list of the custom commands for this target
*/
- std::vector<cmCustomCommand> &GetPreBuildCommands()
+ std::vector<cmCustomCommand> const &GetPreBuildCommands() const
{return this->PreBuildCommands;}
- std::vector<cmCustomCommand> &GetPreLinkCommands()
+ std::vector<cmCustomCommand> const &GetPreLinkCommands() const
{return this->PreLinkCommands;}
- std::vector<cmCustomCommand> &GetPostBuildCommands()
+ std::vector<cmCustomCommand> const &GetPostBuildCommands() const
{return this->PostBuildCommands;}
+ void AddPreBuildCommand(cmCustomCommand const &cmd)
+ {this->PreBuildCommands.push_back(cmd);}
+ void AddPreLinkCommand(cmCustomCommand const &cmd)
+ {this->PreLinkCommands.push_back(cmd);}
+ void AddPostBuildCommand(cmCustomCommand const &cmd)
+ {this->PostBuildCommands.push_back(cmd);}
/**
* Get the list of the source files used by this target
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0f876439e941c18f7fc264fbf02f5df9bc531f90
commit 0f876439e941c18f7fc264fbf02f5df9bc531f90
Author: Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 18 15:11:10 2013 +0100
Commit: Stephen Kelly <steveire at gmail.com>
CommitDate: Tue Nov 19 18:07:04 2013 +0100
cmGeneratorTarget: Make GetIncludeDirectories const.
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b964f71..011fc6c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -611,8 +611,8 @@ const char* cmGeneratorTarget::GetCreateRuleVariable() const
}
//----------------------------------------------------------------------------
-std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
- const char *config)
+std::vector<std::string>
+cmGeneratorTarget::GetIncludeDirectories(const char *config) const
{
return this->Target->GetIncludeDirectories(config);
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 177bc25..69d1bb2 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -70,7 +70,7 @@ public:
const char* GetCreateRuleVariable() const;
/** Get the include directories for this target. */
- std::vector<std::string> GetIncludeDirectories(const char *config);
+ std::vector<std::string> GetIncludeDirectories(const char *config) const;
bool IsSystemIncludeDirectory(const char *dir, const char *config) const;
-----------------------------------------------------------------------
Summary of changes:
Source/cmGeneratorTarget.cxx | 4 +-
Source/cmGeneratorTarget.h | 2 +-
Source/cmGlobalGenerator.cxx | 20 ++++++-----
Source/cmGlobalGenerator.h | 6 ++--
Source/cmMakefile.cxx | 16 ++++-----
Source/cmMakefile.h | 4 +-
Source/cmNinjaNormalTargetGenerator.cxx | 2 +-
Source/cmQtAutoGenerators.cxx | 2 +-
Source/cmTarget.cxx | 38 +++++++++++-----------
Source/cmTarget.h | 54 +++++++++++++++++-------------
10 files changed, 78 insertions(+), 70 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list