浏览代码

cmake: Fix generator platform under --build mode

Brad King 7 年之前
父节点
当前提交
d8294fefe8
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      Source/cmake.cxx

+ 8 - 0
Source/cmake.cxx

@@ -2467,6 +2467,14 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
       return 1;
       return 1;
     }
     }
   }
   }
+  const char* cachedGeneratorPlatform =
+    this->State->GetCacheEntryValue("CMAKE_GENERATOR_PLATFORM");
+  if (cachedGeneratorPlatform) {
+    cmMakefile mf(gen, this->GetCurrentSnapshot());
+    if (!gen->SetGeneratorPlatform(cachedGeneratorPlatform, &mf)) {
+      return 1;
+    }
+  }
   std::string output;
   std::string output;
   std::string projName;
   std::string projName;
   const char* cachedProjectName =
   const char* cachedProjectName =