Skip to content

Commit

Permalink
Build: Correct BlocksRuntime dependency for Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
AreaZR committed Sep 22, 2021
1 parent 35f5c96 commit 896950d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/swift/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,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)
Expand Down
7 changes: 5 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE:${name}>)
Expand Down

0 comments on commit 896950d

Please sign in to comment.