diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fe5837..1efe6bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,12 +59,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) endif() -if(CMAKE_SYSTEM_NAME MATCHES "MINGW") - set(BUILD_NC false) -endif() - -if(WIN32) +if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW")) set(BUILD_NC false) + add_definitions(-D_GNU_SOURCE) + add_definitions(-D_POSIX) + add_definitions(-D_POSIX_SOURCE) + add_definitions(-D__USE_MINGW_ANSI_STDIO) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2a9389d..d3113ab 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -25,7 +25,7 @@ add_test(aes_wrap aes_wrap) # arc4randomforktest # Windows/mingw does not have fork, but Cygwin does. -if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES "MINGW") +if(NOT (WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW"))) add_executable(arc4randomforktest arc4randomforktest.c) target_link_libraries(arc4randomforktest ${OPENSSL_LIBS}) add_test(arc4randomforktest ${CMAKE_CURRENT_SOURCE_DIR}/arc4randomforktest.sh)