• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13import("//build/common.gni")
14
15# Description: Define the global variables for all components
16declare_args() {
17  # OHOS version
18  name = "OpenHarmony"
19  major = "4"
20  minor = "0"
21  revision = "Beta1"
22  ohos_version = "$name $major.$minor $revision"
23  ohos_build_time = ""
24  ohos_build_datetime = ""
25
26  product = ""
27  device_path = ""
28  product_path = ""
29
30  device_config_path = ""
31  product_config_path = ""
32
33  device_company = ""
34  ohos_product_adapter_dir = ""
35
36  # "debug" or "release"
37  ohos_build_type = "debug"
38  ohos_full_compile = false
39  ohos_build_compiler = ""
40  ohos_build_compiler_specified = ""
41  ohos_build_target = ""
42  ohos_build_compiler_dir = ""
43  ohos_kernel_type = ""
44  ohos_kernel_path = ""
45  ohos_kernel_is_prebuilt = false
46  use_board_toolchain = true
47
48  # hb set it to true if ccache installed.
49  ohos_build_enable_ccache = false
50  ohos_build_enable_xcache = false
51
52  # Current toolchain cc command. E.g. "/data/user1/riscv32/bin/riscv32-unknown-elf-gcc".
53  ohos_current_cc_command = ""
54  ohos_current_cxx_command = ""
55  ohos_current_ar_command = ""
56  ohos_current_ld_command = ""
57  ohos_current_strip_command = ""
58
59  # Current sysroot path. E.g. "//out/hispark_taurus/ipcamera_hispark_taurus/sysroot".
60  ohos_current_sysroot = "$root_out_dir/sysroot"
61}
62
63if (product_config_path != "") {
64  product_config = read_file("${product_config_path}/config.json", "json")
65
66  # Board selected by product.
67  board_name = product_config.board
68  device_company = product_config.device_company
69
70  # Supported kernel: "liteos_a", "liteos_m", "linux", "uniproton"
71  ohos_kernel_type = product_config.kernel_type
72  if (defined(product_config.kernel_is_prebuilt)) {
73    ohos_kernel_is_prebuilt = product_config.kernel_is_prebuilt
74  }
75
76  # support config kernel liteos_m path
77  if (ohos_kernel_type == "liteos_m") {
78    if (defined(product_config.kernel_path)) {
79      ohos_kernel_path = product_config.kernel_path
80    } else {
81      ohos_kernel_path = "//kernel/liteos_m"
82    }
83  }
84
85  # To be deleted, and will use board config.
86  if (defined(product_config.vendor_adapter_dir)) {
87    ohos_vendor_adapter_dir = product_config.vendor_adapter_dir
88    ohos_board_adapter_dir = ohos_vendor_adapter_dir
89  }
90  ohos_product_adapter_dir = product_config.product_adapter_dir
91  ohos_third_party_dir = product_config.third_party_dir
92}
93
94ohos_build_user = "jenkins"
95ohos_build_host = host_os
96ohos_build_roothash = ""
97ohos_root_path = rebase_path("//")
98ohos_lite = true
99
100# Testing switches
101LOSCFG_TEST_JS_BUILD = false
102LOSCFG_TEST_MLF_BUILD = false
103LOSCFG_TEST_C_BUILD = false
104LOSCFG_TEST_APPS = false
105
106declare_args() {
107  enable_ohos_hiview = true
108  enable_ohos_hiview_event = true
109  enable_ohos_hiview_platform = false
110}
111
112declare_args() {
113  enable_tee_ree = false
114  enable_ohos_security_dmverity = false
115}
116
117declare_args() {
118  ohos_build_userspace_only = false
119}
120