File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,24 @@ if let bindingsBase = getenv("LDK_C_BINDINGS_BASE") {
9
9
cBindingsBase = String ( utf8String: bindingsBase) !
10
10
}
11
11
12
+ var bindingsDirectory = " \( cBindingsBase) /lightning-c-bindings/target/debug "
13
+ if let ldkBinaryDirectory = getenv ( " LDK_C_BINDINGS_BINARY_DIRECTORY " ) {
14
+ bindingsDirectory = String ( utf8String: ldkBinaryDirectory) !
15
+ }
16
+
17
+ var bindingsLibraryPath = " \( bindingsDirectory) /libldk.a "
18
+
12
19
var linkerSettings : [ PackageDescription . LinkerSetting ] = [
13
- . linkedLibrary( " \( cBindingsBase ) /lightning-c-bindings/target/debug/libldk.a " )
20
+ . linkedLibrary( bindingsLibraryPath )
14
21
]
15
22
16
- #if os(macOS)
23
+ #if os(Linux)
24
+ linkerSettings. append ( . linkedLibrary( String ( utf8String: getenv ( " LLVM_CLANG_ASAN_PATH " ) !) !, . when( platforms: [ . linux] ) ) )
25
+ #else
17
26
linkerSettings = [
18
27
. unsafeFlags( [ " -L \( cBindingsBase) /lightning-c-bindings/target/debug " ] ) ,
19
28
. linkedLibrary( " ldk " )
20
29
]
21
- #elseif os(Linux)
22
- linkerSettings. append ( . linkedLibrary( String ( utf8String: getenv ( " LLVM_CLANG_ASAN_PATH " ) !) !, . when( platforms: [ . linux] ) ) )
23
30
#endif
24
31
25
32
let package = Package (
@@ -63,6 +70,5 @@ let package = Package(
63
70
sources: nil ,
64
71
cSettings: nil , cxxSettings: nil , swiftSettings: nil ,
65
72
linkerSettings: nil )
66
-
67
73
]
68
74
)
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ set -e # stop execution upon the first error
14
14
15
15
C_BINDINGS_SOURCE_DIRECTORY=" $( cd ${LDK_DIRECTORY} ; pwd) /lightning-c-bindings"
16
16
17
- BASEDIR=$( dirname " $0 " )
17
+ # https://stackoverflow.com/a/4774063/299711
18
+ BASEDIR=" $( cd -- " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
18
19
BUILD_LOG_PATH=" ${BASEDIR} /build_libldk.log"
19
20
20
21
# echo -n "" > $BUILD_LOG_PATH
You can’t perform that action at this time.
0 commit comments