This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via befbf7ad51059b6077de1fa34a59bde28284731a (commit) via cb56b773baeb123f22a8d4409c1a68bce0d3e45c (commit) via 409a2a800115fb55aadf78e23deb85a57b8ffcbe (commit) via 0a291271fdbd530a38722bc554e7bbb49cc7245d (commit) via 4eb2c4dcaf55ea08c633871fc54dba411803832d (commit) via c12a24cefaebc06d825578270473bf4537568ffb (commit) via cf39fd0f40c77a3a05fd921e66ee814a572e4086 (commit) via d9fde87d1a3a4de382d664bd121af957af6eaaea (commit) via d92c160db333bf65e52da1cb73a068b5d3f1db4f (commit) from 4b64d265ee79a39aabe6241f3e0811f38c0c2177 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=befbf7ad51059b6077de1fa34a59bde28284731a commit befbf7ad51059b6077de1fa34a59bde28284731a Merge: 4b64d26 cb56b77 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Fri Oct 7 15:48:13 2016 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Fri Oct 7 15:48:13 2016 -0400 Merge topic 'ninja-cleanups' into next cb56b773 Ninja: Extract a static path conversion method 409a2a80 Ninja: Inline conversion to relative path 0a291271 Ninja: Get the binary directory from cmState::Directory 4eb2c4dc Ninja: Inline output path conversion c12a24ce Ninja: Simplify method cf39fd0f Ninja: Extract identical code from condition d9fde87d Ninja: Replace array access with local variable d92c160d Ninja: Separate two coupled calls https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cb56b773baeb123f22a8d4409c1a68bce0d3e45c commit cb56b773baeb123f22a8d4409c1a68bce0d3e45c Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:33 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Extract a static path conversion method It is independent of cmLocalGenerator. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 9a7939e..1b4e34c 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -835,8 +835,14 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) cmLocalNinjaGenerator* ng = static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]); - cmState::Directory stateDir = ng->GetStateSnapshot().GetDirectory(); + return ConvertToNinjaPath(path, ng->GetStateSnapshot().GetDirectory(), + this->OutputPathPrefix); +} +std::string cmGlobalNinjaGenerator::ConvertToNinjaPath( + const std::string& path, cmState::Directory stateDir, + std::string const& prefix) +{ std::string convPath = path; if (cmOutputConverter::ContainedInDirectory(stateDir.GetCurrentBinary(), @@ -846,7 +852,7 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) } if (!cmSystemTools::FileIsFullPath(convPath)) { - convPath = this->OutputPathPrefix + convPath; + convPath = prefix + convPath; } #ifdef _WIN32 diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index dcf7406..51a8032 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -233,6 +233,9 @@ public: return this->RulesFileStream; } + static std::string ConvertToNinjaPath(const std::string& path, + cmState::Directory stateDir, + std::string const& prefix); std::string ConvertToNinjaPath(const std::string& path); std::string ConvertToNinjaFolderRule(const std::string& path); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=409a2a800115fb55aadf78e23deb85a57b8ffcbe commit 409a2a800115fb55aadf78e23deb85a57b8ffcbe Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:33 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Inline conversion to relative path diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 5bec420..9a7939e 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -837,8 +837,13 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) cmState::Directory stateDir = ng->GetStateSnapshot().GetDirectory(); - std::string convPath = - ng->ConvertToRelativePath(stateDir.GetCurrentBinary(), path); + std::string convPath = path; + + if (cmOutputConverter::ContainedInDirectory(stateDir.GetCurrentBinary(), + path, stateDir)) { + convPath = cmOutputConverter::ForceToRelativePath( + stateDir.GetCurrentBinary(), path); + } if (!cmSystemTools::FileIsFullPath(convPath)) { convPath = this->OutputPathPrefix + convPath; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0a291271fdbd530a38722bc554e7bbb49cc7245d commit 0a291271fdbd530a38722bc554e7bbb49cc7245d Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:33 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Get the binary directory from cmState::Directory This method will be extracted, so don't rely on cmLocalGenerator. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index aa1e7c2..5bec420 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -834,8 +834,12 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) { cmLocalNinjaGenerator* ng = static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]); - std::string convPath = ng->ConvertToRelativePath( - this->LocalGenerators[0]->GetState()->GetBinaryDirectory(), path); + + cmState::Directory stateDir = ng->GetStateSnapshot().GetDirectory(); + + std::string convPath = + ng->ConvertToRelativePath(stateDir.GetCurrentBinary(), path); + if (!cmSystemTools::FileIsFullPath(convPath)) { convPath = this->OutputPathPrefix + convPath; } https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4eb2c4dcaf55ea08c633871fc54dba411803832d commit 4eb2c4dcaf55ea08c633871fc54dba411803832d Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:32 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Inline output path conversion diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 5d60c66..aa1e7c2 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -836,7 +836,10 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]); std::string convPath = ng->ConvertToRelativePath( this->LocalGenerators[0]->GetState()->GetBinaryDirectory(), path); - convPath = this->NinjaOutputPath(convPath); + if (!cmSystemTools::FileIsFullPath(convPath)) { + convPath = this->OutputPathPrefix + convPath; + } + #ifdef _WIN32 std::replace(convPath.begin(), convPath.end(), '/', '\\'); #endif https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c12a24cefaebc06d825578270473bf4537568ffb commit c12a24cefaebc06d825578270473bf4537568ffb Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:32 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Simplify method HasOutputPathPrefix only checks if OutputPathPrefix is empty. The following concatenation can be done without the check. diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index f5a0e68..5d60c66 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -1423,7 +1423,7 @@ void cmGlobalNinjaGenerator::InitOutputPathPrefix() std::string cmGlobalNinjaGenerator::NinjaOutputPath(std::string const& path) { - if (!this->HasOutputPathPrefix() || cmSystemTools::FileIsFullPath(path)) { + if (cmSystemTools::FileIsFullPath(path)) { return path; } return this->OutputPathPrefix + path; https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf39fd0f40c77a3a05fd921e66ee814a572e4086 commit cf39fd0f40c77a3a05fd921e66ee814a572e4086 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:32 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Extract identical code from condition diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 22fae4c..b04c11d 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -492,10 +492,8 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( if (ccg.GetWorkingDirectory().empty()) { output = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output); - output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); - } else { - output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } + output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } vars.Output = output.c_str(); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9fde87d1a3a4de382d664bd121af957af6eaaea commit d9fde87d1a3a4de382d664bd121af957af6eaaea Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:31 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Replace array access with local variable diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index eb48653..22fae4c 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -488,13 +488,13 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( std::string output; const std::vector<std::string>& outputs = ccg.GetOutputs(); if (!outputs.empty()) { + output = outputs[0]; if (ccg.GetWorkingDirectory().empty()) { - output = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), - outputs[0]); + output = + this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output); output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } else { - output = - this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL); + output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } } vars.Output = output.c_str(); https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d92c160db333bf65e52da1cb73a068b5d3f1db4f commit d92c160db333bf65e52da1cb73a068b5d3f1db4f Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Tue Oct 4 22:56:31 2016 +0200 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Fri Oct 7 21:37:38 2016 +0200 Ninja: Separate two coupled calls diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index 5736581..eb48653 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -489,10 +489,9 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher( const std::vector<std::string>& outputs = ccg.GetOutputs(); if (!outputs.empty()) { if (ccg.GetWorkingDirectory().empty()) { - output = this->ConvertToOutputFormat( - this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), - outputs[0]), - cmOutputConverter::SHELL); + output = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), + outputs[0]); + output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } else { output = this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL); ----------------------------------------------------------------------- Summary of changes: Source/cmGlobalNinjaGenerator.cxx | 26 ++++++++++++++++++++++---- Source/cmGlobalNinjaGenerator.h | 3 +++ Source/cmLocalNinjaGenerator.cxx | 9 +++------ 3 files changed, 28 insertions(+), 10 deletions(-) hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits