diff options
author | Brad King <brad.king@kitware.com> | 2014-01-09 18:54:23 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-01-09 18:54:23 (GMT) |
commit | e56530f6121a96c0434cba673d530366907df980 (patch) | |
tree | 6f4848474b9fd414736d3e73bf805c4e60876619 /Source/cmGeneratorTarget.cxx | |
parent | 089ae7122b3ba030ca55b5a85be54b334c16f4b2 (diff) | |
parent | 531e40b95e80fbf5547b0a8d71196e819bb3aa3d (diff) | |
download | CMake-e56530f6121a96c0434cba673d530366907df980.zip CMake-e56530f6121a96c0434cba673d530366907df980.tar.gz CMake-e56530f6121a96c0434cba673d530366907df980.tar.bz2 |
Merge topic 'minor-cleanups'
531e40b cmTarget: Make GetSourceFiles populate an out-vector parameter.
38de54c cmGeneratorTarget: Add methods to access source file groups.
f579fe0 Help: Fix link to MAP_IMPORTED_CONFIG_<CONFIG>
590d238 cmTarget: Handle NO_SYSTEM_FROM_IMPORTED.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 100 |
1 files changed, 92 insertions, 8 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 6894cfc..5cd1f42 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -65,7 +65,8 @@ cmGeneratorTarget::GetSourceDepends(cmSourceFile* sf) const static void handleSystemIncludesDep(cmMakefile *mf, const std::string &name, const char *config, cmTarget *headTarget, cmGeneratorExpressionDAGChecker *dagChecker, - std::vector<std::string>& result) + std::vector<std::string>& result, + bool excludeImported) { cmTarget* depTgt = mf->FindTargetToUse(name.c_str()); @@ -85,7 +86,7 @@ static void handleSystemIncludesDep(cmMakefile *mf, const std::string &name, config, false, headTarget, depTgt, dagChecker), result); } - if (!depTgt->IsImported()) + if (!depTgt->IsImported() || excludeImported) { return; } @@ -102,6 +103,84 @@ static void handleSystemIncludesDep(cmMakefile *mf, const std::string &name, } //---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetObjectSources(std::vector<cmSourceFile*> &objs) const +{ + objs = this->ObjectSources; +} + +//---------------------------------------------------------------------------- +const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file) +{ + return this->Objects[file]; +} + +void cmGeneratorTarget::AddObject(cmSourceFile *sf, std::string const&name) +{ + this->Objects[sf] = name; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile* sf) +{ + this->ExplicitObjectName.insert(sf); +} + +//---------------------------------------------------------------------------- +bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const +{ + std::set<cmSourceFile const*>::const_iterator it + = this->ExplicitObjectName.find(file); + return it != this->ExplicitObjectName.end(); +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::GetResxSources(std::vector<cmSourceFile*>& srcs) const +{ + srcs = this->ResxSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::GetIDLSources(std::vector<cmSourceFile*>& srcs) const +{ + srcs = this->IDLSources; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetHeaderSources(std::vector<cmSourceFile*>& srcs) const +{ + srcs = this->HeaderSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget::GetExtraSources(std::vector<cmSourceFile*>& srcs) const +{ + srcs = this->ExtraSources; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetCustomCommands(std::vector<cmSourceFile*>& srcs) const +{ + srcs = this->CustomCommands; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedResxHeaders(std::set<std::string>& srcs) const +{ + srcs = this->ExpectedResxHeaders; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExternalObjects(std::vector<cmSourceFile*>& srcs) const +{ + srcs = this->ExternalObjects; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, const char *config) const { @@ -130,6 +209,9 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, this->GetName(), "SYSTEM_INCLUDE_DIRECTORIES", 0, 0); + bool excludeImported + = this->Target->GetPropertyAsBool("NO_SYSTEM_FROM_IMPORTED"); + std::vector<std::string> result; for (std::set<cmStdString>::const_iterator it = this->Target->GetSystemIncludeDirectories().begin(); @@ -156,7 +238,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, } handleSystemIncludesDep(this->Makefile, *li, config, this->Target, - &dagChecker, result); + &dagChecker, result, excludeImported); std::vector<std::string> deps; tgt->GetTransitivePropertyLinkLibraries(config, this->Target, deps); @@ -167,7 +249,7 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(const char *dir, if (uniqueDeps.insert(*di).second) { handleSystemIncludesDep(this->Makefile, *di, config, this->Target, - &dagChecker, result); + &dagChecker, result, excludeImported); } } } @@ -202,9 +284,9 @@ bool cmGeneratorTarget::GetPropertyAsBool(const char *prop) const } //---------------------------------------------------------------------------- -std::vector<cmSourceFile*> const& cmGeneratorTarget::GetSourceFiles() const +void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*> &files) const { - return this->Target->GetSourceFiles(); + this->Target->GetSourceFiles(files); } //---------------------------------------------------------------------------- @@ -216,7 +298,8 @@ void cmGeneratorTarget::ClassifySources() bool isObjLib = targetType == cmTarget::OBJECT_LIBRARY; std::vector<cmSourceFile*> badObjLib; - std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles(); + std::vector<cmSourceFile*> sources; + this->Target->GetSourceFiles(sources); for(std::vector<cmSourceFile*>::const_iterator si = sources.begin(); si != sources.end(); ++si) { @@ -414,7 +497,8 @@ cmTargetTraceDependencies this->CurrentEntry = 0; // Queue all the source files already specified for the target. - std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles(); + std::vector<cmSourceFile*> sources; + this->Target->GetSourceFiles(sources); for(std::vector<cmSourceFile*>::const_iterator si = sources.begin(); si != sources.end(); ++si) { |