Skip to content

[5.3] Add modulemaps that work for statically compiled Foundation #2863

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
Sep 3, 2020
Merged
Show file tree
Hide file tree
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
24 changes: 15 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,33 +68,39 @@ if(NOT BUILD_SHARED_LIBS)
install(TARGETS CoreFoundation CFXMLInterface CFURLSessionInterface
DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>)
endif()

set(swift_lib_dir "lib/swift")
if(NOT BUILD_SHARED_LIBS)
set(swift_lib_dir "lib/swift_static")
endif()

# TODO(compnerd) install as a Framework as that is how swift actually is built
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/CoreFoundation.framework/Headers/
DESTINATION
lib/swift/CoreFoundation
${swift_lib_dir}/CoreFoundation
FILES_MATCHING PATTERN "*.h")
install(FILES
CoreFoundation/Base.subproj/module.map
CoreFoundation/Base.subproj/$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:static/>module.map
DESTINATION
lib/swift/CoreFoundation)
${swift_lib_dir}/CoreFoundation)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/CFURLSessionInterface.framework/Headers/
DESTINATION
lib/swift/CFURLSessionInterface
${swift_lib_dir}/CFURLSessionInterface
FILES_MATCHING PATTERN "*.h")
install(FILES
CoreFoundation/URL.subproj/module.map
CoreFoundation/URL.subproj/$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:static/>module.map
DESTINATION
lib/swift/CFURLSessionInterface)
${swift_lib_dir}/CFURLSessionInterface)
install(DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/CFXMLInterface.framework/Headers/
DESTINATION
lib/swift/CFXMLInterface
${swift_lib_dir}/CFXMLInterface
FILES_MATCHING PATTERN "*.h")
install(FILES
CoreFoundation/Parsing.subproj/module.map
CoreFoundation/Parsing.subproj/$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:static/>module.map
DESTINATION
lib/swift/CFXMLInterface)
${swift_lib_dir}/CFXMLInterface)

add_subdirectory(cmake/modules)
7 changes: 7 additions & 0 deletions CoreFoundation/Base.subproj/static/module.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module CoreFoundation [extern_c] [system] {
umbrella header "CoreFoundation.h"
explicit module CFPlugInCOM { header "CFPlugInCOM.h" }

link "CoreFoundation"
link "uuid"
}
6 changes: 6 additions & 0 deletions CoreFoundation/Parsing.subproj/static/module.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module CFXMLInterface [extern_c] [system] {
umbrella header "CFXMLInterface.h"

link "CFXMLInterface"
link "xml2"
}
6 changes: 6 additions & 0 deletions CoreFoundation/URL.subproj/static/module.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module CFURLSessionInterface [extern_c] [system] {
umbrella header "CFURLSessionInterface.h"

link "CFURLSessionInterface"
link "curl"
}