diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-09 22:29:47 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-12 16:39:59 (GMT) |
commit | ce75c86ec30e736a738a4143d4abad73117e06c6 (patch) | |
tree | 6abb1bb3bc07a63021f096670c1e2b34d93f04af | |
parent | 526cc7dc52673f1eeb1055ce381e0551f763daea (diff) | |
download | CMake-ce75c86ec30e736a738a4143d4abad73117e06c6.zip CMake-ce75c86ec30e736a738a4143d4abad73117e06c6.tar.gz CMake-ce75c86ec30e736a738a4143d4abad73117e06c6.tar.bz2 |
cmGeneratorTarget: Move GetSupportDirectory from cmTarget.
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 15 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 4 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 15 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
12 files changed, 38 insertions, 39 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 582282b..1699362 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5512,3 +5512,18 @@ bool cmGeneratorTarget::HasImportLibrary() const (this->GetType() == cmTarget::SHARED_LIBRARY || this->Target->IsExecutableWithExports())); } + +//---------------------------------------------------------------------------- +std::string cmGeneratorTarget::GetSupportDirectory() const +{ + std::string dir = this->Makefile->GetCurrentBinaryDirectory(); + dir += cmake::GetCMakeFilesDirectory(); + dir += "/"; + dir += this->GetName(); +#if defined(__VMS) + dir += "_dir"; +#else + dir += ".dir"; +#endif + return dir; +} diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c6e56bf..258c556 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -401,6 +401,9 @@ public: /** Return whether or not the target has a DLL import library. */ bool HasImportLibrary() const; + /** Get a build-tree directory in which to place target support files. */ + std::string GetSupportDirectory() const; + struct SourceFileFlags GetTargetSourceFileFlags(const cmSourceFile* sf) const; diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 765a538..6750611 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2893,13 +2893,14 @@ void cmGlobalGenerator::WriteSummary() { continue; } - this->WriteSummary(ti->second); - fout << ti->second->GetSupportDirectory() << "\n"; + cmGeneratorTarget* gt = this->GetGeneratorTarget(ti->second); + this->WriteSummary(gt); + fout << gt->GetSupportDirectory() << "\n"; } } //---------------------------------------------------------------------------- -void cmGlobalGenerator::WriteSummary(cmTarget* target) +void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target) { // Place the labels file in a per-target support directory. std::string dir = target->GetSupportDirectory(); @@ -2942,17 +2943,15 @@ void cmGlobalGenerator::WriteSummary(cmTarget* target) fout << "# Source files and their labels\n"; std::vector<cmSourceFile*> sources; std::vector<std::string> configs; - target->GetMakefile()->GetConfigurations(configs); + target->Target->GetMakefile()->GetConfigurations(configs); if (configs.empty()) { configs.push_back(""); } - cmGeneratorTarget* gt = - this->GetGeneratorTarget(target); for(std::vector<std::string>::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { - gt->GetSourceFiles(sources, *ci); + target->GetSourceFiles(sources, *ci); } std::vector<cmSourceFile*>::const_iterator sourcesEnd = cmRemoveDuplicates(sources); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index b22c695..55e3766 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -458,7 +458,7 @@ private: void WriteRuleHashes(std::string const& pfile); void WriteSummary(); - void WriteSummary(cmTarget* target); + void WriteSummary(cmGeneratorTarget* target); void FinalizeTargetCompileInfo(); virtual void ForceLinkerLanguages(); diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index de84f89..2d2de5f 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -361,7 +361,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) vars.CMTarget = this->Target; vars.Language = linkLanguage.c_str(); vars.Objects = buildObjs.c_str(); - std::string objectDir = this->Target->GetSupportDirectory(); + std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); objectDir = this->Convert(objectDir, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 2b019be..8b60a23 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -572,7 +572,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules if(this->Target->GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { std::string name_of_def_file = - this->Target->GetSupportDirectory(); + this->GeneratorTarget->GetSupportDirectory(); name_of_def_file += std::string("/") + this->Target->GetName(); name_of_def_file += ".def"; @@ -643,7 +643,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules vars.CMTarget = this->Target; vars.Language = linkLanguage.c_str(); vars.Objects = buildObjs.c_str(); - std::string objectDir = this->Target->GetSupportDirectory(); + std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); objectDir = this->Convert(objectDir, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5f9367d..4ddcac6 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -557,7 +557,8 @@ cmMakefileTargetGenerator this->GeneratorTarget->GetCompilePDBPath(this->ConfigName); if(targetFullPathCompilePDB.empty()) { - targetFullPathCompilePDB = this->Target->GetSupportDirectory() + "/"; + targetFullPathCompilePDB = + this->GeneratorTarget->GetSupportDirectory() + "/"; } } @@ -594,7 +595,7 @@ cmMakefileTargetGenerator cmLocalGenerator::NONE, cmLocalGenerator::SHELL); vars.Object = shellObj.c_str(); - std::string objectDir = this->Target->GetSupportDirectory(); + std::string objectDir = this->GeneratorTarget->GetSupportDirectory(); objectDir = this->Convert(objectDir, cmLocalGenerator::START_OUTPUT, cmLocalGenerator::SHELL); diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 874a120..c64fe50 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -492,9 +492,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() { if(target.GetPropertyAsBool("WINDOWS_EXPORT_ALL_SYMBOLS")) { - std::string dllname = targetOutput; std::string name_of_def_file - = target.GetSupportDirectory(); + = gt.GetSupportDirectory(); name_of_def_file += "/" + target.GetName(); name_of_def_file += ".def "; vars["LINK_FLAGS"] += " /DEF:"; @@ -582,7 +581,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() vars["TARGET_PDB"] = base + suffix + dbg_suffix; } - const std::string objPath = GetTarget()->GetSupportDirectory(); + const std::string objPath = GetGeneratorTarget()->GetSupportDirectory(); vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( this->ConvertToNinjaPath(objPath), cmLocalGenerator::SHELL); @@ -634,7 +633,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() this->GetLocalGenerator()->ConvertToOutputFormat( cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); std::string name_of_def_file - = target.GetSupportDirectory(); + = gt.GetSupportDirectory(); name_of_def_file += "/" + target.GetName(); name_of_def_file += ".def"; std::string cmd = cmakeCommand; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index dcd7bd8..4080d90 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -298,7 +298,7 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); if(compilePdbPath.empty()) { - compilePdbPath = this->Target->GetSupportDirectory() + "/"; + compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/"; } } @@ -567,7 +567,7 @@ cmNinjaTargetGenerator std::string const language = source->GetLanguage(); std::string const sourceFileName = language=="RC" ? source->GetFullPath() : this->GetSourceFilePath(source); - std::string const objectDir = this->Target->GetSupportDirectory(); + std::string const objectDir = this->GeneratorTarget->GetSupportDirectory(); std::string const objectFileName = this->GetObjectFilePath(source); std::string const objectFileDir = cmSystemTools::GetFilenamePath(objectFileName); diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index 378f132..6e3f65f 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -64,7 +64,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* target, std::string basename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFile); - std::string rcc_output_dir = target->Target->GetSupportDirectory(); + std::string rcc_output_dir = target->GetSupportDirectory(); cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); std::string rcc_output_file = rcc_output_dir; rcc_output_file += "/qrc_" + basename + ".cpp"; @@ -833,7 +833,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget( std::string basename = cmsys::SystemTools:: GetFilenameWithoutLastExtension(absFile); - std::string rcc_output_dir = target->Target->GetSupportDirectory(); + std::string rcc_output_dir = target->GetSupportDirectory(); cmSystemTools::MakeDirectory(rcc_output_dir.c_str()); std::string rcc_output_file = rcc_output_dir; rcc_output_file += "/qrc_" + basename + ".cpp"; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b16bc30..b8beb5c 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -382,21 +382,6 @@ cmListFileBacktrace const& cmTarget::GetBacktrace() const } //---------------------------------------------------------------------------- -std::string cmTarget::GetSupportDirectory() const -{ - std::string dir = this->Makefile->GetCurrentBinaryDirectory(); - dir += cmake::GetCMakeFilesDirectory(); - dir += "/"; - dir += this->Name; -#if defined(__VMS) - dir += "_dir"; -#else - dir += ".dir"; -#endif - return dir; -} - -//---------------------------------------------------------------------------- bool cmTarget::IsExecutableWithExports() const { return (this->GetType() == cmTarget::EXECUTABLE && diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 291ef87..01261ed 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -282,9 +282,6 @@ public: /** Get a backtrace from the creation of the target. */ cmListFileBacktrace const& GetBacktrace() const; - /** Get a build-tree directory in which to place target support files. */ - std::string GetSupportDirectory() const; - /** @return whether this target have a well defined output file name. */ bool HaveWellDefinedOutputFiles() const; |