diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-02-08 05:27:00 (GMT) |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2019-02-11 18:44:24 (GMT) |
commit | fc8b90af2c7f35f770b3167de2dd4c632b3042ea (patch) | |
tree | 018c561eea618044d60bb2530a563f534934da80 /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 8a1d25afdf92cabab88598cc9b9e5a9fb2a9493b (diff) | |
download | CMake-fc8b90af2c7f35f770b3167de2dd4c632b3042ea.zip CMake-fc8b90af2c7f35f770b3167de2dd4c632b3042ea.tar.gz CMake-fc8b90af2c7f35f770b3167de2dd4c632b3042ea.tar.bz2 |
Create and use `cmGeneratorTarget::Names`
Rather than taking a number of out parameters for the various names,
create a structure that is reused for both `GetLibraryNames` and
`GetExecutableNames`. Replace uses according to the new interface.
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index e8ae5ae..572270a 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -31,9 +31,8 @@ cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator( : cmMakefileTargetGenerator(target) { this->CustomCommandDriver = OnDepends; - this->GeneratorTarget->GetExecutableNames( - this->TargetNameOut, this->TargetNameReal, this->TargetNameImport, - this->TargetNamePDB, this->ConfigName); + this->TargetNames = + this->GeneratorTarget->GetExecutableNames(this->ConfigName); this->OSXBundleGenerator = new cmOSXBundleGenerator(target, this->ConfigName); @@ -305,18 +304,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::vector<std::string> commands; // Get the name of the executable to generate. - std::string targetName; - std::string targetNameReal; - std::string targetNameImport; - std::string targetNamePDB; - this->GeneratorTarget->GetExecutableNames(targetName, targetNameReal, - targetNameImport, targetNamePDB, - this->ConfigName); + cmGeneratorTarget::Names targetNames = + this->GeneratorTarget->GetExecutableNames(this->ConfigName); // Construct the full path version of the names. std::string outpath = this->GeneratorTarget->GetDirectory(this->ConfigName); if (this->GeneratorTarget->IsAppBundleOnApple()) { - this->OSXBundleGenerator->CreateAppBundle(targetName, outpath); + this->OSXBundleGenerator->CreateAppBundle(targetNames.Output, outpath); } outpath += "/"; std::string outpathImp; @@ -326,12 +320,12 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) outpath += "/CMakeRelink.dir"; cmSystemTools::MakeDirectory(outpath); outpath += "/"; - if (!targetNameImport.empty()) { + if (!targetNames.ImportLibrary.empty()) { outpathImp = outpath; } } else { cmSystemTools::MakeDirectory(outpath); - if (!targetNameImport.empty()) { + if (!targetNames.ImportLibrary.empty()) { outpathImp = this->GeneratorTarget->GetDirectory( this->ConfigName, cmStateEnums::ImportLibraryArtifact); cmSystemTools::MakeDirectory(outpathImp); @@ -348,10 +342,10 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) cmSystemTools::MakeDirectory(pdbOutputPath); pdbOutputPath += "/"; - std::string targetFullPath = outpath + targetName; - std::string targetFullPathReal = outpath + targetNameReal; - std::string targetFullPathPDB = pdbOutputPath + targetNamePDB; - std::string targetFullPathImport = outpathImp + targetNameImport; + std::string targetFullPath = outpath + targetNames.Output; + std::string targetFullPathReal = outpath + targetNames.Real; + std::string targetFullPathPDB = pdbOutputPath + targetNames.PDB; + std::string targetFullPathImport = outpathImp + targetNames.ImportLibrary; std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat( targetFullPathPDB, cmOutputConverter::SHELL); // Convert to the output path to use in constructing commands. @@ -468,11 +462,11 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPath + ".manifest")); #endif - if (targetNameReal != targetName) { + if (this->TargetNames.Real != this->TargetNames.Output) { exeCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathReal)); } - if (!targetNameImport.empty()) { + if (!this->TargetNames.ImportLibrary.empty()) { exeCleanFiles.push_back(this->LocalGenerator->MaybeConvertToRelativePath( this->LocalGenerator->GetCurrentBinaryDirectory(), targetFullPathImport)); |