Skip to content

Commit 3499e7a

Browse files
committed
Update framework building to always exclude arm64 binaries
1 parent 93746ec commit 3499e7a

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
framework module LDKFramework {
2+
umbrella header "LDKFramework.h"
3+
4+
module * { export * }
5+
export *
6+
7+
explicit module LDK {
8+
header "ldk_rust_types.h"
9+
header "lightning.h"
10+
header "ldk_ver.h"
11+
header "ldk_net.h"
12+
link "libldk.a"
13+
export *
14+
}
15+
16+
}

xcode/LDKFramework_Mac/LDKFramework.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,7 +1777,7 @@
17771777
DYLIB_CURRENT_VERSION = 1;
17781778
DYLIB_INSTALL_NAME_BASE = "@rpath";
17791779
EXCLUDED_ARCHS = "";
1780-
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
1780+
"EXCLUDED_ARCHS[sdk=*]" = arm64;
17811781
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)";
17821782
INFOPLIST_FILE = LDKFramework/Info.plist;
17831783
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";

xcode/build_framework.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
1-
# export RUSTFLAGS="-Z sanitizer=address"
2-
# cargo build -Z build-std=panic_abort,std --target x86_64-apple-ios-macabi --release
3-
1+
set -e # bail upon first error
42

53
pushd ../bindings/bin
64
BIN_OUTPUT_DIRECTORY=`pwd`
7-
rm -r LDKFramework*
5+
rm -rf LDKFramework*
86
popd
97

108

9+
## experimental only
10+
#pushd ./LDKFramework_Mac
11+
#xcodebuild archive -scheme LDKFramework -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-macOS ENABLE_BITCODE=NO ONLY_ACTIVE_ARCH=YES SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
12+
#popd
13+
##xcodebuild -create-xcframework \
14+
##-framework ${BIN_OUTPUT_DIRECTORY}/LDKFramework-macOS.xcarchive/Products/Library/Frameworks/LDKFramework.framework \
15+
##-output ${BIN_OUTPUT_DIRECTORY}/LDKFramework-only-simulator.xcframework
16+
#exit 0
17+
18+
1119

1220
pushd ./LDKFramework
1321

1422
# xcodebuild -list
1523

16-
xcodebuild archive -scheme LDKFramework -destination "generic/platform=iOS" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-iOS CLANG_ADDRESS_SANITIZER=NO CLANG_ADDRESS_SANITIZER_ALLOW_ERROR_RECOVERY=NO CLANG_ADDRESS_SANITIZER_USE_AFTER_SCOPE=NO SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
24+
xcodebuild archive -scheme LDKFramework -destination "generic/platform=iOS" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-iOS ENABLE_BITCODE=NO CLANG_ADDRESS_SANITIZER=NO CLANG_ADDRESS_SANITIZER_ALLOW_ERROR_RECOVERY=NO CLANG_ADDRESS_SANITIZER_USE_AFTER_SCOPE=NO SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
1725
xcodebuild archive -scheme LDKFramework -destination "generic/platform=iOS Simulator" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-Sim CLANG_ADDRESS_SANITIZER=NO CLANG_ADDRESS_SANITIZER_ALLOW_ERROR_RECOVERY=NO CLANG_ADDRESS_SANITIZER_USE_AFTER_SCOPE=NO SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
1826

1927
# xcodebuild archive -scheme LDKFramework-Mac -destination "generic/platform=OS X" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-macOS SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
@@ -23,7 +31,7 @@ popd
2331

2432
pushd ./LDKFramework_Mac
2533
# xcodebuild archive -scheme LDKFramework -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-macOS CLANG_ADDRESS_SANITIZER=YES ONLY_ACTIVE_ARCH=YES SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
26-
xcodebuild archive -scheme LDKFramework -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-macOS ONLY_ACTIVE_ARCH=YES SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
34+
xcodebuild archive -scheme LDKFramework -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -archivePath ${BIN_OUTPUT_DIRECTORY}/LDKFramework-macOS ENABLE_BITCODE=NO ONLY_ACTIVE_ARCH=YES SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
2735
popd
2836

2937

xcode/compile_dependency_binaries.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ python3 ../ci/fix_header_includes.py $DIRECT_BINDINGS_PROJECT_DIRECTORY
3232
# build for Catalyst
3333
pushd $C_BINDINGS_SOURCE_DIRECTORY
3434
#export RUSTFLAGS=""
35+
#export RUSTFLAGS="-Z sanitizer=address"
3536
export RUSTFLAGS="--cfg=c_bindings"
37+
#export RUSTFLAGS="--cfg=c_bindings -C lto=off -C embed-bitcode=no"
38+
#export RUSTFLAGS="--cfg=c_bindings -C lto=off -Z embed-bitcode"
3639

3740
rustup override set nightly
3841
cargo clean

0 commit comments

Comments
 (0)