Skip to content

Non-Darwin SDKs product results in per-arch directories. #392

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

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ if(ENABLE_SWIFT)
endif()

set(INSTALL_TARGET_DIR "${INSTALL_LIBDIR}/${swift_dir}/${swift_os}" CACHE PATH "Path where the libraries will be installed")
set(INSTALL_RSRC_DIR "${INSTALL_LIBDIR}/${swift_dir}/${swift_os}/${swift_arch}" CACHE PATH "Path where the compiler resources will be installed")
set(INSTALL_DISPATCH_HEADERS_DIR "${INSTALL_LIBDIR}/${swift_dir}/dispatch" CACHE PATH "Path where the headers will be installed for libdispatch")
set(INSTALL_BLOCK_HEADERS_DIR "${INSTALL_LIBDIR}/${swift_dir}/Block" CACHE PATH "Path where the headers will be installed for the blocks runtime")
set(INSTALL_OS_HEADERS_DIR "${INSTALL_LIBDIR}/${swift_dir}/os" CACHE PATH "Path where the os/ headers will be installed")
Expand Down Expand Up @@ -168,6 +169,14 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
BlocksRuntime
DESTINATION
${INSTALL_TARGET_DIR})
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
# Install also in the architecture subdir for platforms that do not support
# fat libraries
install(TARGETS
BlocksRuntime
DESTINATION
${INSTALL_RSRC_DIR})
endif()
endif()

check_symbol_exists(__GNU_LIBRARY__ "features.h" _GNU_SOURCE)
Expand Down Expand Up @@ -347,4 +356,3 @@ add_subdirectory(src)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()

16 changes: 14 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ if(ENABLE_SWIFT)
${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftmodule
${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftdoc
DESTINATION
${INSTALL_TARGET_DIR}/${swift_arch})
${INSTALL_RSRC_DIR})

if(BUILD_SHARED_LIBS)
set(library_kind SHARED)
Expand All @@ -267,5 +267,17 @@ if(ENABLE_SWIFT)
${swiftDispatch_OUTPUT_FILE}
DESTINATION
${INSTALL_TARGET_DIR})
endif()

if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
# Install also in the architecture subdir for platforms that do not support
# fat libraries
install(TARGETS
dispatch
DESTINATION
${INSTALL_RSRC_DIR})
install(FILES
${swiftDispatch_OUTPUT_FILE}
DESTINATION
${INSTALL_RSRC_DIR})
endif()
endif()