浏览代码

fix stack corruption

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
72e07319
共有 2 个文件被更改,包括 47 次插入88 次删除
  1. 51
      engine/Build.bee.cs
  2. 84
      engine/README.md

51
engine/Build.bee.cs


{
SetupRadidJson(np);
var ignoreWarnigs = new string[] { "4244", "4267", "5030", "4101", "4996", "4359", "4018", "4091", "4722", "4312", "4838", "4172", "4005", "4311", "4477" }; // todo comparing the list with engine
// TODO: fix warning, there are some type mismatches
var ignoreWarnigs = new string[] { "4244", "4267", "5030", "4101", "4996", "4359", "4018", "4091", "4722", "4312", "4838", "4172", "4005", "4311", "4477" };
np.CompilerSettings().Add(c => IsWindows(c), s => s.WithWarningPolicies(ignoreWarnigs.Select((code) => new WarningAndPolicy(code, WarningPolicy.Silent)).ToArray()));
np.Defines.Add(c => IsMac(c), new []

"third_party",
"src",
flutterRoot,
flutterRoot+"/third_party/rapidjson/include",
flutterRoot + "/third_party/rapidjson/include",
flutterRoot+"/flutter/third_party/txt/src",
flutterRoot + "/flutter/third_party/txt/src",
flutterRoot+"/third_party/icu/source/common",
flutterRoot+"/third_party/icu/source/i18n",
flutterRoot + "/third_party/icu/source/common",
flutterRoot + "/third_party/icu/source/i18n",
});
np.CompilerSettings().Add(c => IsWindows(c), c => c.WithCustomFlags(new [] {
"-D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING",

"-DNOMINMAX",
"-DSK_GAMMA_APPLY_TO_A8",
"-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
"-DGR_TEST_UTILS=1",
// "-DGR_TEST_UTILS=1",
"-DSKIA_IMPLEMENTATION=1",
"-DSK_GL",
"-DSK_ENABLE_DUMP_GPU",

"-DSK_CODEC_DECODES_WEBP",
"-DSK_ENCODE_WEBP",
"-DSK_XML",
// "-DSKSL_STANDALONE",
"-DLIBEGL_IMPLEMENTATION",
"-D_CRT_SECURE_NO_WARNINGS",

"-DGL_APICALL=",
"-DGL_API=",
"-DEGLAPI=",
//"-I../..",
//"-Igen",
//"-I../../third_party/icu/source/common",
//"-I../../third_party/icu/source/i18n",
//"-I../..",
//"-I../../third_party/dart/runtime",
//"-I../../third_party/dart/runtime/include",
"/GS",
//"/wd4091",
//"/wd4722",
//"/wd4312",
//"/wd4838",
//"/wd4172",
//"/wd4005",
//"/wd4311",
//"/wd4477",
"/MTd",
"/Od",
"/Ob0",

"-fvisibility-inlines-hidden",
}));
var basePath = skiaRoot + "/out/Debug";
var basePath = skiaRoot + "/out/Debug";
return new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot+"/out/host_debug_unopt/obj/flutter/third_party/txt/txt_lib.lib"),

//new StaticLibrary(basePath + "/skia.lib"),
//new StaticLibrary(basePath + "/skottie.lib"),
//new StaticLibrary(basePath + "/sksg.lib"),
//new StaticLibrary(basePath + "/skshaper.lib"),
//new StaticLibrary(basePath + "/harfbuzz.lib"),
//new StaticLibrary(basePath + "/libEGL.dll.lib"),
//new StaticLibrary(basePath + "/libGLESv2.dll.lib"),
// new SystemLibrary("rpcrt4.lib"),
//new SystemLibrary("D3D12.lib"),
//new SystemLibrary("DXGI.lib"),
//new SystemLibrary("d3dcompiler.lib"),
// new SystemLibrary(basePath + "/obj/tools/trace/trace.ChromeTracingTracer.obj"),
// new SystemLibrary(basePath + "/obj/tools/trace/trace.EventTracingPriv.obj"),
// new SystemLibrary(basePath + "/obj/tools/trace/trace.SkDebugfTracer.obj"),
// new SystemLibrary(basePath + "/obj/tools/flags/flags.CommandLineFlags.obj"),
var basePath = skiaRoot + "/out/Debug";
np.SupportFiles.Add(c => IsWindows(c), new [] {
new DeployableFile(basePath + "/libEGL.dll"),
new DeployableFile(basePath + "/libEGL.dll.pdb"),

84
engine/README.md


## How to Build (Windows)
### Build Skia
1. Install depot_tools
### Install depot_tools
2. Clone the skia Repo
```
git clone https://skia.googlesource.com/skia.git
cd skia
git checkout chrome/m85
python2 tools/git-sync-deps
```
3. Install LLVM
https://clang.llvm.org/get_started.html
4. Build skia
```
bin/gn gen out/Debug
```
Update out/Debug/args.gn with the following content:
```
clang_win = "C:\Program Files\LLVM"
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
```
cd flutterRoot/third_party/icu/flutter/
ld -r -b binary -o icudtl.o icudtl.dat
```
### Build flutter txt
1. Setting up the Engine development environment

```
#### `optional`
update `out\host_debug_unopt\args.gn`
```
skia_use_angle = true

cd engine/src
python ./flutter/tools/gn --unoptimized
ninja -C out\host_debug_unopt flutter/third_party/txt:txt_lib
```
### 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
```
cd flutterRoot/third_party/icu/flutter/
ld -r -b binary -o icudtl.o icudtl.dat
```
### Build Engine

正在加载...
取消
保存