Skip to content
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

Revert "Merge pull request #785 from compnerd/references-available-up… #792

Closed
wants to merge 1 commit 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,3 +29,4 @@ config
configure
libtool
.dirstamp
/dispatch/module.modulemap
22 changes: 12 additions & 10 deletions dispatch/CMakeLists.txt
@@ -1,13 +1,4 @@

if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/darwin/module.modulemap)
else()
set(DISPATCH_MODULE_MAP ${PROJECT_SOURCE_DIR}/dispatch/generic/module.modulemap)
endif()
configure_file(dispatch-vfs.yaml.in
${CMAKE_BINARY_DIR}/dispatch-vfs-overlay.yaml
@ONLY)

install(FILES
base.h
block.h
Expand All @@ -25,8 +16,19 @@ install(FILES
DESTINATION
"${INSTALL_DISPATCH_HEADERS_DIR}")
if(ENABLE_SWIFT)
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}")
if(NOT BUILD_SHARED_LIBS)
set(base_dir "${CMAKE_CURRENT_SOURCE_DIR}/generic_static")
endif()

get_filename_component(
MODULE_MAP
module.modulemap
REALPATH
BASE_DIR "${base_dir}")

install(FILES
${DISPATCH_MODULE_MAP}
${MODULE_MAP}
DESTINATION
"${INSTALL_DISPATCH_HEADERS_DIR}")
endif()
Expand Down
11 changes: 0 additions & 11 deletions dispatch/dispatch-vfs.yaml.in

This file was deleted.

15 changes: 13 additions & 2 deletions src/swift/CMakeLists.txt
Expand Up @@ -18,6 +18,18 @@ target_include_directories(DispatchStubs PRIVATE
set_target_properties(DispatchStubs PROPERTIES
POSITION_INDEPENDENT_CODE YES)


if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/dispatch/module.modulemap
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/dispatch/darwin/module.modulemap ${PROJECT_SOURCE_DIR}/dispatch/module.modulemap)
else()
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/dispatch/module.modulemap
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/dispatch/generic/module.modulemap ${PROJECT_SOURCE_DIR}/dispatch/module.modulemap)
endif()
add_custom_target(module-map ALL
DEPENDS ${PROJECT_SOURCE_DIR}/dispatch/module.modulemap)


add_library(swiftDispatch
Block.swift
Data.swift
Expand All @@ -33,8 +45,6 @@ target_compile_options(swiftDispatch PRIVATE
"SHELL:-Xcc -fmodule-map-file=${PROJECT_SOURCE_DIR}/dispatch/module.modulemap"
"SHELL:-Xcc -I${PROJECT_SOURCE_DIR}"
"SHELL:-Xcc -I${PROJECT_SOURCE_DIR}/src/swift/shims")
target_compile_options(swiftDispatch PUBLIC
"SHELL:-vfsoverlay ${CMAKE_BINARY_DIR}/dispatch-vfs-overlay.yaml")
set_target_properties(swiftDispatch PROPERTIES
Swift_MODULE_NAME Dispatch
Swift_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/swift
Expand All @@ -44,6 +54,7 @@ target_link_libraries(swiftDispatch PRIVATE
BlocksRuntime::BlocksRuntime)
target_link_libraries(swiftDispatch PUBLIC
dispatch)
add_dependencies(swiftDispatch module-map)

get_swift_host_arch(swift_arch)
install(FILES
Expand Down