From c4a77f5bc74621e16a355615d9deddbcaa848ec3 Mon Sep 17 00:00:00 2001 From: Poul Thomas Lomholt Date: Tue, 12 Feb 2019 14:54:05 -0800 Subject: [PATCH] build: fix uv_test shared uv Windows cmake build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a linker error when building tests via cmake on Windows by adding the proper USING_UV_SHARED=1 define when linking to the shared libuv. Fixes: https://github.com/libuv/libuv/issues/2188 PR-URL: https://github.com/libuv/libuv/pull/2187 Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31248da4..01a7c47e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,7 +352,8 @@ target_link_libraries(uv_a ${uv_libraries}) if(BUILD_TESTING) include(CTest) add_executable(uv_run_tests ${uv_test_sources}) - target_compile_definitions(uv_run_tests PRIVATE ${uv_defines}) + target_compile_definitions(uv_run_tests + PRIVATE ${uv_defines} USING_UV_SHARED=1) target_compile_options(uv_run_tests PRIVATE ${uv_cflags}) target_include_directories(uv_run_tests PRIVATE include) target_link_libraries(uv_run_tests uv ${uv_test_libraries})