1# Copyright (c) 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/ohos.gni") 15import("../../intell_voice_service.gni") 16 17ohos_source_set("server_source") { 18 configs = [ "//build/config/compiler:exceptions" ] 19 20 sources = [ 21 "server/sa/intell_voice_engine_registrar.cpp", 22 "server/sa/intell_voice_service.cpp", 23 "server/sa/intell_voice_service_manager.cpp", 24 "server/sa/intell_voice_service_stub.cpp", 25 "server/sa/intell_voice_trigger_registrar.cpp", 26 "server/utils/switch_observer.cpp", 27 "server/utils/switch_provider.cpp", 28 "server/utils/system_event_observer.cpp", 29 ] 30 31 include_dirs = [ 32 "inc", 33 "../../../../ai/intelligent_voice_framework/utils", 34 "../../../../ai/intelligent_voice_framework/interfaces/inner_api/native", 35 "server/sa", 36 "server/utils", 37 "../intell_voice_engine/inc", 38 "../intell_voice_trigger/inc", 39 ] 40 41 cflags_cc = [ 42 "-Wno-error=unused-parameter", 43 "-DHILOG_ENABLE", 44 "-DENABLE_DEBUG", 45 "-DUSE_FFRT", 46 ] 47 48 defines = [] 49 if (build_variant == "root") { 50 defines += [ "INTELL_VOICE_BUILD_VARIANT_ROOT" ] 51 } 52 53 deps = [ "../../utils:intell_voice_utils" ] 54 55 external_deps = [ 56 "ability_runtime:ability_manager", 57 "access_token:libaccesstoken_sdk", 58 "c_utils:utils", 59 "common_event_service:cesfwk_innerkits", 60 "data_share:datashare_consumer", 61 "eventhandler:libeventhandler", 62 "ffrt:libffrt", 63 "hilog:libhilog", 64 "image_framework:image_native", 65 "ipc:ipc_core", 66 "kv_store:distributeddata_inner", 67 "safwk:system_ability_fwk", 68 "samgr:samgr_proxy" 69 ] 70 71 sanitize = { 72 cfi = true 73 cfi_cross_dso = true 74 cfi_vcall_icall_only = true 75 debug = false 76 } 77 78 branch_protector_ret = "pac_ret" 79 80 if (intelligent_voice_framework_power_manager_enable) { 81 defines += [ "POWER_MANAGER_ENABLE" ] 82 } 83 84 if (intelligent_voice_framework_trigger_enable) { 85 cflags_cc += [ "-DTRIGGER_ENABLE" ] 86 } 87 88 if (intelligent_voice_framework_engine_enable) { 89 cflags_cc += [ "-DENGINE_ENABLE" ] 90 } 91 92 if (intelligent_voice_framework_only_first_stage) { 93 cflags_cc += [ "-DONLY_FIRST_STAGE" ] 94 if (intelligent_voice_framework_first_stage_oneshot_enable) { 95 cflags_cc += [ "-DFIRST_STAGE_ONESHOT_ENABLE" ] 96 } 97 } 98 99 subsystem_name = "ai" 100 part_name = "intelligent_voice_framework" 101} 102 103ohos_shared_library("intell_voice_server") { 104 deps = [ 105 ":server_source", 106 "../intell_voice_engine:intelligentvoice_engine", 107 "../intell_voice_trigger:intelligentvoice_trigger", 108 ] 109 external_deps = [ "hilog:libhilog" ] 110 111 version_script = "libintell_voice_server.versionscript" 112 sanitize = { 113 cfi = true 114 cfi_cross_dso = true 115 cfi_vcall_icall_only = true 116 debug = false 117 } 118 branch_protector_ret = "pac_ret" 119 subsystem_name = "ai" 120 part_name = "intelligent_voice_framework" 121} 122 123ohos_shared_library("intell_voice_server_test") { 124 deps = [ 125 ":server_source", 126 "../intell_voice_engine:intelligentvoice_engine_test", 127 "../intell_voice_trigger:intelligentvoice_trigger_test", 128 ] 129 external_deps = [ "hilog:libhilog" ] 130 sanitize = { 131 cfi = true 132 cfi_cross_dso = true 133 cfi_vcall_icall_only = true 134 debug = false 135 } 136 branch_protector_ret = "pac_ret" 137 subsystem_name = "ai" 138 part_name = "intelligent_voice_framework" 139} 140