Skip to content

Commit b01bfac

Browse files
committed
Fix build
Requires apple/swift-crypto#65
1 parent c2c5514 commit b01bfac

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This source file is part of the Swift.org open source project
22
#
3-
# Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
3+
# Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
44
# Licensed under Apache License v2.0 with Runtime Library Exception
55
#
66
# See http://swift.org/LICENSE.txt for license information
@@ -47,7 +47,7 @@ if(FIND_PM_DEPS)
4747
endif()
4848

4949
find_package(ArgumentParser CONFIG REQUIRED)
50-
find_package(Crypto CONFIG REQUIRED)
50+
find_package(SwiftCrypto CONFIG REQUIRED)
5151
find_package(SwiftDriver CONFIG REQUIRED)
5252
endif()
5353

Sources/PackageCollections/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ target_link_libraries(PackageCollections PUBLIC
3333
TSCUtility
3434
Basics
3535
Crypto
36+
CCryptoBoringSSL
3637
PackageModel
3738
SourceControl)
3839
# NOTE(compnerd) workaround for CMake not setting up include flags yet
3940
set_target_properties(PackageCollections PROPERTIES
4041
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
42+
target_link_options(PackageCollections PRIVATE
43+
"$<$<PLATFORM_ID:Darwin>:SHELL:-Xlinker -framework -Xlinker Security>")
4144

4245
if(USE_CMAKE_INSTALL)
4346
install(TARGETS PackageCollections
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
This source file is part of the Swift.org open source project
3+
4+
Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+
See http://swift.org/LICENSE.txt for license information
8+
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
9+
*/
10+
11+
import Crypto
12+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
13+
import Security
14+
#else
15+
import CCryptoBoringSSL
16+
#endif

Utilities/bootstrap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ def build_swift_crypto(args):
571571
cmake_flags.append("-DCMAKE_C_FLAGS=-target %s%s" % (get_build_target(args), g_macos_deployment_target))
572572
cmake_flags.append("-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target)
573573

574-
cmake_flags.append("-DBUILD_SHARED_LIBS=YES")
575574
build_with_cmake(args, cmake_flags, args.swift_crypto_source_dir, args.swift_crypto_build_dir)
576575

577576
def add_rpath_for_cmake_build(args, rpath):
@@ -592,7 +591,7 @@ def build_swiftpm_with_cmake(args):
592591
"-DYams_DIR=" + os.path.join(args.yams_build_dir, "cmake/modules"),
593592
"-DArgumentParser_DIR=" + os.path.join(args.swift_argument_parser_build_dir, "cmake/modules"),
594593
"-DSwiftDriver_DIR=" + os.path.join(args.swift_driver_build_dir, "cmake/modules"),
595-
"-DCrypto_DIR=" + os.path.join(args.swift_crypto_build_dir, "cmake/modules"),
594+
"-DSwiftCrypto_DIR=" + os.path.join(args.swift_crypto_build_dir, "cmake/modules"),
596595
"-DFIND_PM_DEPS:BOOL=YES",
597596
]
598597
else:

0 commit comments

Comments
 (0)