Skip to content
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need two copies of the headers? I think that I should revive my work to remove the private headers at least. We really want to stop propagating the CoreFoundation headers into the toolchain I think.

CC: @millenomi


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"
}