ソースを参照

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.
Saleem Abdulrasool 6 年 前
コミット
3391a3eca8
1 ファイル変更2 行追加2 行削除
  1. 2 2
      Source/cmNinjaTargetGenerator.cxx

+ 2 - 2
Source/cmNinjaTargetGenerator.cxx

@@ -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")) {