OpenHarmony编译构建分析日志

OpenHarmony支持内核

LiteOS

liteos_a

liteos_m

small linux-kernel

standard linux-kernel

编译脚本
./build
这个写起来有点复杂,可以追踪编译某一产品整个构建过程来分析。
主要参数解析,有的是默认的,有的根据环境自动配置,有的需要添加参数
。。以后慢慢加上。
..........
编译构建工具
通过./build/prebuilts_download.sh脚本将编译工具下载到prebuilts目录
普通构建

配置选项及选择产品

hb set

查看环境变量

hb env

构建

hb build

脚本构建
./build.sh

如:构建Hi3516DV300

./build.sh --product-name Hi3516DV300 --ccache --build-target images --build-target hdf_test --target-os ohos --target-cpu arm --gn-args is_standard_system=true


参数解析
--product-name#产品
--ccache#提高速度
--build-target#编译选择
--target-cpu#架构
--gn-args 添加参数
编译toybox

./build.py -T //third_party/toybox
./build.sh --product-name Hi3516DV300 --build-target toybox
./build.sh --product-name Hi3516DV300 --build-target make_test
./build.sh --product-name Hi3516DV300 --build-target hdf_test
./build.sh --product-name Hi3516DV300 --build-target xxx_test

编译kernel

#https://gitee.com/openharmony/kernel_linux_build
#切换5.10可直接替换
./build.sh --product-name Hi3516DV300 \
           --build-target build_kernel \
           --gn-args linux_kernel_version=\"linux-4.19\"


编译sdk

./build.sh --product-name ohos-sdk 

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐