Lgtm<br><div class="gmail_quote"><div dir="ltr">On Wed, Dec 13, 2017 at 7:07 PM Shoaib Meenai via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">smeenai created this revision.<br>
smeenai added reviewers: compnerd, rnk, zturner.<br>
Herald added a subscriber: mgorny.<br>
<br>
Newer versions of CMake (I'm on 3.10, but I believe 3.9 behaves the same<br>
way) attempt to query the system for information about the VS 2017<br>
install. Unfortunately, this query fails on non-Windows systems:<br>
<br>
  cmake_host_system_information does not recognize <key> VS_15_DIR<br>
<br>
CMake isn't going to find these system libraries on non-Windows anyway<br>
(and we were previously silencing the resultant warnings in our<br>
cross-compilation toolchain), so it makes sense to just omit the<br>
attempted installation entirely on non-Windows.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D41220" rel="noreferrer" target="_blank">https://reviews.llvm.org/D41220</a><br>
<br>
Files:<br>
  CMakeLists.txt<br>
  cmake/platforms/WinMsvc.cmake<br>
<br>
<br>
Index: cmake/platforms/WinMsvc.cmake<br>
===================================================================<br>
--- cmake/platforms/WinMsvc.cmake<br>
+++ cmake/platforms/WinMsvc.cmake<br>
@@ -300,11 +300,5 @@<br>
 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)<br>
 set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)<br>
<br>
-# CMake's InstallRequiredSystemLibraries module searches for a Visual Studio<br>
-# installation in order to determine where to copy the required DLLs. This<br>
-# installation won't exist when cross-compiling, of course, so silence the<br>
-# resulting warnings about missing libraries.<br>
-set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)<br>
-<br>
 # Allow clang-cl to work with macOS paths.<br>
 set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_LIST_DIR}/ClangClCMakeCompileRules.cmake")<br>
Index: CMakeLists.txt<br>
===================================================================<br>
--- CMakeLists.txt<br>
+++ CMakeLists.txt<br>
@@ -1010,7 +1010,7 @@<br>
 endif()<br>
<br>
 # This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake<br>
-if (MSVC)<br>
+if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")<br>
   include(InstallRequiredSystemLibraries)<br>
 endif()<br>
<br>
<br>
<br>
</blockquote></div>