美文网首页
Flutter 编译flag

Flutter 编译flag

作者: 三三At你 | 来源:发表于2019-10-16 18:53 被阅读0次

推荐阅读
http://gityuan1.rssing.com/chan-63063684/latest.php
https://www.stephenw.cc/2018/07/30/flutter-compile-mode/
https://mrale.ph/dartvm/
http://gityuan.com/2019/10/05/dart_vm/
http://gityuan.com/2019/09/22/dartvm_flags/
http://gityuan.com/2019/09/21/flutter_gen_snapshot/
http://gityuan.com/2019/09/14/flutter_frontend_server/

debug

~/Desktop/Workspace/engine/src/out/host_jit_release/dart-sdk/bin/dart 
~/Desktop/Workspace/engine/src/out/host_jit_release/gen/frontend_server.dart.snapshot 
--sdk-root 
~/Desktop/Workspace/engine/src/out/ios_jit_release/flutter_patched_sdk/ 
--strong 
--target=flutter 
-Ddart.developer.causal_async_stacks=true 
--enable-asserts 
--track-widget-creation 
--no-link-platform 
--packages 
~/Desktop/Workspace/flutterdemo/.packages 
--output-dill 
~/Desktop/Workspace/flutterdemo/.dart_tool/flutter_build/172032ad24d7c463287eab1d173e784e/app.dill 
--depfile 
~/Desktop/Workspace/flutterdemo/.dart_tool/flutter_build/172032ad24d7c463287eab1d173e784e/kernel_snapshot.d 
package:flutterdemo/main.dart

aot

~/Desktop/Workspace/engine/src/out/host_jit_release/dart-sdk/bin/dart 
~/Desktop/Workspace/engine/src/out/host_jit_release/gen/frontend_server.dart.snapshot 
--sdk-root 
~/Desktop/Workspace/engine/src/out/ios_jit_release/flutter_patched_sdk/ 
--strong 
--target=flutter 
-Ddart.developer.causal_async_stacks=true 
--aot 
--tfa 
-Ddart.vm.product=true 
--packages 
.packages 
--output-dill 
build/aot/app.dill 
--depfile 
build/aot/kernel_compile.d 
package:flutterdemo/main.dart

debug 特定参数

--enable-asserts 
Whether asserts will be enabled.  默认:false

--track-widget-creation 
Run a kernel transformer to track creation locations for widgets. 默认:false

--no-link-platform 
When in batch mode, link platform kernel file into result kernel file.
Intended use is to satisfy different loading strategies implemented
by gen_snapshot(which needs platform embedded) vs
Flutter engine(which does not)',

aot特定参数

--aot 
Run compiler in AOT mode (enables whole-program transformations) 默认:false

--tfa 
Enable global type flow analysis and related transformations in AOT mode. 默认:false

-Ddart.vm.product=true

中间产物app.dill好像都一样

//根据app.dill生成机器码?
[ +169 ms] executing: ~/flutter/bin/cache/artifacts/engine/ios-profile/gen_snapshot_arm64 --causal_async_stacks --deterministic --snapshot_kind=app-aot-assembly --assembly=build/aot/arm64/snapshot_assembly.S build/aot/app.dill
[+19360 ms] Building App.framework for arm64...
//生成目标文件
[   +1 ms] executing: xcrun cc -arch arm64 -miphoneos-version-min=8.0 -c build/aot/arm64/snapshot_assembly.S -o build/aot/arm64/snapshot_assembly.o
[+7850 ms] clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
[   +5 ms] executing: xcrun clang -arch arm64 -miphoneos-version-min=8.0 -dynamiclib -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -install_name @rpath/App.framework/App -o build/aot/arm64/App.framework/App build/aot/arm64/snapshot_assembly.o
[ +276 ms] clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
           ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture arm64 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd
//dump 符号文件
[        ] executing: xcrun dsymutil build/aot/arm64/App.framework/App -o build/aot/arm64/App.framework.dSYM.noindex
//合并多架构
[ +433 ms] executing: lipo build/aot/arm64/App.framework/App -create -output build/aot/App.framework/App
[  +29 ms] executing: lipo -create -output build/aot/App.framework.dSYM.noindex/Contents/Resources/DWARF/App build/aot/arm64/App.framework.dSYM.noindex/Contents/Resources/DWARF/App
[  +27 ms] Building AOT snapshot in profile mode (ios-profile)... (completed in 69.5s)
[   +1 ms] Built to build/aot/.
[   +1 ms] "flutter aot" took 70,012ms.

相关文章

网友评论

      本文标题:Flutter 编译flag

      本文链接:https://www.haomeiwen.com/subject/bngumctx.html