OHOS的開發環境搭建和編譯系統的混雜,一直以來都是開發者吐槽最多的地方。
?
2021年我搭建了一個可用的開發環境,放在了百度云盤:
鏈接為:https://pan.baidu.com/s/1KvSGFBf6pdyqdJTTq_1O6A 提取碼:ohos
這里提供了一個配置好的Linux虛擬機開發環境、以及相關的配套工具和驅動軟件。
有需要的小伙伴可去這里下載來使用,根據 README 文檔來使用即可。
OHOS3.1版本會有一些新依賴的工具,請開發者自行安裝或更新即可。如:
執行“sudo apt install -y libncurses5” 安裝 “NCURSES_TINFO_5.0.19991023”
執行“sudo apt install ruby-full gcc-arm-linux-gnueabi” 安裝新需要的編譯工具等等。
?
OHOS3.1版本,明顯可以看出標準系統的編譯流程相比LTS3.0版本,精簡了非常多,標準系統的build.sh和小型系統的hb build實際進行了合并統一,我對相關的編譯流程做了一下整理,如下圖所示。
實測通過build.sh編譯的log如下:
++++++++++++++++++++++++++++++++++++++++
--product-name rk3568 --ccache
[1]//build/build_cripts/build.sh: Begin:
[2]//build/scripts/entry.py: Begin to do_build:
[3]//build/lite/build.py: Begin to build: { rk3568 }
[4]//build/lite/hb/__main__.py: Begin:
[5]//build/lite/hb_internal/build/build.py: create a 'Build build' and collect cmd+args
[5]//build/lite/hb_internal/build/build.py: build.build( ['rk3568'] )
--------------------------------------------------------------------------
[6]//build/lite/hb_internal/build/build_process.py: build ccache[OHOS INFO] Set cache size limit to 50.0 GB
--------------------------------------------------------------------------
[6.gn]//build/lite/hb_internal/build/build_process.py: gn_build run gn_gen[OHOS INFO] [.gn] run .gn -> //build/core/gn/dotfile.gn ==>> root -->>
[OHOS INFO] =======================================================
[OHOS INFO] [gn] -->>root : //build/core/gn/BUILD.gn: Begin
[OHOS INFO] root_out_dir = //out/rk3568
[OHOS INFO] root_build_dir = //out/rk3568
[OHOS INFO] root_gen_dir = //out/rk3568/gen
[OHOS INFO] current_toolchain = //build/toolchain/ohos:ohos_clang_arm
[OHOS INFO] host_toolchain = //build/toolchain/linux:clang_x64
[OHOS INFO] enable_ramdisk = true
[OHOS INFO] [gn] collect args for 'load.py'
[OHOS INFO] [gn] _platforms_config_file: //out/preloader/rk3568/platforms.build
[OHOS INFO] [gn] _subsystem_config_file: //out/preloader/rk3568/subsystem_config.json
[OHOS INFO] [gn] exec_script: //build/loader/load.py
...........
[OHOS INFO] [gn] -->>root: //build/core/gn/BUILD.gn: Begin
[OHOS INFO] =======================================================
...........
[OHOS INFO] Done. Made 15929 targets from 2670 files in 71720ms
-------------------------------------------------------------------------------
[6.ninja]//build/lite/hb_internal/build/build_process.py: ninja_build run ninja[OHOS INFO] [1/1] Regenerating ninja files
[OHOS INFO] [1/728] CC clang_x64/obj/third_party/pcre2/pcre2/src/libpcre2/pcre2_config.o
...........
[OHOS INFO] [639/640] STAMP obj/build/ohos/images/make_images.stamp
[OHOS INFO] [640/640] STAMP obj/build/core/gn/images.stamp--------------------------------------------------
[6.PostBuild] build_process.py: PostBuild.clean
[7]//build/lite/hb_internal/common/misc.py: PostBuild.clean()
[OHOS INFO] //build/scripts/summary_ccache_hitrate.py: main()
[OHOS INFO] -------------------------------------------------
[OHOS INFO] ccache summary:
...........
[OHOS INFO] rk3568 build success
[OHOS INFO] cost time: 0:03:05
[6]//build/lite/hb_internal/build/build_process.py: build success
[4]//build/lite/hb/__main__.py: End. status[ 0 ]
[1]//build/build_cripts/build.sh: End.
=====build successful=====
++++++++++++++++++++++++++++++++++++++++
通過hb build來編譯,直接就是從[4]開始,到[4]結束。
中間的過程請小伙伴們自行深入去理解了。
審核編輯:湯梓紅
-
開發環境
+關注
關注
1文章
225瀏覽量
16610
發布評論請先 登錄
相關推薦
評論