From 13c213b560638f10664590d91a93c952190b848c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 4 Feb 2021 09:13:32 -0800 Subject: [PATCH] build: allow using a build tree of dispatch, Foundation When building swift-crypto from source for a toolchain build, it is convenient to build it without building up a toolchain image. This additional knob allows for building swift-crypto with the build artifacts of previous builds, allowing building up a toolchain image while chaining multiple builds together. --- CMakeLists.txt | 5 +++++ Sources/Crypto/CMakeLists.txt | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab3cc98a6..881a872c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,5 +37,10 @@ if(BUILD_SHARED_LIBS) set(CMAKE_POSITION_INDEPENDENT_CODE YES) endif() +if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin) + find_package(dispatch CONFIG) + find_package(Foundation CONFIG) +endif() + add_subdirectory(Sources) add_subdirectory(cmake/modules) diff --git a/Sources/Crypto/CMakeLists.txt b/Sources/Crypto/CMakeLists.txt index 683528f1f..be6451ec0 100644 --- a/Sources/Crypto/CMakeLists.txt +++ b/Sources/Crypto/CMakeLists.txt @@ -80,6 +80,8 @@ target_include_directories(Crypto PRIVATE $ $) target_link_libraries(Crypto PUBLIC + $<$>:dispatch> + $<$>:Foundation> CCryptoBoringSSL CCryptoBoringSSLShims) set_target_properties(Crypto PROPERTIES