From 53911769605175f022f0d2e3a8aacf2a93e76ebf Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 12 Aug 2025 14:18:01 +0000 Subject: [PATCH] Support using an external BlocksRuntime If another BlocksRuntime already exists (on macOS or because it was installed by e.g. libobjc2), then use that copy of BlocksRuntime. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45461eb78..7c954fbc6 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)