aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2019-01-02 05:36:24 -0600
committerBrent Cook <busterb@gmail.com>2019-01-02 05:37:35 -0600
commitc23f745179fb9ce7543bc4507cea92c98c16b4dc (patch)
tree229c5002ee443665c1655c476e19089f3a3329f9
parentd5c155fcb8ab8d22f76e2f0b52728eade540bd67 (diff)
downloadportable-c23f745179fb9ce7543bc4507cea92c98c16b4dc.tar.gz
portable-c23f745179fb9ce7543bc4507cea92c98c16b4dc.tar.bz2
portable-c23f745179fb9ce7543bc4507cea92c98c16b4dc.zip
add some defines for building Mingw cross-compiled with CMake
-rw-r--r--CMakeLists.txt10
-rw-r--r--tests/CMakeLists.txt2
2 files changed, 6 insertions, 6 deletions
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")
59 set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread) 59 set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
60endif() 60endif()
61 61
62if(CMAKE_SYSTEM_NAME MATCHES "MINGW") 62if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW"))
63 set(BUILD_NC false)
64endif()
65
66if(WIN32)
67 set(BUILD_NC false) 63 set(BUILD_NC false)
64 add_definitions(-D_GNU_SOURCE)
65 add_definitions(-D_POSIX)
66 add_definitions(-D_POSIX_SOURCE)
67 add_definitions(-D__USE_MINGW_ANSI_STDIO)
68endif() 68endif()
69 69
70set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall") 70set(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)
25 25
26# arc4randomforktest 26# arc4randomforktest
27# Windows/mingw does not have fork, but Cygwin does. 27# Windows/mingw does not have fork, but Cygwin does.
28if(NOT CMAKE_HOST_WIN32 AND NOT CMAKE_SYSTEM_NAME MATCHES "MINGW") 28if(NOT (WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW")))
29 add_executable(arc4randomforktest arc4randomforktest.c) 29 add_executable(arc4randomforktest arc4randomforktest.c)
30 target_link_libraries(arc4randomforktest ${OPENSSL_LIBS}) 30 target_link_libraries(arc4randomforktest ${OPENSSL_LIBS})
31 add_test(arc4randomforktest ${CMAKE_CURRENT_SOURCE_DIR}/arc4randomforktest.sh) 31 add_test(arc4randomforktest ${CMAKE_CURRENT_SOURCE_DIR}/arc4randomforktest.sh)