cmake: force POSIX with gcc

This commit is contained in:
Hugues Delorme 2016-12-23 22:16:12 +01:00
parent a2ad3b9d4b
commit 3acc51f73c

View File

@ -125,6 +125,7 @@ test_big_endian(GMIO_HOST_IS_BIG_ENDIAN)
# Adapt C compiler flags to enable strict ISO C99 conformance
if(CMAKE_C_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic-errors")
add_definitions(-D_POSIX_SOURCE)
endif()
set(CMAKE_REQUIRED_FLAGS "${CMAKE_C_FLAGS}")