@@ -98,26 +98,46 @@ python3 ./
98
98
99
99
Now, the contents of the ` bindings/LDK ` folder will have been completely regenerated.
100
100
101
- ### Configuring Xcode for Framework Compilation
102
- Go to the ` xcode ` folder and open ` LDKFramework.xcworkspace ` .
101
+ ### Preparing the correct Xcode version
102
+ To make sure the next two steps work correctly, you need to verify that you're using Xcode 13.2.1.
103
+ If you have a later version, you can download the correct version from here: https://xcodereleases.com/
103
104
104
- Then, navigate to the "LDKFramework" project and click on the LDKFramework project target:
105
- ![ ] ( https://user-images.githubusercontent.com/5944973/175575527-97073a18-76fc-4ab0-928f-d40ac643e607.png )
105
+ The direct download link is
106
106
107
- Search for ` LDK_C_BINDINGS_BASE ` :
108
- ![ ] ( https://user-images.githubusercontent.com/5944973/177420117-bcf7fc32-b07d-440f-84d1-fe2d373c355b.png )
107
+ https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_13.2.1/Xcode_13.2.1.xip
109
108
110
- Here, enter the absolute path, pointing to your ` ldk-c-bindings ` .
109
+ You may be asked to log in to your Apple developer account .
111
110
112
- You will now also have to do the same for ` LDK_C_BINDINGS_BINARY_DIRECTORY ` , and enter any directory you wish. We like to use just ` bin/ ` .
111
+ After downloading the correct Xcode version and copying it to Applications, you might also need to run
112
+ the following command with root privileges:
113
+
114
+ ``` shell
115
+ sudo xcode-select -s /Applications/Xcode\ 13.2.1.app/Contents/Developer/
116
+ ```
117
+
118
+ ### Building requisite binaries
119
+ Navigate (` cd ` ) to the ` ./src/scripts ` folder, and run the following Python script:
120
+
121
+ ``` shell
122
+ python3 ./build_bulk_libldks.py /path/to/ldk-c-bindings
123
+ ```
124
+
125
+ This command will take a while, but it will eventually produce a set of binaries for all the
126
+ platform/architecture combinations we're trying to support. Those binaries should adhere to the
127
+ ` ./bindings/bin/release/<platform>/ ` folder pattern.
128
+
129
+ Each of those folders will contain an ` architectures ` directory with subdirectories such as ` arm64 `
130
+ or ` x86_64 ` , as well as a ` libldk.a ` file, which is the ` lipo ` product of all the targeted
131
+ architectures.
113
132
114
133
#### Generating the * .xcframework files
115
134
116
- With all the bindings generated, you will just have to run two commands to generate the xcframework:
135
+ With all the binaries generated, still in the ` ./src/scripts ` directory, you just need to run one
136
+ last Python script to produce the framework:
117
137
118
138
``` shell
119
- cd xcode
120
- ./build_framework.sh
139
+ python3 ./generate_xcframework.py /path/to/ldk-c-bindings
121
140
```
122
141
123
- Once the script finishes running, you should see ` LDKFramework.xcframework ` in the ` xcode/build ` folder. Drag that into your project, and you're done!
142
+ Once the script finishes running, you should see ` LightningDevKit.xcframework ` in the
143
+ ` ./bindings/bin/release ` folder. Drag that into your project, and you're done!
0 commit comments