[PATCH] D41220: [cmake] Only attempt to install MSVC system libraries on Windows

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 13 19:47:30 PST 2017


Lgtm
On Wed, Dec 13, 2017 at 7:07 PM Shoaib Meenai via Phabricator <
reviews at reviews.llvm.org> wrote:

> smeenai created this revision.
> smeenai added reviewers: compnerd, rnk, zturner.
> Herald added a subscriber: mgorny.
>
> 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.
>
>
> https://reviews.llvm.org/D41220
>
> Files:
>   CMakeLists.txt
>   cmake/platforms/WinMsvc.cmake
>
>
> Index: cmake/platforms/WinMsvc.cmake
> ===================================================================
> --- cmake/platforms/WinMsvc.cmake
> +++ cmake/platforms/WinMsvc.cmake
> @@ -300,11 +300,5 @@
>  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)
> -
>  # Allow clang-cl to work with macOS paths.
>  set(CMAKE_USER_MAKE_RULES_OVERRIDE
> "${CMAKE_CURRENT_LIST_DIR}/ClangClCMakeCompileRules.cmake")
> Index: CMakeLists.txt
> ===================================================================
> --- CMakeLists.txt
> +++ CMakeLists.txt
> @@ -1010,7 +1010,7 @@
>  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()
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171214/c12c3154/attachment.html>


More information about the llvm-commits mailing list