diff options
author | Brad King <brad.king@kitware.com> | 2016-08-30 13:29:53 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-30 13:29:53 (GMT) |
commit | e3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc (patch) | |
tree | e9facd72c23705a7527a68f44eade8ad20e313fe /Source/cmMakefileLibraryTargetGenerator.cxx | |
parent | ef58e97362d10877780aed7b6806dd02ce2f4303 (diff) | |
parent | 4332131dcca03b262e0dd51352eb2e27522887c8 (diff) | |
download | CMake-e3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc.zip CMake-e3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc.tar.gz CMake-e3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc.tar.bz2 |
Merge topic 'cleanup-Convert'
4332131d Convert: Make variables a bit more clear
5aca066c Convert: Remove UNCHANGED enum value
146bf926 Convert: Remove 'FULL' conversion
58ba87f8 Convert: Replace Convert(FULL) with equivalent
e80314d7 Ninja: Replace ternary with if()
563ac22a Convert: Replace trivial conversion with new method
08be47cf Convert: Replace UNCHANGED conversions with new API call
564d3a1d Convert: Extract ConvertToRelativePath from Convert()
95a659f1 Convert: Replace FULL conversions with equivalent
a8c7ccb1 VS: Replace FULL/UNCHANGED conversion with equivalent
5ad25ef4 Convert: Remove NONE conversion
ac463841 Convert: Replace uses of Convert(NONE)
998d9ee9 VS: Replace variable with an if()
ee49f006 Makefiles: Replace ternaries with if()s
51f7dcb0 Makefiles: Inline MakeLauncher into only caller
ba4ba7c3 Makefiles: Simplify MakeLauncher return value
...
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 580343d..c31c469 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -112,7 +112,7 @@ void cmMakefileLibraryTargetGenerator::WriteObjectLibraryRules() // Add post-build rules. this->LocalGenerator->AppendCustomCommands( commands, this->GeneratorTarget->GetPostBuildCommands(), - this->GeneratorTarget); + this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory()); // Depend on the object files. this->AppendObjectDepends(depends); @@ -310,8 +310,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Construct the output path version of the names for use in command // arguments. - std::string targetOutPathPDB = this->Convert( - targetFullPathPDB, cmOutputConverter::NONE, cmOutputConverter::SHELL); + std::string targetOutPathPDB = this->LocalGenerator->ConvertToOutputFormat( + targetFullPathPDB, cmOutputConverter::SHELL); std::string targetOutPath = this->Convert( targetFullPath, cmOutputConverter::START_OUTPUT, cmOutputConverter::SHELL); std::string targetOutPathSO = @@ -367,46 +367,40 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( // Clean files associated with this library. std::vector<std::string> libCleanFiles; - libCleanFiles.push_back(this->Convert(targetFullPath, - cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + targetFullPath, cmOutputConverter::START_OUTPUT)); if (targetNameReal != targetName) { - libCleanFiles.push_back(this->Convert(targetFullPathReal, - cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + targetFullPathReal, cmOutputConverter::START_OUTPUT)); } if (targetNameSO != targetName && targetNameSO != targetNameReal) { - libCleanFiles.push_back(this->Convert(targetFullPathSO, - cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + targetFullPathSO, cmOutputConverter::START_OUTPUT)); } if (!targetNameImport.empty()) { - libCleanFiles.push_back(this->Convert(targetFullPathImport, - cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + targetFullPathImport, cmOutputConverter::START_OUTPUT)); std::string implib; if (this->GeneratorTarget->GetImplibGNUtoMS(targetFullPathImport, implib)) { - libCleanFiles.push_back(this->Convert(implib, - cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + implib, cmOutputConverter::START_OUTPUT)); } } // List the PDB for cleaning only when the whole target is // cleaned. We do not want to delete the .pdb file just before // linking the target. - this->CleanFiles.push_back(this->Convert(targetFullPathPDB, - cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + this->CleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + targetFullPathPDB, cmOutputConverter::START_OUTPUT)); #ifdef _WIN32 // There may be a manifest file for this target. Add it to the // clean set just in case. if (this->GeneratorTarget->GetType() != cmState::STATIC_LIBRARY) { - libCleanFiles.push_back(this->Convert( - (targetFullPath + ".manifest").c_str(), cmOutputConverter::START_OUTPUT, - cmOutputConverter::UNCHANGED)); + libCleanFiles.push_back(this->LocalGenerator->ConvertToRelativePath( + (targetFullPath + ".manifest").c_str(), + cmOutputConverter::START_OUTPUT)); } #endif @@ -418,7 +412,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( this->GeneratorTarget, "target"); this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmOutputConverter::HOME_OUTPUT); + this->LocalGenerator->GetBinaryDirectory()); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); } @@ -427,10 +421,10 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( if (!relink) { this->LocalGenerator->AppendCustomCommands( commands, this->GeneratorTarget->GetPreBuildCommands(), - this->GeneratorTarget); + this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory()); this->LocalGenerator->AppendCustomCommands( commands, this->GeneratorTarget->GetPreLinkCommands(), - this->GeneratorTarget); + this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory()); } // Determine whether a link script will be used. @@ -572,8 +566,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( vars.TargetInstallNameDir = ""; } else { // Convert to a path for the native build tool. - install_name_dir = this->LocalGenerator->Convert( - install_name_dir, cmOutputConverter::NONE, cmOutputConverter::SHELL); + install_name_dir = this->LocalGenerator->ConvertToOutputFormat( + install_name_dir, cmOutputConverter::SHELL); vars.TargetInstallNameDir = install_name_dir.c_str(); } } @@ -640,9 +634,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( cmSystemTools::ExpandListArgument(linkRule, real_link_commands); if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE") && (this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY)) { - std::string cmakeCommand = - this->Convert(cmSystemTools::GetCMakeCommand(), - cmLocalGenerator::NONE, cmLocalGenerator::SHELL); + std::string cmakeCommand = this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL); cmakeCommand += " -E __run_iwyu --lwyu="; cmakeCommand += targetOutPathReal; real_link_commands.push_back(cmakeCommand); @@ -672,7 +665,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( } this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmOutputConverter::HOME_OUTPUT); + this->LocalGenerator->GetBinaryDirectory()); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); @@ -689,7 +682,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( commands1.push_back(symlink); this->LocalGenerator->CreateCDCommand( commands1, this->Makefile->GetCurrentBinaryDirectory(), - cmOutputConverter::HOME_OUTPUT); + this->LocalGenerator->GetBinaryDirectory()); commands.insert(commands.end(), commands1.begin(), commands1.end()); commands1.clear(); } @@ -698,7 +691,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules( if (!relink) { this->LocalGenerator->AppendCustomCommands( commands, this->GeneratorTarget->GetPostBuildCommands(), - this->GeneratorTarget); + this->GeneratorTarget, this->LocalGenerator->GetBinaryDirectory()); } // Compute the list of outputs. |