Skip to content

[pull] swiftwasm-release/5.3 from release/5.3 #109

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 3 commits 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"
}
2 changes: 2 additions & 0 deletions Sources/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL Windows)
add_dependencies(Foundation CoreFoundationResources)
target_link_options(Foundation PRIVATE
$<TARGET_OBJECTS:CoreFoundationResources>)
elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
target_link_options(Foundation PRIVATE "SHELL:-no-toolchain-stdlib-rpath")
endif()


Expand Down
4 changes: 4 additions & 0 deletions Sources/FoundationNetworking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ set_target_properties(FoundationNetworking PROPERTIES
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)

if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
target_link_options(FoundationNetworking PRIVATE "SHELL:-no-toolchain-stdlib-rpath")
endif()


set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking)
install(TARGETS FoundationNetworking
Expand Down
4 changes: 4 additions & 0 deletions Sources/FoundationXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ set_target_properties(FoundationXML PROPERTIES
Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/swift)

if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
target_link_options(FoundationXML PRIVATE "SHELL:-no-toolchain-stdlib-rpath")
endif()


set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)
install(TARGETS FoundationXML
Expand Down
6 changes: 6 additions & 0 deletions Sources/UUID/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ set_target_properties(uuid PROPERTIES

if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)

get_swift_host_arch(swift_arch)
install(TARGETS uuid
ARCHIVE DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
LIBRARY DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
RUNTIME DESTINATION bin)
endif()