[llvm] r320724 - [cmake] Only attempt to install MSVC system libraries on Windows

Shoaib Meenai via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 10:41:49 PST 2017


Author: smeenai
Date: Thu Dec 14 10:41:49 2017
New Revision: 320724

URL: http://llvm.org/viewvc/llvm-project?rev=320724&view=rev
Log:
[cmake] Only attempt to install MSVC system libraries on Windows

Newer versions of CMake (I'm on 3.10, but I believe 3.9 behaves the same
way) attempt to query the system for information about the VS 2017
install. Unfortunately, this query fails on non-Windows systems:

  cmake_host_system_information does not recognize <key> VS_15_DIR

CMake isn't going to find these system libraries on non-Windows anyway
(and we were previously silencing the resultant warnings in our
cross-compilation toolchain), so it makes sense to just omit the
attempted installation entirely on non-Windows.

Differential Revision: https://reviews.llvm.org/D41220

Modified:
    llvm/trunk/CMakeLists.txt
    llvm/trunk/cmake/platforms/WinMsvc.cmake

Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=320724&r1=320723&r2=320724&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Thu Dec 14 10:41:49 2017
@@ -1010,7 +1010,7 @@ if(LLVM_DISTRIBUTION_COMPONENTS)
 endif()
 
 # This allows us to deploy the Universal CRT DLLs by passing -DCMAKE_INSTALL_UCRT_LIBRARIES=ON to CMake
-if (MSVC)
+if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
   include(InstallRequiredSystemLibraries)
 endif()
 

Modified: llvm/trunk/cmake/platforms/WinMsvc.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/platforms/WinMsvc.cmake?rev=320724&r1=320723&r2=320724&view=diff
==============================================================================
--- llvm/trunk/cmake/platforms/WinMsvc.cmake (original)
+++ llvm/trunk/cmake/platforms/WinMsvc.cmake Thu Dec 14 10:41:49 2017
@@ -299,10 +299,3 @@ set(CMAKE_SHARED_LINKER_FLAGS "${_CMAKE_
 # control which libraries they require.
 set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
 set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
-
-# CMake's InstallRequiredSystemLibraries module searches for a Visual Studio
-# installation in order to determine where to copy the required DLLs. This
-# installation won't exist when cross-compiling, of course, so silence the
-# resulting warnings about missing libraries.
-set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
-




More information about the llvm-commits mailing list