-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPackage.swift
More file actions
37 lines (36 loc) · 1.3 KB
/
Package.swift
File metadata and controls
37 lines (36 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// swift-tools-version:6.3
import PackageDescription
let package = Package(
name: "TorClient",
platforms: [
.iOS(.v18)
],
products: [
// Main library product exposing the Swift wrapper
// Product name matches target name for consistent import statements
.library(
name: "TorClientWrapper",
targets: ["TorClientWrapper"]
)
],
targets: [
// Binary target containing libTorClient.a with C API (module name: TorClientC from modulemap)
// This library bundles: Tor + OpenSSL + libevent + zlib (all statically linked)
.binaryTarget(
name: "TorClientC",
path: "TorClientC.xcframework"
),
// Swift wrapper providing TorService, TorConfiguration, etc.
.target(
name: "TorClientWrapper",
dependencies: ["TorClientC"],
path: "Sources/TorClientWrapper",
linkerSettings: [
// Force load ensures all object files from the static library are included
// Without this, linker strips "unused" internal symbols (OpenSSL, libevent internals)
// that are called by Tor but not directly referenced from Swift
.unsafeFlags(["-ObjC", "-all_load"])
]
)
]
)