diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bef26395..4a0949d99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,8 +124,12 @@ endif() option(INSTALL_PRIVATE_HEADERS "installs private headers in the same location as the public ones" OFF) option(ENABLE_SWIFT "enable libdispatch swift overlay" OFF) +set(SWIFT_RUNTIME_RESOURCE_INSTALL_DIR "" CACHE PATH "path to install swift compiler runtime resources") if(ENABLE_SWIFT) enable_language(Swift) + if(NOT SWIFT_RUNTIME_RESOURCE_INSTALL_DIR) + set(SWIFT_RUNTIME_RESOURCE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>") + endif() endif() option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Thread_local" ON) @@ -289,9 +293,9 @@ add_compile_definitions($<$,$>:HA if(ENABLE_SWIFT) set(INSTALL_TARGET_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/$" CACHE PATH "Path where the libraries will be installed") - set(INSTALL_DISPATCH_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/dispatch" CACHE PATH "Path where the headers will be installed for libdispatch") - set(INSTALL_BLOCK_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/Block" CACHE PATH "Path where the headers will be installed for the blocks runtime") - set(INSTALL_OS_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$>:_static>/os" CACHE PATH "Path where the os/ headers will be installed") + set(INSTALL_DISPATCH_HEADERS_DIR "${SWIFT_RUNTIME_RESOURCE_INSTALL_DIR}/dispatch" CACHE PATH "Path where the headers will be installed for libdispatch") + set(INSTALL_BLOCK_HEADERS_DIR "${SWIFT_RUNTIME_RESOURCE_INSTALL_DIR}/Block" CACHE PATH "Path where the headers will be installed for the blocks runtime") + set(INSTALL_OS_HEADERS_DIR "${SWIFT_RUNTIME_RESOURCE_INSTALL_DIR}/os" CACHE PATH "Path where the os/ headers will be installed") else() set(INSTALL_TARGET_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Path where the libraries will be installed") set(INSTALL_DISPATCH_HEADERS_DIR "include/dispatch" CACHE PATH "Path where the headers will be installed")