Skip to content

Commit

Permalink
cmake: limit some macros to mingw
Browse files Browse the repository at this point in the history
Syncing this up with autotools.

Also use the built-in `MINGW` variable.
  • Loading branch information
vszakats committed Dec 14, 2023
1 parent f1cfcd5 commit 17cf672
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(PLATFORM_LIBS ${PLATFORM_LIBS} pthread)
endif()

if(WIN32 OR (CMAKE_SYSTEM_NAME MATCHES "MINGW"))
if(WIN32)
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)
if(MINGW)
add_definitions(-D_GNU_SOURCE)
add_definitions(-D_POSIX)
add_definitions(-D_POSIX_SOURCE)
add_definitions(-D__USE_MINGW_ANSI_STDIO)
endif()
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
Expand Down

0 comments on commit 17cf672

Please sign in to comment.