From bec7ee2cbce1673eb2081ba18fb22b10df3cb598 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 5 Sep 2018 13:06:11 -0700 Subject: 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 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. --- src/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 995a9df..468b0f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -128,11 +128,13 @@ if (MSVC) APPEND PROPERTY LINK_FLAGS /INCREMENTAL:NO) endif(MSVC) -set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) +if(NOT MSVC OR CMAKE_HOST_SYSTEM_NAME STREQUAL Windows) + set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) + include(InstallRequiredSystemLibraries) +endif() set(libdir lib${LIB_SUFFIX}) -include (InstallRequiredSystemLibraries) install(TARGETS ${PROGRAM} ${CMARK_INSTALL} EXPORT cmark RUNTIME DESTINATION bin -- cgit v1.2.3