提交 8205aabf 编写于 作者: Y yangming_ha

#I3YIUO: support ccache

Signed-off-by: Nyangming_ha <yangming_ha@163.com>
上级 9d70f9e6
......@@ -50,13 +50,20 @@ if (host_os == "win") {
toolchain_cmd_suffix = ".exe"
}
# enable ccache if ccache installed.
if (ohos_build_enable_ccache) {
compile_prefix = "ccache "
} else {
compile_prefix = ""
}
# Set current toolchain with to board configuration.
if (board_toolchain != "" && use_board_toolchain) {
ohos_build_compiler = board_toolchain_type
if (board_toolchain_path != "") {
compile_prefix = "${board_toolchain_path}/${board_toolchain_prefix}"
compile_prefix += "${board_toolchain_path}/${board_toolchain_prefix}"
} else {
compile_prefix = "${board_toolchain_prefix}"
compile_prefix += "${board_toolchain_prefix}"
}
set_default_toolchain("//build/lite/toolchain:${board_toolchain}")
if (board_toolchain_type == "gcc") {
......@@ -82,7 +89,7 @@ if (board_toolchain != "" && use_board_toolchain) {
# OHOS default toolchain
ohos_build_compiler = "clang"
ohos_clang_toolchain_dir = rebase_path("${ohos_build_compiler_dir}/bin")
compile_prefix = rebase_path("${ohos_build_compiler_dir}/bin")
compile_prefix += rebase_path("${ohos_build_compiler_dir}/bin")
ohos_current_cc_command = "${compile_prefix}/clang$toolchain_cmd_suffix"
ohos_current_cxx_command = "${compile_prefix}/clang++$toolchain_cmd_suffix"
ohos_current_ar_command = "${compile_prefix}/llvm-ar$toolchain_cmd_suffix"
......
......@@ -42,4 +42,4 @@ CONFIG_STRUCT = {
"device_path": None,
"patch_cache": None
}
VERSION = '0.4.1'
VERSION = '0.4.2'
......@@ -21,6 +21,7 @@ from collections import defaultdict
from hb.build.build_process import Build
from hb.set.set import set_product
from hb.common.utils import get_current_time
from distutils.spawn import find_executable
def add_options(parser):
......@@ -98,4 +99,9 @@ def exec_command(args):
'true',
quota=False)
# enable ccache if it installed.
ccache_path = find_executable('ccache')
if ccache_path is not None:
build.register_args('ohos_build_enable_ccache', 'true', quota=False)
return build.build(args.full, patch=args.patch, cmd_args=cmd_args)
......@@ -39,6 +39,9 @@ declare_args() {
ohos_kernel_type = ""
use_board_toolchain = true
# hb set it to true if ccache installed.
ohos_build_enable_ccache = false
# Current toolchain cc command. E.g. "/data/user1/riscv32/bin/riscv32-unknown-elf-gcc".
ohos_current_cc_command = ""
ohos_current_cxx_command = ""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册