-
Notifications
You must be signed in to change notification settings - Fork 0
/
atomicservice_config.gni
95 lines (83 loc) · 3.32 KB
/
atomicservice_config.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright (c) 2024 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/config/clang/clang.gni")
import("//build/ohos.gni")
import("//build/test.gni")
enable_dump_drawcmd = false
is_ohos_standard_system = is_standard_system && !is_arkui_x
use_mingw_win = "${current_os}_${current_cpu}" == "mingw_x86_64"
use_mac = "${current_os}_${current_cpu}" == "mac_x64" ||
"${current_os}_${current_cpu}" == "mac_arm64"
use_ios = "${current_os}_${current_cpu}" == "ios_x64" ||
"${current_os}_${current_cpu}" == "ios_arm64"
use_linux = "${current_os}_${current_cpu}" == "linux_x64"
# Config toolchain
windows_buildtool = "//build/toolchain/mingw:mingw_x86_64"
objcopy_default = "//prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/aarch64-linux-android/bin/objcopy"
objcopy_mingw = "//prebuilts/gcc/linux-x86/host/x86_64-w64-mingw32-4.8/x86_64-w64-mingw32/bin/objcopy"
objcopy_x86_64 = "${default_clang_base_path}/bin/llvm-objcopy"
if ("${current_os}_${current_cpu}" == "mac_arm64") {
mac_buildtool = "//build/toolchain/mac:clang_arm64"
} else if ("${current_os}_${current_cpu}" == "mac_x64") {
mac_buildtool = "//build/toolchain/mac:clang_x64"
}
objcopy_clang = "$clang_base_path/bin/llvm-objcopy"
if (is_ohos_standard_system) {
objcopy_default = "//prebuilts/clang/ohos/linux-x86_64/llvm/bin/llvm-objcopy"
} else if (is_arkui_x) {
if (host_os == "mac") {
objcopy_default = objcopy_clang
}
}
use_hilog = is_mingw || is_mac || is_linux || is_ohos || is_ohos_standard_system
# Config gen_obj
template("gen_obj") {
name = target_name
action("gen_obj_" + name) {
visibility = [ ":*" ] # Only targets in this file can depend on this.
if (use_mingw_win) {
objcopy_tool = objcopy_mingw
script = "//foundation/arkui/ace_engine/build/tools/build_resource_to_bytecode.py"
} else if (use_mac || target_os == "ios") {
objcopy_tool = objcopy_clang
script = "//foundation/arkui/ace_engine/build/tools/build_resource_to_bytecode.py"
} else if (use_linux) {
objcopy_tool = objcopy_x86_64
script = "//foundation/arkui/ace_engine/build/tools/build_resource_to_bytecode.py"
} else if (target_cpu == "x86_64") {
objcopy_tool = objcopy_x86_64
script = "//foundation/arkui/ace_engine/build/tools/run_objcopy.py"
} else {
objcopy_tool = objcopy_default
script = "//foundation/arkui/ace_engine/build/tools/run_objcopy.py"
}
args = [
"--objcopy",
rebase_path(objcopy_tool),
"--input",
rebase_path(invoker.input),
"--output",
rebase_path(invoker.output),
"--arch",
current_cpu,
]
deps = []
deps += invoker.snapshot_dep
inputs = [ invoker.input ]
outputs = [ invoker.output ]
}
source_set("gen_obj_src_" + name) {
sources = [ invoker.output ]
deps = [ ":gen_obj_" + name ]
}
}