Skip to content

Commit

Permalink
Revert "dispatch: attempt to use a VFS overlay"
Browse files Browse the repository at this point in the history
This reverts commit ed909bb.
  • Loading branch information
MaxDesiatov committed Jun 2, 2023
1 parent 2725ced commit 5f644e0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
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

0 comments on commit 5f644e0

Please sign in to comment.