Skip to content

Commit 016cb35

Browse files
committed
More progress
1 parent f6f73d6 commit 016cb35

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

Documentation/Contributing.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ For example, if the latest tag is 0.3.1:
152152
$> git clone https://github.com/apple/swift-argument-parser --branch 0.3.1
153153
```
154154

155+
5. Clone [swift-crypto](https://github.com/apple/swift-crypto) beside the SwiftPM directory and check out tag with the [latest version](https://github.com/apple/swift-crypto/tags).
156+
157+
For example, if the latest tag is 1.1.3:
158+
```bash
159+
$> git clone https://github.com/apple/swift-crypto --branch 1.1.3
160+
```
161+
155162
#### Building
156163

157164
```bash

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
This source file is part of the Swift.org open source project
55

6-
Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6+
Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
77
Licensed under Apache License v2.0 with Runtime Library Exception
88

99
See http://swift.org/LICENSE.txt for license information
@@ -323,7 +323,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
323323
// dependency version changes here with those projects.
324324
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMinor(from: "0.3.1")),
325325
.package(url: "https://github.com/apple/swift-driver.git", .branch(relatedDependenciesBranch)),
326-
.package(url: "https://github.com/apple/swift-crypto.git", .upToNextMajor(from: "1.1.0")),
326+
.package(url: "https://github.com/apple/swift-crypto.git", .branch(relatedDependenciesBranch)),
327327
]
328328
} else {
329329
package.dependencies += [

Utilities/bootstrap

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
This source file is part of the Swift.org open source project
55
6-
Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
6+
Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
77
Licensed under Apache License v2.0 with Runtime Library Exception
88
99
See http://swift.org/LICENSE.txt for license information
@@ -171,6 +171,7 @@ def parse_global_args(args):
171171
args.yams_source_dir = os.path.join(args.project_root, "..", "yams")
172172
args.swift_argument_parser_source_dir = os.path.join(args.project_root, "..", "swift-argument-parser")
173173
args.swift_driver_source_dir = os.path.join(args.project_root, "..", "swift-driver")
174+
args.swift_crypto_source_dir = os.path.join(args.project_root, "..", "swift-crypto")
174175
args.source_root = os.path.join(args.project_root, "Sources")
175176

176177
if platform.system() == 'Darwin':
@@ -307,6 +308,7 @@ def build(args):
307308
build_yams(args)
308309
build_swift_argument_parser(args)
309310
build_swift_driver(args)
311+
build_swift_crypto(args)
310312

311313
build_swiftpm_with_cmake(args)
312314
build_swiftpm_with_swiftpm(args,integrated_swift_driver=False)
@@ -559,6 +561,18 @@ def build_swift_driver(args):
559561
cmake_flags.append("-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target)
560562

561563
build_with_cmake(args, cmake_flags, args.swift_driver_source_dir, args.swift_driver_build_dir)
564+
565+
def build_swift_crypto(args):
566+
note("Building SwiftCrypto")
567+
args.swift_crypto_build_dir = os.path.join(args.target_dir, "swift-crypto")
568+
569+
cmake_flags = []
570+
if platform.system() == 'Darwin':
571+
cmake_flags.append("-DCMAKE_C_FLAGS=-target %s%s" % (get_build_target(args), g_macos_deployment_target))
572+
cmake_flags.append("-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target)
573+
574+
cmake_flags.append("-DBUILD_SHARED_LIBS=YES")
575+
build_with_cmake(args, cmake_flags, args.swift_crypto_source_dir, args.swift_crypto_build_dir)
562576

563577
def add_rpath_for_cmake_build(args, rpath):
564578
"Adds the given rpath to the CMake-built swift-build"
@@ -578,6 +592,7 @@ def build_swiftpm_with_cmake(args):
578592
"-DYams_DIR=" + os.path.join(args.yams_build_dir, "cmake/modules"),
579593
"-DArgumentParser_DIR=" + os.path.join(args.swift_argument_parser_build_dir, "cmake/modules"),
580594
"-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"),
581596
"-DFIND_PM_DEPS:BOOL=YES",
582597
]
583598
else:
@@ -598,6 +613,7 @@ def build_swiftpm_with_cmake(args):
598613
add_rpath_for_cmake_build(args, os.path.join(args.yams_build_dir, "lib"))
599614
add_rpath_for_cmake_build(args, os.path.join(args.swift_argument_parser_build_dir, "lib"))
600615
add_rpath_for_cmake_build(args, os.path.join(args.swift_driver_build_dir, "lib"))
616+
add_rpath_for_cmake_build(args, os.path.join(args.swift_crypto_build_dir, "lib"))
601617

602618
def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
603619
"""Builds SwiftPM using the version of SwiftPM built with CMake."""
@@ -694,6 +710,7 @@ def get_swiftpm_env_cmd(args):
694710
os.path.join(args.yams_build_dir, "lib"),
695711
os.path.join(args.swift_argument_parser_build_dir, "lib"),
696712
os.path.join(args.swift_driver_build_dir, "lib"),
713+
os.path.join(args.swift_crypto_build_dir, "lib"),
697714
] + args.target_info["paths"]["runtimeLibraryPaths"])
698715

699716
if platform.system() == 'Darwin':

0 commit comments

Comments
 (0)