Skip to content

Commit bec7ee2

Browse files
committed
build: only attempt to install MSVC system libraries on Windows
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 a9f67da commit bec7ee2

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
@@ -128,11 +128,13 @@ if (MSVC)
128128
APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO)
129129
endif(MSVC)
130130

131-
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
131+
if(NOT MSVC OR CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
132+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
133+
include(InstallRequiredSystemLibraries)
134+
endif()
132135

133136
set(libdir lib${LIB_SUFFIX})
134137

135-
include (InstallRequiredSystemLibraries)
136138
install(TARGETS ${PROGRAM} ${CMARK_INSTALL}
137139
EXPORT cmark
138140
RUNTIME DESTINATION bin

0 commit comments

Comments
 (0)