Skip to content

build: build target libdispatch as necessary #35920

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

Merged
merged 1 commit into from
Feb 12, 2021
Merged
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
16 changes: 10 additions & 6 deletions cmake/modules/Libdispatch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,24 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
endif()

set(DISPATCH_SDKS)

# Build the host libdispatch if needed.
if(SWIFT_BUILD_HOST_DISPATCH)
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
if(NOT "${SWIFT_HOST_VARIANT_SDK}" IN_LIST SWIFT_SDKS)
list(APPEND DISPATCH_SDKS "${SWIFT_HOST_VARIANT_SDK}")
endif()
endif()

foreach(sdk ${SWIFT_SDKS})
if(NOT "${sdk}" IN_LIST SWIFT_APPLE_PLATFORMS)
list(APPEND DISPATCH_SDKS "${sdk}")
endif()
endforeach()
endif()

# Build any target libdispatch if needed.
foreach(sdk ${SWIFT_SDKS})
# Apple targets have libdispatch available, do not build it.
if(NOT "${sdk}" IN_LIST SWIFT_APPLE_PLATFORMS)
list(APPEND DISPATCH_SDKS "${sdk}")
endif()
endforeach()

foreach(sdk ${DISPATCH_SDKS})
set(ARCHS ${SWIFT_SDK_${sdk}_ARCHITECTURES})
if(${sdk} STREQUAL "${SWIFT_HOST_VARIANT_SDK}")
Expand Down