Skip to content

Commit

Permalink
libdispatch: updated patch for upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
triplef committed Apr 26, 2024
1 parent 1c0378a commit 26ebbeb
Showing 1 changed file with 5 additions and 51 deletions.
56 changes: 5 additions & 51 deletions patches/libdispatch-own-blocksruntime.patch
Original file line number Diff line number Diff line change
@@ -1,44 +1,20 @@
From f49931127fe7673931c6550194c593923b2fbfd7 Mon Sep 17 00:00:00 2001
From: Niels Grewe <niels.grewe@halbordnung.de>
Date: Sun, 24 Nov 2019 08:24:56 +0100
Subject: [PATCH 1/2] build: search for system-supplied libBlocksRuntime

This allows the user to provide a version of libBlocksRuntime on
systems other than Darwin.

https://github.com/apple/swift-corelibs-libdispatch/pull/534
---
CMakeLists.txt | 2 ++
cmake/modules/FindBlocksRuntime.cmake | 2 ++
src/CMakeLists.txt | 3 +--
3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 36da011..3b615d0 100644
index eff610b..21a30b9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,6 +117,8 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
@@ -187,6 +187,8 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
find_package(LibRT)
endif()

+find_package(BlocksRuntime QUIET)
+
check_function_exists(_pthread_workqueue_init HAVE__PTHREAD_WORKQUEUE_INIT)
check_function_exists(aligned_alloc HAVE_ALIGNED_ALLOC)
check_function_exists(getprogname HAVE_GETPROGNAME)
check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
diff --git a/cmake/modules/FindBlocksRuntime.cmake b/cmake/modules/FindBlocksRuntime.cmake
index 111a5d634..eb3f539e9 100644
--- a/cmake/modules/FindBlocksRuntime.cmake
+++ b/cmake/modules/FindBlocksRuntime.cmake
@@ -45,4 +45,6 @@ if(BlocksRuntime_FOUND)
INTERFACE_INCLUDE_DIRECTORIES
${BlocksRuntime_INCLUDE_DIR})
endif()
+else()
+ set(BlocksRuntime_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/BlocksRuntime")
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c88b430de..e2da3aaa8 100644
index 570c919..6d45899 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,4 @@
Expand All @@ -48,30 +24,8 @@ index c88b430de..e2da3aaa8 100644
add_subdirectory(BlocksRuntime)
endif()


From 18ef62595830ce69ccfc9353457e5efd1b64f54e Mon Sep 17 00:00:00 2001
From: Niels Grewe <niels.grewe@halbordnung.de>
Date: Sun, 24 Nov 2019 21:54:36 +0100
Subject: [PATCH 2/2] build: Remove a superfluous include path

---
cmake/modules/FindBlocksRuntime.cmake | 2 --
tests/CMakeLists.txt | 3 ---
2 files changed, 5 deletions(-)

diff --git a/cmake/modules/FindBlocksRuntime.cmake b/cmake/modules/FindBlocksRuntime.cmake
index eb3f539e9..111a5d634 100644
--- a/cmake/modules/FindBlocksRuntime.cmake
+++ b/cmake/modules/FindBlocksRuntime.cmake
@@ -45,6 +45,4 @@ if(BlocksRuntime_FOUND)
INTERFACE_INCLUDE_DIRECTORIES
${BlocksRuntime_INCLUDE_DIR})
endif()
-else()
- set(BlocksRuntime_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/BlocksRuntime")
endif()
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index a27603559..0af5aac87 100644
index 0176a06..523ae06 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -78,9 +78,6 @@ function(add_unit_test name)
Expand Down

0 comments on commit 26ebbeb

Please sign in to comment.