diff options
author | Andreas Schneider <asn@samba.org> | 2018-09-02 11:18:09 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2018-10-23 15:38:36 +0200 |
commit | aa9b0da96927e957f6ed0b1b9d51b16db90ea2af (patch) | |
tree | a2f00464b7b71e53c07279a1317404dc9e4d5849 /tests | |
parent | 567261810523f2ab3af10268fc4a64d863ce2c93 (diff) | |
download | socket_wrapper-aa9b0da96927e957f6ed0b1b9d51b16db90ea2af.tar.gz socket_wrapper-aa9b0da96927e957f6ed0b1b9d51b16db90ea2af.tar.xz socket_wrapper-aa9b0da96927e957f6ed0b1b9d51b16db90ea2af.zip |
cmake: Improve checks for compiler flags
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6884473..4a89126 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -11,9 +11,17 @@ set(TORTURE_LIBRARY torture) # RFC862 echo server add_executable(echo_srv echo_srv.c) +target_compile_options(echo_srv + PRIVATE + ${DEFAULT_C_COMPILE_FLAGS} + -D_GNU_SOURCE) target_link_libraries(echo_srv ${SWRAP_REQUIRED_LIBRARIES}) add_library(${TORTURE_LIBRARY} STATIC torture.c) +target_compile_options(${TORTURE_LIBRARY} + PRIVATE + ${DEFAULT_C_COMPILE_FLAGS} + -D_GNU_SOURCE) target_link_libraries(${TORTURE_LIBRARY} ${CMOCKA_LIBRARY} ${SWRAP_REQUIRED_LIBRARIES} @@ -54,6 +62,10 @@ endif (HAVE_STRUCT_MSGHDR_MSG_CONTROL) foreach(_SWRAP_TEST ${SWRAP_TESTS}) add_cmocka_test(${_SWRAP_TEST} ${_SWRAP_TEST}.c ${TORTURE_LIBRARY}) + target_compile_options(${_SWRAP_TEST} + PRIVATE + ${DEFAULT_C_COMPILE_FLAGS} + -D_GNU_SOURCE) if (OSX) set_property( @@ -99,4 +111,6 @@ endif() # test_fork_pthread add_library(thread_deadlock SHARED thread_deadlock.c) target_link_libraries(thread_deadlock ${CMAKE_THREAD_LIBS_INIT}) +target_compile_options(thread_deadlock PRIVATE ${DEFAULT_C_COMPILE_FLAGS}) target_link_libraries(test_fork_thread_deadlock thread_deadlock) +target_compile_options(test_fork_thread_deadlock PRIVATE ${DEFAULT_C_COMPILE_FLAGS}) |