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
AZero13 committed Sep 8, 2022
1 parent 4bf826d commit f7f9d48
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 @@ -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)
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 f7f9d48

Please sign in to comment.