Skip to content

Commit 0010d9a

Browse files
committed
CMake: carry over some nuances from autotools test config
Port over test-specific compilation flags and support for lenient deadlines for running in the Swift CI from Makefile.am
1 parent 698d085 commit 0010d9a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ function(add_unit_test name)
7474
${CMAKE_CURRENT_BINARY_DIR}
7575
${CMAKE_CURRENT_SOURCE_DIR}
7676
${CMAKE_SOURCE_DIR})
77+
if(CMAKE_SWIFT_COMPILER)
78+
target_compile_options(${name} PRIVATE -DLENIENT_DEADLINES=1)
79+
endif()
7780
if(WITH_BLOCKS_RUNTIME)
7881
target_include_directories(${name}
7982
SYSTEM BEFORE PRIVATE
@@ -154,3 +157,9 @@ endforeach()
154157
target_link_libraries(dispatch_group PRIVATE m)
155158
target_link_libraries(dispatch_timer_short PRIVATE m)
156159

160+
# test-specific compiler flags
161+
target_compile_options(dispatch_c99 PRIVATE -std=c99)
162+
163+
# test-specific compiler flags (for currently disabled tests)
164+
#add_unit_test(dispatch_priority2 SOURCES dispatch_priority.c)
165+
#target_compile_options(dispatch_priority2, PRIVATE -DUSE_SET_TARGET_QUEUE=1)

0 commit comments

Comments
 (0)