提交 e7a8a834 编写于 作者: O openharmony_ci 提交者: Gitee

!62 add board exe ld flags configuration.

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