还以海思的hispark_taurus开发板为例,对应的 `device/hisilicon/hispark_taurus/config.gni`内容如下:
```
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "cortex-a7"
# Toolchain name used for system compiling.
# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf.
# Note: The default toolchain is "ohos-clang". It's not mandatory if you use the default toochain.
board_toolchain = "mips-linux-gnu-gcc"
# The toolchain path installed, it's not mandatory if you have added toolchain path to your ~/.bashrc.
board_toolchain_path =
rebase_path("//prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin",
root_build_dir)
# Compiler prefix.
board_toolchain_prefix = "arm-linux-ohoseabi-"
# Compiler type, "gcc" or "clang".
board_toolchain_type = "gcc"
# Board related common compile flags.
board_cflags = [
]
board_cxx_flags = [
]
board_ld_flags = []
# Board related headfiles search path.
board_include_dirs = []
board_include_dirs += [ rebase_path(
"//prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/target/usr/include",
root_build_dir) ]
# Board adapter dir for OHOS components.
board_adapter_dir = ""
# Sysroot path.
board_configed_sysroot = ""
# Board storage type, it used for file system generation.
storage_type = "emmc"
```
3. 编写开发板编译脚本
步骤1中的 `BUILD.gn`为新增的开发板的编译入口,主要用于编译开发板相关的代码,主要为设备侧驱动、设备侧接口适配(媒体,图形等)和开发板的SDK等等。
海思的hispark_taurus开发板的 `device/hisilicon/hispark_taurus/BUILD.gn`可写成: