From c5ff50fc19ac8393be3cad5f7c1578a6a8c64819 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 31 May 2017 11:48:02 -0400 Subject: Tests: Fix CustomCommandByproducts regex for phony rules Update the regex to match phony rules that have no inputs. --- Tests/CustomCommandByproducts/ninja-check.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CustomCommandByproducts/ninja-check.cmake b/Tests/CustomCommandByproducts/ninja-check.cmake index 2fc3cc2..a7beb3d 100644 --- a/Tests/CustomCommandByproducts/ninja-check.cmake +++ b/Tests/CustomCommandByproducts/ninja-check.cmake @@ -4,7 +4,7 @@ if("${build_ninja}" MATCHES [====[ # Tell Ninja that they may appear as side effects of build rules # otherwise ordered by order-only dependencies. -((build [^:]*: phony [^\n]* +((build [^:]*: phony[^\n]* )*)# ========]====]) set(phony "${CMAKE_MATCH_1}") if(NOT phony) -- cgit v0.12 From 82badfffc34f043521ff3314047a3831e0fb17c7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 31 May 2017 13:32:32 -0400 Subject: Ninja: Fix CMP0058 on MinGW For CMP0058 we identify dependencies that have no rules to generate them by collecting a set of all dependencies and a set of all files CMake knows are generated by something, and then computing a set difference. Fix construction of these sets to use the same form for each path. This is after ConvertToNinjaPath but before EncodePath. Without this, the slash conversion done by EncodePath for the GNU compiler on Windows results in a mismatch, triggering an incorrect CMP0058 warning. --- Source/cmGlobalNinjaGenerator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 39f5d8f..bb0b83a 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -209,7 +209,7 @@ void cmGlobalNinjaGenerator::WriteBuild( ++i) { build += " " + EncodeIdent(EncodePath(*i), os); if (this->ComputingUnknownDependencies) { - this->CombinedBuildOutputs.insert(EncodePath(*i)); + this->CombinedBuildOutputs.insert(*i); } } if (!implicitOuts.empty()) { @@ -311,7 +311,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild( // we need to track every dependency that comes in, since we are trying // to find dependencies that are side effects of build commands for (cmNinjaDeps::const_iterator i = deps.begin(); i != deps.end(); ++i) { - this->CombinedCustomCommandExplicitDependencies.insert(EncodePath(*i)); + this->CombinedCustomCommandExplicitDependencies.insert(*i); } } } -- cgit v0.12