浏览代码

update win build

/siyaoH-1.17-PlatformMessage
siyao 3 年前
当前提交
70275116
共有 2 个文件被更改,包括 40 次插入44 次删除
  1. 23
      engine/Build.bee.cs
  2. 61
      engine/README.md

23
engine/Build.bee.cs


"src/engine.cc",
"src/platform_base.h",
},
OutputName = { c => $"libUIWidgets{(c.CodeGen == CodeGen.Debug ? "_d" : "")}" },
OutputName = { c => "libUIWidgets" },
};
// include these files for test only

return new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot+"/out/host_debug_unopt/obj/flutter/third_party/txt/txt_lib.lib"),
new StaticLibrary(flutterRoot+"/out/host_debug_unopt/obj/third_party/angle/angle_lib.lib"),
new StaticLibrary(flutterRoot+"/out/host_debug_unopt/obj/third_party/angle/libEGL_static.lib"),
new StaticLibrary(flutterRoot+"/out/host_debug_unopt/obj/third_party/angle/libGLESv2_static.lib"),
new SystemLibrary("dxguid.lib"),
};
});

return new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot+"/out/host_release/obj/flutter/third_party/txt/txt_lib.lib"),
new StaticLibrary(flutterRoot+"/out/host_release/obj/third_party/angle/angle_lib.lib"),
new StaticLibrary(flutterRoot+"/out/host_release/obj/third_party/angle/libEGL_static.lib"),
new StaticLibrary(flutterRoot+"/out/host_release/obj/third_party/angle/libGLESv2_static.lib"),
};
});
np.Libraries.Add(IsWindows, c =>

new StaticLibrary(windowsSkiaBuild+"/libEGL.dll.lib"),
new StaticLibrary(windowsSkiaBuild+"/libGLESv2.dll.lib"),
new SystemLibrary("Opengl32.lib"),
new SystemLibrary("d3d9.lib"),
new SystemLibrary("gdi32.lib"),
np.SupportFiles.Add(c => IsWindows(c), new[] {
new DeployableFile(windowsSkiaBuild + "/libEGL.dll"),
new DeployableFile(windowsSkiaBuild + "/libEGL.dll.pdb"),
new DeployableFile(windowsSkiaBuild + "/libGLESv2.dll"),
new DeployableFile(windowsSkiaBuild + "/libGLESv2.dll.pdb"),
}
);
np.Libraries.Add(IsMac, c =>
{
return new PrecompiledLibrary[]

61
engine/README.md


```
Apply the following diff:
modify flutter/third_party/txt/BUILD.gn
```
--- a/third_party/txt/BUILD.gn
+++ b/third_party/txt/BUILD.gn

+}
```
modify third_party/angnle/BUILD.gn
```
diff --git a/BUILD.gn b/BUILD.gn
index 06bf3bbbe..1b51a32de 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1252,3 +1252,18 @@ if (!is_component_build && is_android &&
]
}
}
+
+angle_static_library("angle_lib"){
+ complete_static_lib = true
+
+ deps = [
+ ":libANGLE",
+ ":libANGLE_base",
+ ":angle_system_utils",
+ ":angle_version",
+ ]
+
+ public_deps = [
+ ":includes",
+ ]
+}
```
update `out\host_debug_unopt\args.gn`
```

cd engine/src
python ./flutter/tools/gn --unoptimized
ninja -C out\host_debug_unopt flutter/third_party/txt:txt_lib
ninja -C out\host_debug_unopt third_party/angle:angle_lib
ninja -C out\host_debug_unopt third_party/angle:libEGL_static
### Build Skia
1. Install LLVM
https://clang.llvm.org/get_started.html
2. Build skia
```
cd $FLUTTER_ROOT/third_party/skia
python2 tools/git-sync-deps
bin/gn gen out/Debug
```
Update out/Debug/args.gn with the following content:
```
clang_win = "C:\Program Files\LLVM/third_party/skia"
win_vc = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC"
cc = "clang"
cxx = "clang++"
is_debug = true
skia_use_angle = true
skia_use_egl = true
extra_cflags = [
"/MTd",
"-I../../third_party/externals/angle2/include",
]
```
```
ninja -C out/Debug -k 0
```
Ignore this error: "lld-link: error: could not open 'EGL': no such file or directory"
convert icudtl.dat to object file in flutter
```

正在加载...
取消
保存