diff --git a/CMakeLists.txt b/CMakeLists.txt index 75c419c13..458c1cd95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,8 @@ endif() find_package(LibRT) +find_package(BlocksRuntime QUIET) + check_function_exists(_pthread_workqueue_init HAVE__PTHREAD_WORKQUEUE_INIT) check_function_exists(getprogname HAVE_GETPROGNAME) check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c88b430de..e2da3aaa8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,4 @@ - -if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) +if(NOT BlocksRuntime_FOUND) add_subdirectory(BlocksRuntime) endif() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a27603559..0af5aac87 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -78,9 +78,6 @@ function(add_unit_test name) # to reduce probability of test failures due to machine load. target_compile_options(${name} PRIVATE -DLENIENT_DEADLINES=1) endif() - target_include_directories(${name} - SYSTEM BEFORE PRIVATE - "${BlocksRuntime_INCLUDE_DIR}") if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") target_compile_options(${name} PRIVATE -Xclang -fblocks) target_compile_options(${name} PRIVATE /W3 -Wno-deprecated-declarations)