浏览代码

add "how to build for ios" to readme

/siyaoH-1.17-PlatformMessage
xingwei.zhu 4 年前
当前提交
b202658e
共有 1 个文件被更改,包括 92 次插入0 次删除
  1. 92
      engine/README.md

92
engine/README.md


```
## How to Build (IOS)
The UIWidgets engine for iOS can only be built on Mac.
### Preliminaries
There is a special settings, namely "Enable bitcode" we need set properly when building an ios native plugin.
Generally, the program is possible to run faster when "Enable bitcode" is true while the size of the plugin
will also become bigger.
You can choose to build the library with enabled or disabled "Enable bitcode" using different build commands as
shown in the following two sections.
You can also build UIWidgets engine with enabled or disabled "Enable bitcode" by changing the value of
"ios_bitcode_enabled" in "Build.bee.cs". Note that the value is set to false by default.
You can also change the setting of "Enable bitcode" in the XCode project generated by Unity. Specifically, you can
find this setting in "Build Settings/Build Options/Enable Bitcode". This value is true by default.
You should always keep the "Enable bitcode" settings the same in the built library, the UIWidgets engine and the XCode project generated by your UIWidget project.
### Build Dependencies
Setting up the Engine development environment
Please follow https://github.com/flutter/flutter/wiki/Setting-up-the-Engine-development-environment.
Check out repo and update dependencies:
```
cd $FLUTTER_ROOT/flutter
git checkout flutter-1.17-candidate.5
gclient sync -D
```
Apply following to end of `flutter/third_party/txt/BUILD.gn`
```
diff --git a/third_party/txt/BUILD.gn b/third_party/txt/BUILD.gn
index 56b73a020..d42e88045 100644
--- a/third_party/txt/BUILD.gn
+++ b/third_party/txt/BUILD.gn
@@ -141,6 +141,7 @@ source_set("txt") {
"//third_party/harfbuzz",
"//third_party/icu",
"//third_party/skia",
+ "//third_party/skia/modules/skottie",
]
deps = [
@@ -339,3 +340,10 @@ executable("txt_benchmarks") {
deps += [ "//third_party/skia/modules/skparagraph" ]
}
}
+
+static_library("txt_lib") {
+ complete_static_lib = true
+ deps = [
+ ":txt",
+ ]
+}
```
Comiple engine:
```
cd $FLUTTER_ROOT
./flutter/tools/gn --unoptimized --ios //disable bitcode
./flutter/tools/gn --unoptimized --ios --bitcode //enable bitcode
ninja -C out/ios_debug_unopt/ flutter/third_party/txt:txt_lib
```
If the compilation fails because "no available Mac SDK is found" (in flutter-1.17 the build tool will only try to find Mac 10.XX SDKs), please modify the file "/src/build/Mac/find_sdk.py" under flutter root by setting "sdks" as your current sdk, e.g., ['11.0'].
If the compilation fails because "'Foundation/NSURLHandle.h' file not found" (flutter-1.17 assumes that you are using some low iphone SDK (e.g., older than 12.2), in which some platform-dependent Macros are defined differently from new SDKs like 12.2), please modify the file "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/TargetConditionals.h" in your system by making "TARGET_OS_EMBEDDED = 1" and "TARGET_OS_MACCATALYST = 0" for arm64-iphone architecture. You can also work-around this issue by checking out a new version of flutter (e.g., "flutter-1.18-candidate.6") and run "gclient sync -D" to get dependencies on newer iphone SDKs. Then switch back and build.
### Creat symbolic
Create symbolic as follows. Flutter engine txt include skia header in this pattern 'third_party/skia/*', so without symbolic, the txt lib will include skia
header file in flutter engine, instead of headers in skia repo.
cmd
```
cd <uiwidigets_dir>\engine
cd third_party   \\ create the directory if not exists
ln -s <SKIA_ROOT> skia
```
### Build Engine
```
cd <uiwidigets_dir>\engine
mono bee.exe ios
```
正在加载...
取消
保存