# Copyright (c) 2021-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/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") template("ace_base_source_set") { forward_variables_from(invoker, "*") ohos_source_set(target_name) { if (current_os == "ohos") { sanitize = { integer_overflow = true boundary_sanitize = true debug = ace_sanitize_debug } } subsystem_name = ace_engine_subsystem part_name = ace_engine_part defines += invoker.defines deps = [ "base64:ace_base_base64_$platform", "i18n:ace_base_i18n_$platform", "resource:ace_resource", ] external_deps = [] include_dirs = [] if (is_arkui_x) { deps += [ "//third_party/cJSON:cjson_static" ] } else { external_deps += [ "cJSON:cjson" ] } if (use_hilog) { external_deps += [ "hilog:libhilog" ] } configs = [ "$ace_root:ace_config" ] # add base source file here sources = [ "geometry/animatable_dimension.cpp", "geometry/animatable_matrix4.cpp", "geometry/dimension.cpp", "geometry/least_square_impl.cpp", "geometry/matrix3.cpp", "geometry/matrix4.cpp", "geometry/quaternion.cpp", "geometry/transform_util.cpp", "image/pixel_map.cpp", "json/json_util.cpp", "json/node_object.cpp", "json/uobject.cpp", "log/ace_performance_check.cpp", "log/ace_performance_monitor.cpp", "log/ace_scoring_log.cpp", "log/ace_trace.cpp", "log/ace_tracker.cpp", "log/dump_log.cpp", "log/jank_frame_report.cpp", "memory/memory_monitor.cpp", "perfmonitor/perf_monitor.cpp", "ressched/ressched_report.cpp", "subwindow/subwindow_manager.cpp", "thread/background_task_executor.cpp", "utils/base_id.cpp", "utils/date_util.cpp", "utils/measure_util.cpp", "utils/resource_configuration.cpp", "utils/string_expression.cpp", "utils/string_utils.cpp", "utils/time_util.cpp", "utils/utf.cpp", "utils/utils.cpp", ] if (platform != "windows") { # add secure c API if (is_arkui_x) { deps += [ "//third_party/bounds_checking_function:libsec_static" ] } } else { defines -= [ "UNICODE" ] libs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libshlwapi.a" ] } if (is_arkui_x) { deps += [ "${ace_graphic}/rosen/modules/render_service_client:librender_service_client_static", "${ace_root}/interfaces/inner_api/drawable_descriptor:native_drawabledescriptor_static", ] include_dirs += [ "//foundation/graphic/graphic_surface/interfaces/inner_api/surface", ] } else { external_deps += [ "graphic_2d:librender_service_client" ] } cflags_cc = [] cflags_cc += invoker.cflags_cc } } foreach(item, ace_platforms) { ace_base_source_set("ace_base_" + item.name) { platform = item.name defines = [] cflags_cc = [] config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines = config.defines } if (defined(config.cflags_cc)) { cflags_cc = config.cflags_cc } } ohos_source_set("ace_memory_monitor_" + item.name) { platform = item.name subsystem_name = ace_engine_subsystem part_name = ace_engine_part defines = [] cflags_cc = [] config = { } if (defined(item.config)) { config = item.config } if (defined(config.defines)) { defines = config.defines } if (defined(config.cflags_cc)) { cflags_cc = config.cflags_cc } configs = [ "$ace_root:ace_config" ] sources = [ "$ace_root/frameworks/base/log/dump_log.cpp", "$ace_root/frameworks/base/memory/memory_monitor.cpp", ] if (platform == "windows" || platform == "mac" || platform == "linux") { sources += [ "$ace_root/adapter/preview/osal/event_report.cpp", "$ace_root/adapter/preview/osal/system_properties.cpp", ] } else { sources += [ "$ace_root/adapter/$platform/osal/system_properties.cpp" ] } if (platform == "ohos") { external_deps = [ "hilog:libhilog", "i18n:intl_util", "init:libbeget_proxy", "init:libbegetutil", "window_manager:libdm", ] if (defined(config.hichecker_exists) && config.hichecker_exists) { external_deps += [ "hichecker:libhichecker" ] } } } }