]> git.bitcoin.ninja Git - ldk-swift-linux/commitdiff
Make Package.swift read environment to get ldk-c-bindings path
authorMatt Corallo <git@bluematt.me>
Fri, 30 Jul 2021 00:31:14 +0000 (00:31 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 30 Jul 2021 00:32:08 +0000 (00:32 +0000)
LDKSwift/Package.swift

index 4ecd9d30923d7dd4c231620a8194b2794da40d1b..052661bb5d17558a21ceb264913d29eb390084d6 100644 (file)
@@ -2,6 +2,7 @@
 // The swift-tools-version declares the minimum version of Swift required to build this package.
 
 import PackageDescription
+import Foundation
 
 let package = Package(
     name: "LDKSwift",
@@ -20,8 +21,8 @@ let package = Package(
             name: "LDKSwift",
             dependencies: ["LDKCHeaders"],
             linkerSettings: [
-                .linkedLibrary("/root/ldk-c-bindings/lightning-c-bindings/target/debug/libldk.a"),
-                .linkedLibrary("/root/ldk-c-bindings/lightning-c-bindings/ldk_net.o"),
+                 .linkedLibrary(String(utf8String: getenv("LDK_C_BINDINGS_BASE")!)! + "/lightning-c-bindings/target/debug/libldk.a"),
+                 .linkedLibrary(String(utf8String: getenv("LDK_C_BINDINGS_BASE")!)! + "/lightning-c-bindings/ldk_net.o"),
                 .linkedLibrary("/usr/lib/llvm-11/lib/clang/11.0.0/lib/linux/libclang_rt.asan-x86_64.a")
             ]),
         .testTarget(