summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-05-21 23:46:06 -0700
committerGarrett D'Amore <garrett@damore.org>2024-05-22 00:06:21 -0700
commitae4a87bf93ed60efdc8242e57a3ce72852f372ef (patch)
treed5f0501245407acbdec45261934eee0acbefea20
parentaac4dc360faca9ccece487ba16371d20d90e6406 (diff)
downloadnng-ae4a87bf93ed60efdc8242e57a3ce72852f372ef.tar.gz
nng-ae4a87bf93ed60efdc8242e57a3ce72852f372ef.tar.bz2
nng-ae4a87bf93ed60efdc8242e57a3ce72852f372ef.zip
Windows: add a check for broken legacy environments without timespec_get.
If you want to build on Windows use a toolchain that supports modern APIs. This means, for Microsoft, UCRT (Universal C Runtime), which is supported by default on modern Visual Studio. MinGW users may have to go out of their way to enable it. (New -D_UCRT flag or something.) The supported toolchain for building on Windows is Visual Studio. Use of other tool chains is not officially supported or guaranteed to work. YMMV.
-rw-r--r--src/platform/windows/CMakeLists.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/platform/windows/CMakeLists.txt b/src/platform/windows/CMakeLists.txt
index adf67ebd..10c31131 100644
--- a/src/platform/windows/CMakeLists.txt
+++ b/src/platform/windows/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2021 Staysail Systems, Inc. <info@staystail.tech>
+# Copyright 2024 Staysail Systems, Inc. <info@staystail.tech>
#
# This software is supplied under the terms of the MIT License, a
# copy of which should be located in the distribution where this
@@ -13,14 +13,16 @@
# the static library unless they also go into the dynamic.
if (NNG_PLATFORM_WINDOWS)
nng_check_sym(InitializeConditionVariable windows.h NNG_HAVE_CONDVAR)
+ nng_check_sym(timespec_get time.h NNG_HAVE_TIMESPEC_GET)
nng_check_sym(snprintf stdio.h NNG_HAVE_SNPRINTF)
- if (NOT NNG_HAVE_CONDVAR OR NOT NNG_HAVE_SNPRINTF)
+ if (NOT NNG_HAVE_CONDVAR OR NOT NNG_HAVE_SNPRINTF OR NOT NNG_HAVE_TIMESPEC_GET)
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. "
+ "Further, the legacy MinGW environments are not supported. "
"Ensure you have at least Windows Vista or newer, and are "
- "using either Visual Studio 2013 or newer or MinGW-W64.")
+ "using either Visual Studio 2013 or compatible compiler, "
+ "and are also using the universal C runtime (UCRT).")
endif ()
nng_link_libraries(ws2_32 mswsock advapi32)
@@ -50,4 +52,4 @@ if (NNG_PLATFORM_WINDOWS)
nng_test(win_ipc_sec_test)
-endif () \ No newline at end of file
+endif ()