From 2a3e9c11353c182ed2e2205057703b91f593a8c1 Mon Sep 17 00:00:00 2001 From: YR Chen Date: Sun, 4 Sep 2022 22:42:26 +0800 Subject: [PATCH] Introduce `SWIFT_RUNTIME_RESOURCE_INSTALL_DIR` a new flag to control the path to Swift headers installation. --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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")