1# Copyright (c) 2022-2023 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/config/components/ace_engine/ace_gen_obj.gni") 15import("//build/ohos.gni") 16import("//foundation/ability/ability_runtime/ability_runtime.gni") 17 18config("ability_simulator_public_config") { 19 include_dirs = [ "include" ] 20 cflags_cc = [ "-Wno-unused-variable" ] 21} 22 23ohos_shared_library("ability_simulator_inner") { 24 if (is_mingw || is_mac) { 25 if (is_mingw) { 26 defines = [ 27 "WINDOWS_PLATFORM", 28 "NOGDI", 29 ] 30 } 31 32 cflags = [ "-std=c++17" ] 33 34 include_dirs = [ 35 "${ability_runtime_path}/interfaces/kits/native/ability/native/ability_business_error", 36 "${ability_runtime_native_path}/runtime", 37 "${ability_runtime_innerkits_path}/ability_manager/include", 38 "${ability_runtime_innerkits_path}/runtime/include", 39 "${windowmanager_path}/previewer/include", 40 "${windowmanager_path}/previewer/mock", 41 "${windowmanager_path}/previewer/mock/transaction", 42 "${windowmanager_path}/previewer/mock/ui", 43 "${windowmanager_path}/interfaces/innerkits/wm", 44 "${windowmanager_path}/interfaces/kits/napi/window_runtime/window_stage_napi", 45 "include/bundle_parser", 46 ] 47 48 sources = [ 49 "${ability_runtime_native_path}/ability/native/ability_business_error/ability_business_error.cpp", 50 "${ability_runtime_native_path}/runtime/js_module_searcher.cpp", 51 "src/ability_context.cpp", 52 "src/ability_stage_context.cpp", 53 "src/bundle_parser/ability_info.cpp", 54 "src/bundle_parser/application_info.cpp", 55 "src/bundle_parser/bundle_container.cpp", 56 "src/bundle_parser/extension_ability_info.cpp", 57 "src/bundle_parser/hap_module_info.cpp", 58 "src/bundle_parser/inner_bundle_info.cpp", 59 "src/bundle_parser/module_info.cpp", 60 "src/bundle_parser/module_profile.cpp", 61 "src/common_func.cpp", 62 "src/js_ability_context.cpp", 63 "src/js_ability_stage_context.cpp", 64 "src/js_application_context_utils.cpp", 65 "src/js_console_log.cpp", 66 "src/js_context_utils.cpp", 67 "src/js_data_converter.cpp", 68 "src/js_resource_manager_utils.cpp", 69 "src/js_runtime_utils.cpp", 70 "src/js_timer.cpp", 71 "src/resource_manager_addon.cpp", 72 "src/simulator.cpp", 73 ] 74 75 public_configs = [ 76 ":ability_simulator_public_config", 77 "${simulator_path}/common:ability_simulator_common_config", 78 ] 79 80 configs = [ "${windowmanager_path}/previewer:previewer_window_config" ] 81 82 external_deps = [ 83 "ability_base:string_utils", 84 "ets_runtime:libark_jsruntime", 85 "ets_utils:console", 86 "ets_utils:timer", 87 "hilog:libhilog", 88 "json:nlohmann_json_static", 89 "jsoncpp:jsoncpp_static", 90 "napi:ace_napi", 91 "previewer:ide_extension", 92 ] 93 94 if (ability_runtime_graphics) { 95 external_deps += [ 96 "ace_engine:ace_uicontent", 97 "window_manager:previewer_window", 98 "window_manager:previewer_window_napi", 99 ] 100 } 101 102 if (is_mingw) { 103 external_deps += [ "resource_management:win_resmgr" ] 104 } else { 105 external_deps += [ "resource_management:mac_resmgr" ] 106 } 107 } 108 109 output_name = "ability_simulator" 110 innerapi_tags = [ "platformsdk" ] 111 part_name = "ability_runtime" 112 subsystem_name = "ability" 113} 114 115group("ability_simulator") { 116 if (is_mingw || is_mac) { 117 public_deps = [ ":ability_simulator_inner" ] 118 } 119} 120