Merge topic 'constify'
dcac9be
Make accessors for compile-related information const.19a8a3c
cmTarget: Don't finalize include directories in GetIncludeDirectories.3305364
cmGlobalGenerator: Rename the FinalizeCompileDefinitions method.
This commit is contained in:
commit
a4b9adec89
|
@ -1059,7 +1059,7 @@ void cmGlobalGenerator::Generate()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->FinalizeTargetCompileDefinitions();
|
this->FinalizeTargetCompileInfo();
|
||||||
|
|
||||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
// Iterate through all targets and set up automoc for those which have
|
// Iterate through all targets and set up automoc for those which have
|
||||||
|
@ -1084,11 +1084,6 @@ void cmGlobalGenerator::Generate()
|
||||||
(*targets)[tit->first] = tit->second;
|
(*targets)[tit->first] = tit->second;
|
||||||
(*targets)[tit->first].SetMakefile(mf);
|
(*targets)[tit->first].SetMakefile(mf);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( tit = targets->begin(); tit != targets->end(); ++ tit )
|
|
||||||
{
|
|
||||||
tit->second.AppendBuildInterfaceIncludes();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add generator specific helper commands
|
// Add generator specific helper commands
|
||||||
|
@ -1270,7 +1265,7 @@ void cmGlobalGenerator::CreateQtAutoGeneratorsTargets(AutogensType &autogens)
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmGlobalGenerator::FinalizeTargetCompileDefinitions()
|
void cmGlobalGenerator::FinalizeTargetCompileInfo()
|
||||||
{
|
{
|
||||||
// Construct per-target generator information.
|
// Construct per-target generator information.
|
||||||
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
|
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
|
||||||
|
@ -1289,6 +1284,8 @@ void cmGlobalGenerator::FinalizeTargetCompileDefinitions()
|
||||||
{
|
{
|
||||||
cmTarget* t = &ti->second;
|
cmTarget* t = &ti->second;
|
||||||
|
|
||||||
|
t->AppendBuildInterfaceIncludes();
|
||||||
|
|
||||||
for (std::vector<cmValueWithOrigin>::const_iterator it
|
for (std::vector<cmValueWithOrigin>::const_iterator it
|
||||||
= noconfig_compile_definitions.begin();
|
= noconfig_compile_definitions.begin();
|
||||||
it != noconfig_compile_definitions.end(); ++it)
|
it != noconfig_compile_definitions.end(); ++it)
|
||||||
|
|
|
@ -397,7 +397,7 @@ private:
|
||||||
|
|
||||||
void WriteSummary();
|
void WriteSummary();
|
||||||
void WriteSummary(cmTarget* target);
|
void WriteSummary(cmTarget* target);
|
||||||
void FinalizeTargetCompileDefinitions();
|
void FinalizeTargetCompileInfo();
|
||||||
|
|
||||||
virtual void PrintCompilerAdvice(std::ostream& os, std::string lang,
|
virtual void PrintCompilerAdvice(std::ostream& os, std::string lang,
|
||||||
const char* envVar);
|
const char* envVar);
|
||||||
|
|
|
@ -138,16 +138,16 @@ public:
|
||||||
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
|
std::vector<TargetPropertyEntry*> CompileDefinitionsEntries;
|
||||||
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
|
std::vector<cmValueWithOrigin> LinkInterfacePropertyEntries;
|
||||||
|
|
||||||
std::map<std::string, std::vector<TargetPropertyEntry*> >
|
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
||||||
CachedLinkInterfaceIncludeDirectoriesEntries;
|
CachedLinkInterfaceIncludeDirectoriesEntries;
|
||||||
std::map<std::string, std::vector<TargetPropertyEntry*> >
|
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
||||||
CachedLinkInterfaceCompileOptionsEntries;
|
CachedLinkInterfaceCompileOptionsEntries;
|
||||||
std::map<std::string, std::vector<TargetPropertyEntry*> >
|
mutable std::map<std::string, std::vector<TargetPropertyEntry*> >
|
||||||
CachedLinkInterfaceCompileDefinitionsEntries;
|
CachedLinkInterfaceCompileDefinitionsEntries;
|
||||||
|
|
||||||
std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
|
mutable std::map<std::string, bool> CacheLinkInterfaceIncludeDirectoriesDone;
|
||||||
std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
|
mutable std::map<std::string, bool> CacheLinkInterfaceCompileDefinitionsDone;
|
||||||
std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
|
mutable std::map<std::string, bool> CacheLinkInterfaceCompileOptionsDone;
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -1593,7 +1593,7 @@ void cmTarget::InsertCompileDefinition(const cmValueWithOrigin &entry,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static void processIncludeDirectories(cmTarget *tgt,
|
static void processIncludeDirectories(cmTarget const* tgt,
|
||||||
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
||||||
std::vector<std::string> &includes,
|
std::vector<std::string> &includes,
|
||||||
std::set<std::string> &uniqueIncludes,
|
std::set<std::string> &uniqueIncludes,
|
||||||
|
@ -1762,7 +1762,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::vector<std::string> includes;
|
||||||
std::set<std::string> uniqueIncludes;
|
std::set<std::string> uniqueIncludes;
|
||||||
|
@ -1772,8 +1773,6 @@ std::vector<std::string> cmTarget::GetIncludeDirectories(const char *config)
|
||||||
this->GetName(),
|
this->GetName(),
|
||||||
"INCLUDE_DIRECTORIES", 0, 0);
|
"INCLUDE_DIRECTORIES", 0, 0);
|
||||||
|
|
||||||
this->AppendBuildInterfaceIncludes();
|
|
||||||
|
|
||||||
std::vector<std::string> debugProperties;
|
std::vector<std::string> debugProperties;
|
||||||
const char *debugProp =
|
const char *debugProp =
|
||||||
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
|
this->Makefile->GetDefinition("CMAKE_DEBUG_TARGET_PROPERTIES");
|
||||||
|
@ -1896,7 +1895,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,
|
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
||||||
std::vector<std::string> &options,
|
std::vector<std::string> &options,
|
||||||
std::set<std::string> &uniqueOptions,
|
std::set<std::string> &uniqueOptions,
|
||||||
|
@ -1955,7 +1954,7 @@ static void processCompileOptionsInternal(cmTarget *tgt,
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
static void processCompileOptions(cmTarget *tgt,
|
static void processCompileOptions(cmTarget const* tgt,
|
||||||
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
||||||
std::vector<std::string> &options,
|
std::vector<std::string> &options,
|
||||||
std::set<std::string> &uniqueOptions,
|
std::set<std::string> &uniqueOptions,
|
||||||
|
@ -1968,7 +1967,7 @@ static void processCompileOptions(cmTarget *tgt,
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::GetCompileOptions(std::vector<std::string> &result,
|
void cmTarget::GetCompileOptions(std::vector<std::string> &result,
|
||||||
const char *config)
|
const char *config) const
|
||||||
{
|
{
|
||||||
std::set<std::string> uniqueOptions;
|
std::set<std::string> uniqueOptions;
|
||||||
cmListFileBacktrace lfbt;
|
cmListFileBacktrace lfbt;
|
||||||
|
@ -2067,7 +2066,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,
|
const std::vector<cmTargetInternals::TargetPropertyEntry*> &entries,
|
||||||
std::vector<std::string> &options,
|
std::vector<std::string> &options,
|
||||||
std::set<std::string> &uniqueOptions,
|
std::set<std::string> &uniqueOptions,
|
||||||
|
@ -2081,7 +2080,7 @@ static void processCompileDefinitions(cmTarget *tgt,
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
|
void cmTarget::GetCompileDefinitions(std::vector<std::string> &list,
|
||||||
const char *config)
|
const char *config) const
|
||||||
{
|
{
|
||||||
std::set<std::string> uniqueOptions;
|
std::set<std::string> uniqueOptions;
|
||||||
cmListFileBacktrace lfbt;
|
cmListFileBacktrace lfbt;
|
||||||
|
|
|
@ -445,7 +445,7 @@ public:
|
||||||
const char* GetExportMacro();
|
const char* GetExportMacro();
|
||||||
|
|
||||||
void GetCompileDefinitions(std::vector<std::string> &result,
|
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
|
// Compute the set of languages compiled by the target. This is
|
||||||
// computed every time it is called because the languages can change
|
// computed every time it is called because the languages can change
|
||||||
|
@ -512,7 +512,7 @@ public:
|
||||||
std::string GetAppBundleDirectory(const char* config,
|
std::string GetAppBundleDirectory(const char* config,
|
||||||
bool contentOnly) const;
|
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,
|
void InsertInclude(const cmValueWithOrigin &entry,
|
||||||
bool before = false);
|
bool before = false);
|
||||||
void InsertCompileOption(const cmValueWithOrigin &entry,
|
void InsertCompileOption(const cmValueWithOrigin &entry,
|
||||||
|
@ -523,7 +523,7 @@ public:
|
||||||
void AppendBuildInterfaceIncludes();
|
void AppendBuildInterfaceIncludes();
|
||||||
|
|
||||||
void GetCompileOptions(std::vector<std::string> &result,
|
void GetCompileOptions(std::vector<std::string> &result,
|
||||||
const char *config);
|
const char *config) const;
|
||||||
|
|
||||||
bool IsNullImpliedByLinkLibraries(const std::string &p) const;
|
bool IsNullImpliedByLinkLibraries(const std::string &p) const;
|
||||||
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
|
bool IsLinkInterfaceDependentBoolProperty(const std::string &p,
|
||||||
|
@ -679,9 +679,9 @@ private:
|
||||||
bool DLLPlatform;
|
bool DLLPlatform;
|
||||||
bool IsApple;
|
bool IsApple;
|
||||||
bool IsImportedTarget;
|
bool IsImportedTarget;
|
||||||
bool DebugIncludesDone;
|
mutable bool DebugIncludesDone;
|
||||||
bool DebugCompileOptionsDone;
|
mutable bool DebugCompileOptionsDone;
|
||||||
bool DebugCompileDefinitionsDone;
|
mutable bool DebugCompileDefinitionsDone;
|
||||||
mutable std::set<std::string> LinkImplicitNullProperties;
|
mutable std::set<std::string> LinkImplicitNullProperties;
|
||||||
bool BuildInterfaceIncludesAppended;
|
bool BuildInterfaceIncludesAppended;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue