add some defines for building Mingw cross-compiled with CMake

This commit is contained in:
Brent Cook 2019-01-02 05:36:24 -06:00
parent d5c155fcb8
commit c23f745179
2 changed files with 6 additions and 6 deletions

View File

@ -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")

View File

@ -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)