同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
The compilation and building subsystem is a building framework based on Generate Ninja (GN) and Ninja, which supports component-based OpenHarmony development. This subsystem can be used to:
Build existing products.
Build chipset source code independently.
Build a single component independently.
It is considered best practice to learn the following basic concepts before you start development and building:
Component
A component is a reusable software unit that can contain source code, configuration files, resource files, and compilation scripts.
GN
GN is short for Generate Ninja, which is used to generate Ninja files.
Ninja
Ninja is a small high-speed building system.
Building Process
Figure 1 shows the building process.
Building Commands
hb set
hb set -h
usage: hb set [-h] [-root [ROOT_PATH]] [-p]
optional arguments:
-h, --help show this help message and exit
-root [ROOT_PATH], --root_path [ROOT_PATH]
Set OHOS root path
-p, --product Set OHOS board and kernel
hb env
View the current configuration.
hb env
[OHOS INFO] root path: xxx
[OHOS INFO] board: hispark_taurus
[OHOS INFO] kernel: liteos
[OHOS INFO] product: ipcamera
[OHOS INFO] product path: xxx/vendor/hisilicon/ipcamera
[OHOS INFO] device path: xxx/device/hisilicon/hispark_taurus/sdk_linux_4.19
hb build
hb build -h
usage: hb build [-h] [-b BUILD_TYPE] [-c COMPILER] [-t [TEST [TEST ...]]]
[--dmverity] [-p PRODUCT] [-f] [-n]
[component [component ...]]
positional arguments:
component name of the component
optional arguments:
-h, --help show this help message and exit
-b BUILD_TYPE, --build_type BUILD_TYPE
release or debug version
-c COMPILER, --compiler COMPILER
specify compiler
-t [TEST [TEST ...]], --test [TEST [TEST ...]]
compile test suite
--dmverity Enable dmverity
-p PRODUCT, --product PRODUCT
build a specified product with
{product_name}@{company}, eg: ipcamera@hisilcon
-f, --full full code compilation
hb clean
Clear the compilation result of the product in the out directory, and retain the args.gn and build.log files only. To clear files in a specified directory, add the directory parameter to the command, for example, hb clean xxx/out/xxx.
hb clean
usage: hb clean [-h] [out_path]
positional arguments:
out_path clean a specified path.
optional arguments:
-h, --help show this help message and exit
Ensure that the development environment has GN and Ninja, Python 3.7.4 and later, and hb commands. You must download the complete code before you start.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。