Skip to content

Commit b00c889

Browse files
compnerdjrose-apple
authored andcommitted
build: only attempt to install MSVC system libraries on Windows (#6)
Newer versions of CMake attempt to query the system for information about the VS 2017 installation. Unfortunately, this query fails on non-Windows systems when cross-compiling: cmake_host_system_information does not recognize <key> VS_15_DIR CMake will not find these system libraries on non-Windows hosts anyways, and we were silencing the warnings, so simply omit the installation when cross-compiling to Windows.
1 parent d875488 commit b00c889

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ if (MSVC)
115115
APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO)
116116
endif(MSVC)
117117

118-
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
119-
include (InstallRequiredSystemLibraries)
118+
if(NOT MSVC OR CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
119+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
120+
include(InstallRequiredSystemLibraries)
121+
endif()
120122
install(TARGETS ${PROGRAM} ${LIBRARY} ${STATICLIBRARY}
121123
RUNTIME DESTINATION bin
122124
LIBRARY DESTINATION lib

0 commit comments

Comments
 (0)