Ninja: do not normalise swift support file paths

When building the output-map-file.json, do not convert the path to a
Ninja path, which will make it relative.  If `cmake` is invoked with the
`-B` option the files will be written relative to the directory where
CMake was invoked rather than relative to the build tree.  This path
need not be a relative path since it is used internally by CMake to
determine where to write the output map file.  This allows the use of
`-B` option in CMake in projects with Swift targets.
This commit is contained in:
Saleem Abdulrasool
2019-07-23 17:56:19 -07:00
parent a1debb8b08
commit 3391a3eca8

View File

@@ -910,8 +910,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements()
this->GetBuildFileStream() << "\n";
if (!this->SwiftOutputMap.empty()) {
std::string const mapFilePath = this->ConvertToNinjaPath(
this->GeneratorTarget->GetSupportDirectory() + "/output-file-map.json");
std::string const mapFilePath =
this->GeneratorTarget->GetSupportDirectory() + "/output-file-map.json";
std::string const targetSwiftDepsPath = [this]() -> std::string {
cmGeneratorTarget const* target = this->GeneratorTarget;
if (const char* name = target->GetProperty("Swift_DEPENDENCIES_FILE")) {