There were several _GNU_SOURCE definitions scaterred in the build
system. This patch always adds -D_GNU_SOURCE to the CFLAGS if building
on a UNIX platform.
Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
check_function_exists(signalfd HAVE_SIGNALFD)
check_function_exists(eventfd HAVE_EVENTFD)
check_function_exists(timerfd_create HAVE_TIMERFD_CREATE)
-set(CMAKE_REQUIRED_FLAGS -D_GNU_SOURCE)
check_function_exists(bindresvport HAVE_BINDRESVPORT)
-set(CMAKE_REQUIRED_FLAGS)
if (UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=pointer-arith -Werror=declaration-after-statement")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration -Werror=write-strings")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE")
# with -fPIC
check_c_compiler_flag("-fPIC" WITH_FPIC)
include_directories(${CMAKE_BINARY_DIR})
-set_source_files_properties(socket_wrapper.c
- PROPERTIES
- COMPILE_DEFINITIONS
- _GNU_SOURCE)
-
add_library(socket_wrapper SHARED socket_wrapper.c)
target_link_libraries(socket_wrapper ${SWRAP_REQUIRED_LIBRARIES})
${CMOCKA_INCLUDE_DIR}
)
-add_definitions(-D_GNU_SOURCE)
set(TORTURE_LIBRARY torture)
# RFC862 echo server