提交 d4fcee4e 编写于 作者: Y yangming_ha 提交者: yangming_ha

add board exe ld flags configuration.

上级 7deb00ae
......@@ -17,7 +17,6 @@ group("ohos") {
if (ohos_build_target == "") {
# Step 1: Read product configuration profile.
product_cfg = read_file("${product_path}/config.json", "json")
kernel = product_cfg.kernel_type
# Step 2: Loop subsystems configured by product.
foreach(product_configed_subsystem, product_cfg.subsystems) {
......@@ -54,14 +53,15 @@ group("ohos") {
if (component.component == product_configed_component.component) {
# Step 6.1.1: Loop OS components adapted kernel type.
foreach(component_adapted_kernel, component.adapted_kernel) {
if (component_adapted_kernel == kernel && kernel_valid == false) {
if (component_adapted_kernel == product_cfg.kernel_type &&
kernel_valid == false) {
kernel_valid = true
}
}
assert(
kernel_valid,
"Invalid component configed, ${subsystem_name}:${product_configed_component.component} " + "not available for kernel: $kernel!")
"Invalid component configed, ${subsystem_name}:${product_configed_component.component} " + "not available for kernel: ${product_cfg.kernel_type}!")
# Step 6.1.2: Add valid component for compiling.
foreach(component_target, component.targets) {
......@@ -71,10 +71,12 @@ group("ohos") {
}
}
}
# Step 7: Add device and product target by default.
deps += [
deps += [
"${device_path}/../",
"${product_path}" ]
"${product_path}"
]
} else {
deps += string_split(ohos_build_target, "&&")
}
......
......@@ -172,6 +172,7 @@ config("board_config") {
cflags_cc = []
ldflags = []
include_dirs = []
defines = []
cflags += board_cflags
if (board_configed_sysroot != "") {
cflags += [ "--sysroot=${board_configed_sysroot}" ]
......@@ -181,4 +182,14 @@ config("board_config") {
cflags_cc += board_cxx_flags
ldflags += board_ld_flags
include_dirs += board_include_dirs
if (defined(board_macro_defines)) {
defines += board_macro_defines
}
}
config("board_exe_ld_flags") {
ldflags = []
if (defined(board_exe_ld_flags)) {
ldflags += board_exe_ld_flags
}
}
\ No newline at end of file
......@@ -54,7 +54,6 @@ if (board_toolchain != "" && use_board_toolchain) {
ohos_current_as_command = ohos_current_cc_command
ohos_current_ld_command = ohos_current_cc_command
ohos_current_strip_command = "$compile_prefix/llvm-objcopy --strip-all"
default_target_configs = [ "//build/lite/config:clang" ]
default_target_configs += [ "//build/lite/config:clang_opt" ]
}
} else {
......@@ -116,6 +115,7 @@ default_executable_configs = default_static_library_configs +
set_defaults("executable") {
configs = default_executable_configs
configs += [ "//build/lite/config:board_exe_ld_flags" ]
}
set_defaults("static_library") {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册