Skip to content

Commit af6be72

Browse files
etcwildeLukasa
andauthored
CMake: Declare ASN1 dependency (#376)
SwiftCrypto depends on SwiftASN1 which is declared in the exports file, but does not try to find the project, resulting in build failures of downstream projects that fail to explicitly call `find_package(SwiftASN1)` before `find_package(SwiftCrypto)`. Generally, it is recommended that project config files use `find_dependency` to search for the dependencies of the project they represent (https://cmake.org/cmake/help/v3.26/module/CMakeFindDependencyMacro.html). If the package is already found, either through `find_package` in the parent project, or through another means, the `find_dependency` call is a no-op. Co-authored-by: Cory Benfield <[email protected]>
1 parent 93a2ebf commit af6be72

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmake/modules/SwiftCryptoConfig.cmake.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
##===----------------------------------------------------------------------===##
1414

1515
if(NOT TARGET SwiftCrypto)
16+
include(CMakeFindDependencyMacro)
17+
find_dependency(SwiftASN1)
1618
include(@SWIFT_CRYPTO_EXPORTS_FILE@)
1719
endif()

0 commit comments

Comments
 (0)