|
| 1 | +From f49931127fe7673931c6550194c593923b2fbfd7 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Niels Grewe < [email protected]> |
| 3 | +Date: Sun, 24 Nov 2019 08:24:56 +0100 |
| 4 | +Subject: [PATCH 1/2] build: search for system-supplied libBlocksRuntime |
| 5 | + |
| 6 | +This allows the user to provide a version of libBlocksRuntime on |
| 7 | +systems other than Darwin. |
| 8 | + |
| 9 | +https://github.com/apple/swift-corelibs-libdispatch/pull/534 |
| 10 | +--- |
| 11 | + CMakeLists.txt | 2 ++ |
| 12 | + cmake/modules/FindBlocksRuntime.cmake | 2 ++ |
| 13 | + src/CMakeLists.txt | 3 +-- |
| 14 | + 3 files changed, 5 insertions(+), 2 deletions(-) |
| 15 | + |
| 16 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 17 | +index 75c419c13..458c1cd95 100644 |
| 18 | +--- a/CMakeLists.txt |
| 19 | ++++ b/CMakeLists.txt |
| 20 | +@@ -115,6 +115,8 @@ endif() |
| 21 | + |
| 22 | + find_package(LibRT) |
| 23 | + |
| 24 | ++find_package(BlocksRuntime QUIET) |
| 25 | ++ |
| 26 | + check_function_exists(_pthread_workqueue_init HAVE__PTHREAD_WORKQUEUE_INIT) |
| 27 | + check_function_exists(getprogname HAVE_GETPROGNAME) |
| 28 | + check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) |
| 29 | +diff --git a/cmake/modules/FindBlocksRuntime.cmake b/cmake/modules/FindBlocksRuntime.cmake |
| 30 | +index 111a5d634..eb3f539e9 100644 |
| 31 | +--- a/cmake/modules/FindBlocksRuntime.cmake |
| 32 | ++++ b/cmake/modules/FindBlocksRuntime.cmake |
| 33 | +@@ -45,4 +45,6 @@ if(BlocksRuntime_FOUND) |
| 34 | + INTERFACE_INCLUDE_DIRECTORIES |
| 35 | + ${BlocksRuntime_INCLUDE_DIR}) |
| 36 | + endif() |
| 37 | ++else() |
| 38 | ++ set(BlocksRuntime_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/BlocksRuntime") |
| 39 | + endif() |
| 40 | +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
| 41 | +index c88b430de..e2da3aaa8 100644 |
| 42 | +--- a/src/CMakeLists.txt |
| 43 | ++++ b/src/CMakeLists.txt |
| 44 | +@@ -1,5 +1,4 @@ |
| 45 | +- |
| 46 | +-if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) |
| 47 | ++if(NOT BlocksRuntime_FOUND) |
| 48 | + add_subdirectory(BlocksRuntime) |
| 49 | + endif() |
| 50 | + |
| 51 | + |
| 52 | +From 18ef62595830ce69ccfc9353457e5efd1b64f54e Mon Sep 17 00:00:00 2001 |
| 53 | +From: Niels Grewe < [email protected]> |
| 54 | +Date: Sun, 24 Nov 2019 21:54:36 +0100 |
| 55 | +Subject: [PATCH 2/2] build: Remove a superfluous include path |
| 56 | + |
| 57 | +--- |
| 58 | + cmake/modules/FindBlocksRuntime.cmake | 2 -- |
| 59 | + tests/CMakeLists.txt | 3 --- |
| 60 | + 2 files changed, 5 deletions(-) |
| 61 | + |
| 62 | +diff --git a/cmake/modules/FindBlocksRuntime.cmake b/cmake/modules/FindBlocksRuntime.cmake |
| 63 | +index eb3f539e9..111a5d634 100644 |
| 64 | +--- a/cmake/modules/FindBlocksRuntime.cmake |
| 65 | ++++ b/cmake/modules/FindBlocksRuntime.cmake |
| 66 | +@@ -45,6 +45,4 @@ if(BlocksRuntime_FOUND) |
| 67 | + INTERFACE_INCLUDE_DIRECTORIES |
| 68 | + ${BlocksRuntime_INCLUDE_DIR}) |
| 69 | + endif() |
| 70 | +-else() |
| 71 | +- set(BlocksRuntime_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/BlocksRuntime") |
| 72 | + endif() |
| 73 | +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt |
| 74 | +index a27603559..0af5aac87 100644 |
| 75 | +--- a/tests/CMakeLists.txt |
| 76 | ++++ b/tests/CMakeLists.txt |
| 77 | +@@ -78,9 +78,6 @@ function(add_unit_test name) |
| 78 | + # to reduce probability of test failures due to machine load. |
| 79 | + target_compile_options(${name} PRIVATE -DLENIENT_DEADLINES=1) |
| 80 | + endif() |
| 81 | +- target_include_directories(${name} |
| 82 | +- SYSTEM BEFORE PRIVATE |
| 83 | +- "${BlocksRuntime_INCLUDE_DIR}") |
| 84 | + if("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC") |
| 85 | + target_compile_options(${name} PRIVATE -Xclang -fblocks) |
| 86 | + target_compile_options(${name} PRIVATE /W3 -Wno-deprecated-declarations) |
0 commit comments