• 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
17template("ace_base_source_set") {
18  forward_variables_from(invoker, "*")
19
20  ohos_source_set(target_name) {
21    subsystem_name = ace_engine_subsystem
22    part_name = ace_engine_part
23    defines += invoker.defines
24    deps = [
25      "base64:ace_base_base64_$platform",
26      "i18n:ace_base_i18n_$platform",
27      "resource:ace_resource",
28    ]
29
30    configs = [ "$ace_root:ace_config" ]
31
32    # add base source file here
33    sources = [
34      "geometry/animatable_dimension.cpp",
35      "geometry/animatable_matrix4.cpp",
36      "geometry/dimension.cpp",
37      "geometry/least_square_impl.cpp",
38      "geometry/matrix3.cpp",
39      "geometry/matrix4.cpp",
40      "geometry/quaternion.cpp",
41      "geometry/transform_util.cpp",
42      "image/pixel_map.cpp",
43      "json/json_util.cpp",
44      "log/ace_scoring_log.cpp",
45      "log/ace_trace.cpp",
46      "log/ace_tracker.cpp",
47      "log/dump_log.cpp",
48      "memory/memory_monitor.cpp",
49      "ressched/ressched_report.cpp",
50      "subwindow/subwindow_manager.cpp",
51      "thread/background_task_executor.cpp",
52      "utils/base_id.cpp",
53      "utils/date_util.cpp",
54      "utils/measure_util.cpp",
55      "utils/resource_configuration.cpp",
56      "utils/string_expression.cpp",
57      "utils/string_utils.cpp",
58      "utils/time_util.cpp",
59    ]
60
61    if (platform != "windows") {
62      # add secure c API
63      include_dirs = [ "//third_party/bounds_checking_function/include" ]
64      if (is_cross_platform_build) {
65        deps += [ "//third_party/bounds_checking_function:libsec_static" ]
66      } else {
67        deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
68      }
69    }
70
71    # curl download manager
72    if (defined(config.use_curl_download) && config.use_curl_download) {
73      configs += [ "//third_party/curl:curl_config" ]
74      sources += [ "$ace_root/frameworks/base/network/download_manager.cpp" ]
75      deps += [ "$ace_root/frameworks/base/network:cacert.pem" ]
76      if (is_cross_platform_build) {
77        deps += [ "//third_party/curl:curl" ]
78      } else {
79        deps += [ "//third_party/curl:curl_shared" ]
80      }
81    }
82
83    if (is_cross_platform_build || platform != "ohos") {
84      deps += [ "//third_party/cJSON:cjson_static" ]
85    } else {
86      deps += [ "//third_party/cJSON:cjson" ]
87    }
88
89    cflags_cc = []
90    cflags_cc += invoker.cflags_cc
91  }
92}
93
94foreach(item, ace_platforms) {
95  ace_base_source_set("ace_base_" + item.name) {
96    platform = item.name
97    defines = []
98    cflags_cc = []
99    config = {
100    }
101
102    if (defined(item.config)) {
103      config = item.config
104    }
105
106    if (defined(config.defines)) {
107      defines = config.defines
108    }
109
110    if (defined(config.cflags_cc)) {
111      cflags_cc = config.cflags_cc
112    }
113  }
114}
115