Add Posix/XOpen support flags for Unix builds that aren't FreeBSD.

This commit is contained in:
Jim Hague 2019-10-14 09:45:38 +01:00
parent 7a0a2f712d
commit d1dca186bc
1 changed files with 3 additions and 0 deletions

View File

@ -76,6 +76,9 @@ elseif (APPLE)
elseif (UNIX)
set(HOSTOS "unix")
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600")
endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX 1)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_BSD_SOURCE -D_DEFAULT_SOURCE")