From 9fd2b5e3fa26d9daacd9ed1c3833a0ee7746b1da Mon Sep 17 00:00:00 2001 From: Thad House Date: Mon, 19 Aug 2019 20:28:48 -0700 Subject: [PATCH] Fix MSVC builds on cmake windows in vcpkg (#1835) --- wpiutil/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wpiutil/CMakeLists.txt b/wpiutil/CMakeLists.txt index ef3c5d6b02..33f47989d2 100644 --- a/wpiutil/CMakeLists.txt +++ b/wpiutil/CMakeLists.txt @@ -132,7 +132,7 @@ if (NOT USE_VCPKG_LIBUV) $ $) 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 $ $)