From ff943b1bafb71c9bfdafc60ad969c4cdc8baf16e Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Wed, 22 Sep 2021 15:07:26 -0400 Subject: [PATCH] Build: Correct BlocksRuntime dependency for Darwin --- src/CMakeLists.txt | 6 ++++-- src/swift/CMakeLists.txt | 7 +++++-- tests/CMakeLists.txt | 7 +++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index adc989d42..2ecd29d73 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -137,8 +137,10 @@ if(LibRT_FOUND) endif() target_link_libraries(dispatch PRIVATE Threads::Threads) -target_link_libraries(dispatch PUBLIC - BlocksRuntime::BlocksRuntime) +if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + target_link_libraries(dispatch PUBLIC + BlocksRuntime::BlocksRuntime) +endif() if(CMAKE_SYSTEM_NAME STREQUAL Windows) target_link_libraries(dispatch PRIVATE ShLwApi diff --git a/src/swift/CMakeLists.txt b/src/swift/CMakeLists.txt index f721e82a3..b1cfc42b6 100644 --- a/src/swift/CMakeLists.txt +++ b/src/swift/CMakeLists.txt @@ -38,8 +38,11 @@ set_target_properties(swiftDispatch PROPERTIES Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}/swift) target_link_libraries(swiftDispatch PRIVATE - DispatchStubs - BlocksRuntime::BlocksRuntime) + DispatchStubs) +if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + target_link_libraries(swiftDispatch PRIVATE + BlocksRuntime::BlocksRuntime) +endif() target_link_libraries(swiftDispatch PUBLIC dispatch) add_dependencies(swiftDispatch module-maps) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0176a062b..86a6a75cc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -99,8 +99,11 @@ function(add_unit_test name) target_link_libraries(${name} PRIVATE dispatch - Threads::Threads - BlocksRuntime::BlocksRuntime) + Threads::Threads) + if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + target_link_libraries(${name} PRIVATE + BlocksRuntime::BlocksRuntime) + endif() target_link_libraries(${name} PRIVATE bsdtests) add_test(NAME ${name} COMMAND bsdtestharness $)