From eb328da56c3fc7167b536dcb206df0abb0f4a9b9 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 13 Nov 2020 22:31:18 -0800 Subject: fixes #1087 CMakeLists structural improvements desired This doesn't modularize all the tests yet, but it goes a long way in the right direction. --- src/platform/windows/CMakeLists.txt | 58 ++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 23 deletions(-) (limited to 'src/platform/windows') diff --git a/src/platform/windows/CMakeLists.txt b/src/platform/windows/CMakeLists.txt index d6607a64..174e77f8 100644 --- a/src/platform/windows/CMakeLists.txt +++ b/src/platform/windows/CMakeLists.txt @@ -12,26 +12,38 @@ # We cannot use nng_sources_if because these tests don't go into # the static library unless they also go into the dynamic. if (NNG_PLATFORM_WINDOWS) -nng_sources( - win_impl.h - win_ipc.h - win_tcp.h - win_clock.c - win_debug.c - win_file.c - win_io.c - win_ipcconn.c - win_ipcdial.c - win_ipclisten.c - win_pipe.c - win_rand.c - win_resolv.c - win_sockaddr.c - win_tcp.c - win_tcpconn.c - win_tcpdial.c - win_tcplisten.c - win_thread.c - win_udp.c - ) -endif() \ No newline at end of file + nng_check_sym(InitializeConditionVariable windows.h NNG_HAVE_CONDVAR) + nng_check_sym(snprintf stdio.h NNG_HAVE_SNPRINTF) + if (NOT NNG_HAVE_CONDVAR OR NOT NNG_HAVE_SNPRINTF) + message(FATAL_ERROR + "Modern Windows API support is missing. " + "Versions of Windows prior to Vista are not supported. " + "Further, the 32-bit MinGW environment is not supported. " + "Ensure you have at least Windows Vista or newer, and are " + "using either Visual Studio 2013 or newer or MinGW-W64.") + endif () + nng_link_libraries(ws2_32 mswsock advapi32) + + nng_sources( + win_impl.h + win_ipc.h + win_tcp.h + win_clock.c + win_debug.c + win_file.c + win_io.c + win_ipcconn.c + win_ipcdial.c + win_ipclisten.c + win_pipe.c + win_rand.c + win_resolv.c + win_sockaddr.c + win_tcp.c + win_tcpconn.c + win_tcpdial.c + win_tcplisten.c + win_thread.c + win_udp.c + ) +endif () \ No newline at end of file -- cgit v1.2.3-70-g09d2