# Copyright (c) 2023-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") config("drawable_config") { include_dirs = [ "$ace_root/interfaces/inner_api", "${ace_root}/interfaces/inner_api/drawable_descriptor", ] if (current_os != "ohos") { include_dirs += [ "//base/global/resource_management/frameworks/resmgr/include", "//base/global/resource_management/interfaces/inner_api/include", ] } } if (is_arkui_x) { import("//foundation/graphic/graphic_2d/graphic_config.gni") import("//foundation/multimedia/image_framework/ide/image_decode_config.gni") import("//plugins/drawable_descriptor/drawable_descriptor.gni") ohos_source_set("native_drawabledescriptor_static") { configs = [ "$ace_root:ace_config", "$ace_root:ace_coverage_config", ] cflags_cc = [ "-std=c++17", "-fno-rtti", ] include_dirs = [ "${ace_root}/interfaces/napi/kits/utils", "${ace_root}/interfaces/inner_api/drawable_descriptor", "${ace_root}/interfaces/napi/kits/drawabledescriptor", "${graphic_2d_path}/utils/color_manager/export", "${ace_root}/frameworks/core/interfaces/native/svg", ] include_dirs += drawable_native_include sources = [ "drawable_descriptor.cpp", "image_converter.cpp", "js_drawable_descriptor.cpp", ] if (use_clang_android) { defines = image_decode_android_defines } if (use_clang_ios) { defines = image_decode_ios_defines } if (ace_enable_gpu) { defines += [ "RS_ENABLE_GPU" ] } } } else { ohos_shared_library("drawable_descriptor") { if (current_os == "ohos") { sanitize = { integer_overflow = true boundary_sanitize = true debug = ace_sanitize_debug } } public_configs = [ ":drawable_config" ] branch_protector_ret = "pac_ret" configs = [ "$ace_root:ace_config", "$ace_root:ace_coverage_config", ] sources = [ "drawable_descriptor.cpp", "image_converter.cpp", "js_drawable_descriptor.cpp", ] defines = [] external_deps = [ "cJSON:cjson", "graphic_2d:librender_service_client", "hilog:libhilog", "napi:ace_napi", ] if (current_os == "ohos") { external_deps += [ "graphic_2d:2d_graphics", "image_framework:image", "resource_management:global_resmgr", ] public_external_deps = [ "graphic_2d:color_manager", "image_framework:image_native", ] } else { defines += [ "PREVIEW" ] if (use_mingw_win) { defines += [ "WINDOWS_PLATFORM" ] external_deps += [ "resource_management:win_resmgr" ] } if (use_mac) { defines += [ "MAC_PLATFORM" ] external_deps += [ "resource_management:mac_resmgr" ] } if (use_linux) { defines += [ "LINUX_PLATFORM" ] external_deps += [ "resource_management:linux_resmgr" ] } } subsystem_name = ace_engine_subsystem innerapi_tags = [ "platformsdk" ] part_name = ace_engine_part } }