You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/website/docs/tutorials/cmake_build_system.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,3 +106,80 @@ I 00:00:00.002159 executorch:executor_runner.cpp:186] Inputs prepared.
106
106
I 00:00:00.011684 executorch:executor_runner.cpp:195] Model executed successfully.
107
107
I 00:00:00.011709 executorch:executor_runner.cpp:210] 8.000000
108
108
```
109
+
110
+
111
+
## Cross compilation
112
+
113
+
114
+
### Android
115
+
- Prerequisite: [Android NDK](https://developer.android.com/ndk), choose one of the following:
116
+
- Option 1: Download Android Studio, [follow instruction here to install ndk](https://developer.android.com/studio/projects/install-ndk)
117
+
- Option 2: Download NDK directly from [here](https://developer.android.com/ndk/downloads)
118
+
119
+
Assuming NDK is available on installed, run
120
+
```bash
121
+
# Run the following lines from executorch folder
122
+
rm -r cmake-android-out
123
+
mkdir cmake-android-out
124
+
cd cmake-android-out
125
+
126
+
# point -DCMAKE_TOOLCHAIN_FILE to the location where ndk is installed
127
+
# Run `which buck2`, if it returns empty (meaning the system doesn't know where buck2 is installed), pass in pass in this flag `-DBUCK2=/path/to/buck2` pointing to buck2
# Create an include folder in cmake-ios-out to include all header files
172
+
mkdir include
173
+
cp -r ../runtime include
174
+
cp -r ../extension include
175
+
cp -r ../utils include
176
+
```
177
+
178
+
179
+
3. XCode setup
180
+
181
+
If using ios cmake tool chain from `https://github.com/leetal/ios-cmake.git`, after build:
182
+
183
+
- Open the project in XCode, drag the `executorch.xcodeproj` generated from Step 2 to `Frameworks`,
184
+
- Go to project Target’s `Build Phases` - `Link Binaries With Libraries`, click the + sign and add all the library files located in `cmake-ios-out/build`.
185
+
- Navigate to the project `Build Settings`, set the value **Header Search Paths** to `cmake-ios-out/include` and **Library Search Paths** to `cmake-ios-out/build`
0 commit comments