Fix MSVC builds on cmake windows in vcpkg (#1835)

This commit is contained in:
Thad House
2019-08-19 20:28:48 -07:00
committed by Peter Johnson
parent 7e95010a29
commit 9fd2b5e3fa

View File

@@ -132,7 +132,7 @@ if (NOT USE_VCPKG_LIBUV)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/libuv/include>
$<INSTALL_INTERFACE:${include_dest}/wpiutil>)
if(NOT MSVC)
target_sources(wpiutil PRIVATE ${wpiutil_unix_src} ${uv_unix_src})
target_sources(wpiutil PRIVATE ${uv_unix_src})
if (APPLE)
target_sources(wpiutil PRIVATE ${uv_darwin_src})
else()
@@ -140,7 +140,7 @@ if (NOT USE_VCPKG_LIBUV)
endif()
target_compile_definitions(wpiutil PRIVATE -D_GNU_SOURCE)
else()
target_sources(wpiutil PRIVATE ${wpiutil_windows_src} ${uv_windows_src})
target_sources(wpiutil PRIVATE ${uv_windows_src})
if(BUILD_SHARED_LIBS)
target_compile_definitions(wpiutil PRIVATE -DBUILDING_UV_SHARED)
endif()
@@ -150,6 +150,12 @@ else()
target_link_libraries(wpiutil unofficial::libuv::libuv)
endif()
if (MSVC)
target_sources(wpiutil PRIVATE ${wpiutil_windows_src})
else ()
target_sources(wpiutil PRIVATE ${wpiutil_unix_src})
endif()
target_include_directories(wpiutil PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>
$<INSTALL_INTERFACE:${include_dest}/wpiutil>)