Skip to content

build: allow system-supplied libBlocksRuntime on systems other than Darwin #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
if(NOT BlocksRuntime_FOUND)
add_subdirectory(BlocksRuntime)
endif()

Expand Down
3 changes: 0 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down