diff --git a/CMakeLists.txt b/CMakeLists.txt index 45461eb..7c954fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,6 +178,8 @@ if(NOT ANDROID) find_package(LibRT) endif() +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) @@ -331,7 +333,7 @@ add_subdirectory(dispatch) add_subdirectory(man) add_subdirectory(os) add_subdirectory(private) -if(NOT APPLE) +if(NOT BlocksRuntime_FOUND) add_subdirectory(src/BlocksRuntime) endif() add_subdirectory(src) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ed5d2f4..257b02d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -80,9 +80,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_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC") target_compile_options(${name} PRIVATE -Xclang -fblocks) target_compile_options(${name} PRIVATE /W3 -Wno-deprecated-declarations)