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.
This commit is contained in:
Brad King 2017-05-31 13:32:32 -04:00
parent c5ff50fc19
commit 82badfffc3

View File

@ -209,7 +209,7 @@ void cmGlobalNinjaGenerator::WriteBuild(
++i) { ++i) {
build += " " + EncodeIdent(EncodePath(*i), os); build += " " + EncodeIdent(EncodePath(*i), os);
if (this->ComputingUnknownDependencies) { if (this->ComputingUnknownDependencies) {
this->CombinedBuildOutputs.insert(EncodePath(*i)); this->CombinedBuildOutputs.insert(*i);
} }
} }
if (!implicitOuts.empty()) { if (!implicitOuts.empty()) {
@ -311,7 +311,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
// we need to track every dependency that comes in, since we are trying // we need to track every dependency that comes in, since we are trying
// to find dependencies that are side effects of build commands // to find dependencies that are side effects of build commands
for (cmNinjaDeps::const_iterator i = deps.begin(); i != deps.end(); ++i) { for (cmNinjaDeps::const_iterator i = deps.begin(); i != deps.end(); ++i) {
this->CombinedCustomCommandExplicitDependencies.insert(EncodePath(*i)); this->CombinedCustomCommandExplicitDependencies.insert(*i);
} }
} }
} }