• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2022 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.
13
14import("//build/ohos.gni")
15import("//foundation/arkui/ace_engine/ace_config.gni")
16
17# Common config for Ability Cross-platform Environment(ACE) source
18config("ace_config") {
19  include_dirs = [
20    "$ace_root",
21    "$ace_root/frameworks",
22    "$root_out_dir/arkui/framework",
23    "//third_party/zlib",
24  ]
25
26  if (is_ohos_standard_system && !use_mingw_win && !use_mac && !use_linux) {
27    include_dirs += [
28      "//base/global/resource_management/frameworks/resmgr/include",
29      "//base/global/resource_management/interfaces/inner_api/include",
30      "$ace_root/adapter/ohos/services/uiservice/include",
31    ]
32  }
33  defines = ace_common_defines
34
35  if (is_wearable_product) {
36    defines += ace_wearable_defines
37  }
38
39  if (is_ivi_product) {
40    defines += ace_ivi_defines
41  }
42
43  cflags = [
44    "-fvisibility=hidden",
45    "-fdata-sections",
46    "-ffunction-sections",
47    "-Wno-non-c-typedef-for-linkage",
48    "-Os",
49    "-Werror=return-stack-address",
50  ]
51
52  cflags_cc = [
53    "-fvisibility-inlines-hidden",
54    "-Wno-non-c-typedef-for-linkage",
55    "-Os",
56  ]
57
58  if (use_mingw_win) {
59    cflags_cc += [ "-std=c++17" ]
60    defines += [ "_USE_MATH_DEFINES" ]
61  }
62
63  if (use_linux) {
64    cflags_cc += [ "-std=c++17" ]
65    defines += [ "_USE_MATH_DEFINES" ]
66  }
67
68  ldflags = []
69  if (ace_engine_feature_enable_coverage) {
70    cflags += [ "--coverage" ]
71    ldflags += [ "--coverage" ]
72  }
73}
74
75config("ace_test_config") {
76  visibility = [ ":*" ]
77  visibility += [
78    "//foundation/arkui/ace_engine/build/*",
79    "//foundation/arkui/ace_engine/frameworks/bridge/test/unittest/*",
80    "//foundation/arkui/ace_engine/frameworks/core/*",
81    "//foundation/arkui/ace_engine/test/fuzztest/*",
82    "//foundation/arkui/ace_engine/test/unittest/*",
83    "//foundation/graphic/graphic_2d/rosen/test/render_service/*",
84  ]
85  include_dirs = [
86    "$ace_root",
87    "$ace_root/frameworks",
88    "$root_out_dir/arkui/framework",
89  ]
90  cflags_cc = []
91  defines = ace_common_defines
92
93  if (is_ohos_standard_system && !use_mingw_win && !use_mac && !use_linux) {
94    include_dirs += [
95      "//base/global/resource_management/frameworks/resmgr/include",
96      "//base/global/resource_management/interfaces/inner_api/include",
97    ]
98
99    cflags_cc += [
100      "-Wno-thread-safety-attributes",
101      "-Wno-thread-safety-analysis",
102      "-Wno-non-c-typedef-for-linkage",
103    ]
104    defines += [ "OHOS_STANDARD_SYSTEM" ]
105  }
106
107  if (!is_ohos_standard_system) {
108    defines += [ "ENABLE_NATIVE_VIEW" ]
109  }
110
111  defines += [ "OHOS_PLATFORM" ]
112
113  if (is_wearable_product) {
114    defines += ace_wearable_defines
115  }
116
117  cflags = [
118    "-fvisibility=hidden",
119    "-fdata-sections",
120    "-ffunction-sections",
121  ]
122
123  cflags_cc += [ "-fvisibility-inlines-hidden" ]
124  ldflags = [ "-Wl,-gc-sections" ]
125
126  if (ace_engine_feature_enable_coverage) {
127    cflags += [ "--coverage" ]
128    ldflags += [ "--coverage" ]
129  }
130}
131
132config("ace_coverage_config") {
133  cflags = []
134  ldflags = []
135  if (ace_engine_feature_enable_coverage) {
136    cflags += [ "--coverage" ]
137    ldflags += [ "--coverage" ]
138  }
139}
140