# Copyright (c) 2021-2022 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 = [] 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_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/utils.cpp", ] if (platform != "windows") { # add secure c API include_dirs = [ "//third_party/bounds_checking_function/include" ] if (is_cross_platform_build) { deps += [ "//third_party/bounds_checking_function:libsec_static" ] } else { deps += [ "//third_party/bounds_checking_function:libsec_shared" ] } } else { defines -= [ "UNICODE" ] libs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib/libshlwapi.a" ] } if (is_cross_platform_build) { deps += [ "//foundation/graphic/graphic_2d/rosen/modules/render_service_client:librender_service_client_static" ] } else { external_deps += [ "graphic_2d:librender_service_client" ] } # curl download manager if (defined(config.use_curl_download) && config.use_curl_download) { configs += [ "//third_party/curl:curl_config" ] sources += [ "$ace_root/frameworks/base/network/download_manager.cpp" ] deps += [ "$ace_root/frameworks/base/network:cacert.pem" ] if (is_cross_platform_build) { deps += [ "//third_party/curl:curl" ] } else { deps += [ "//third_party/curl:curl_shared" ] } } if (is_cross_platform_build || platform != "ohos") { deps += [ "//third_party/cJSON:cjson_static" ] } else { deps += [ "//third_party/cJSON:cjson" ] } 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/system_properties.cpp" ] } else { sources += [ "$ace_root/adapter/$platform/osal/system_properties.cpp" ] } if (platform == "ohos") { external_deps = [ "hichecker:libhichecker", "init:libbeget_proxy", "init:libbegetutil", ] } } }