# 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/ability/ability_runtime/ability_runtime.gni") config("runtime_config") { visibility = [ ":*" ] defines = [ "AMS_LOG_TAG = \"Runtime\"" ] defines += [ "AMS_LOG_DOMAIN = 0xD001309" ] if (target_cpu == "arm64") { defines += [ "_ARM64_" ] } if (target_cpu == "arm64") { defines += [ "APP_USE_ARM64" ] } else if (target_cpu == "arm") { defines += [ "APP_USE_ARM" ] } else if (target_cpu == "x86_64") { defines += [ "APP_USE_X86_64" ] } include_dirs = [] } config("runtime_public_config") { visibility = [ ":*" ] include_dirs = [ "${ability_runtime_path}/interfaces/kits/native/ability/native/ability_business_error", "include", ] } config("runtime_all_deps_config") { include_dirs = [ "include" ] } ohos_shared_library("runtime") { branch_protector_ret = "pac_ret" include_dirs = [ "${ability_runtime_path}/services/abilitymgr/include", "${ability_runtime_path}/interfaces/kits/native/appkit/ability_bundle_manager_helper", "${ability_runtime_utils_path}/global/constant", ] sources = [ "${ability_runtime_native_path}/appkit/ability_bundle_manager_helper/bundle_mgr_helper.cpp", "${ability_runtime_native_path}/runtime/connect_server_manager.cpp", "${ability_runtime_native_path}/runtime/hdc_register.cpp", "${ability_runtime_native_path}/runtime/js_data_struct_converter.cpp", "${ability_runtime_native_path}/runtime/js_error_utils.cpp", "${ability_runtime_native_path}/runtime/js_module_reader.cpp", "${ability_runtime_native_path}/runtime/js_module_searcher.cpp", "${ability_runtime_native_path}/runtime/js_quickfix_callback.cpp", "${ability_runtime_native_path}/runtime/js_runtime.cpp", "${ability_runtime_native_path}/runtime/js_runtime_lite.cpp", "${ability_runtime_native_path}/runtime/js_runtime_utils.cpp", "${ability_runtime_native_path}/runtime/js_worker.cpp", "${ability_runtime_native_path}/runtime/ohos_js_env_logger.cpp", "${ability_runtime_native_path}/runtime/ohos_js_environment_impl.cpp", "${ability_runtime_native_path}/runtime/ohos_loop_handler.cpp", "${ability_runtime_native_path}/runtime/runtime.cpp", ] configs = [ ":runtime_config" ] public_configs = [ ":runtime_public_config", "${ability_runtime_services_path}/common:common_config", ] all_dependent_configs = [ ":runtime_all_deps_config" ] deps = [ "${ability_runtime_native_path}/ability/native:ability_business_error", "${ability_runtime_native_path}/appkit:appkit_manager_helper", "${ability_runtime_path}/js_environment/frameworks/js_environment:js_environment", ] external_deps = [ "ability_base:configuration", "ability_base:extractortool", "ability_base:extractresourcemanager", "ability_base:string_utils", "ability_base:want", "access_token:libaccesstoken_sdk", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "bundle_framework:bundle_napi_common", "bundle_framework:libappexecfwk_common", "c_utils:utils", "config_policy:configpolicy_util", "ets_runtime:libark_jsruntime", "ets_utils:console", "ets_utils:timer", "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hitrace:hitrace_meter", "init:syscap_ts", "ipc:ipc_core", "json:nlohmann_json_static", "jsoncpp:jsoncpp", "napi:ace_napi", "resource_management:global_resmgr", "samgr:samgr_proxy", "zlib:shared_libz", ] defines = [] if (cj_frontend) { sources += [ "${ability_runtime_native_path}/runtime/cj_runtime.cpp" ] include_dirs += [ "${ability_runtime_path}/cj_environment/interfaces/inner_api" ] defines += [ "CJ_FRONTEND" ] } if (is_standard_system) { defines += [ "ENABLE_HITRACE" ] external_deps += [ "hitrace:libhitracechain", "init:libbegetutil", ] } if (is_emulator) { defines += [ "RUNTIME_EMULATOR" ] } if (ability_runtime_graphics) { external_deps += [ "ace_engine:ace_forward_compatibility", "ace_engine:ace_uicontent", "napi:ace_container_scope", ] defines += [ "SUPPORT_GRAPHICS" ] } innerapi_tags = [ "platformsdk" ] subsystem_name = "ability" part_name = "ability_runtime" }