Skip to content

Commit 26d3f52

Browse files
compnerdtomerd
andauthored
build: allow using a build tree of dispatch, Foundation (#67)
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. Co-authored-by: tomer doron <[email protected]>
1 parent 03581fe commit 26d3f52

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,10 @@ if(BUILD_SHARED_LIBS)
3737
set(CMAKE_POSITION_INDEPENDENT_CODE YES)
3838
endif()
3939

40+
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
41+
find_package(dispatch CONFIG)
42+
find_package(Foundation CONFIG)
43+
endif()
44+
4045
add_subdirectory(Sources)
4146
add_subdirectory(cmake/modules)

Sources/Crypto/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ target_include_directories(Crypto PRIVATE
8080
$<TARGET_PROPERTY:CCryptoBoringSSL,INCLUDE_DIRECTORIES>
8181
$<TARGET_PROPERTY:CCryptoBoringSSLShims,INCLUDE_DIRECTORIES>)
8282
target_link_libraries(Crypto PUBLIC
83+
$<$<NOT:$<PLATFORM_ID:Darwin>>:dispatch>
84+
$<$<NOT:$<PLATFORM_ID:Darwin>>:Foundation>
8385
CCryptoBoringSSL
8486
CCryptoBoringSSLShims)
8587
set_target_properties(Crypto PROPERTIES

0 commit comments

Comments
 (0)