1# Copyright (C) 2021 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("//foundation/multimedia/player_framework/config.gni") 16 17config("media_service_utils_public_config") { 18 include_dirs = [ "include" ] 19} 20 21ohos_shared_library("media_service_utils") { 22 branch_protector_ret = "pac_ret" 23 install_enable = true 24 25 sanitize = { 26 integer_overflow = true 27 ubsan = true 28 boundary_sanitize = true 29 cfi = true 30 cfi_cross_dso = true 31 debug = false 32 } 33 34 sources = [ 35 "avdatasrcmemory.cpp", 36 "media_dfx.cpp", 37 "media_permission.cpp", 38 "media_utils.cpp", 39 "player_xcollie.cpp", 40 "task_queue.cpp", 41 "time_format_utils.cpp", 42 "uri_helper.cpp", 43 "watchdog.cpp", 44 "xml_parse.cpp", 45 ] 46 47 include_dirs = [ 48 "//foundation/multimedia/player_framework/interfaces/inner_api/native", 49 "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", 50 ] 51 52 defines = [ "MEDIA_OHOS" ] 53 defines += player_framework_defines 54 if (is_emulator) { 55 defines += [ "EMULATOR_ENABLED" ] 56 } 57 if (is_arkui_x) { 58 defines += [ "CROSS_PLATFORM" ] 59 } 60 61 cflags = [ 62 "-std=c++17", 63 "-fno-rtti", 64 "-fno-exceptions", 65 "-Wall", 66 "-fno-common", 67 "-fstack-protector-strong", 68 "-Wshadow", 69 "-FPIC", 70 "-FS", 71 "-O2", 72 "-D_FORTIFY_SOURCE=2", 73 "-fvisibility=hidden", 74 "-Wformat=2", 75 "-Wfloat-equal", 76 "-Wdate-time", 77 "-Werror", 78 "-Wextra", 79 "-Wimplicit-fallthrough", 80 "-Wsign-compare", 81 "-Wunused-parameter", 82 ] 83 84 configs = [ ":media_service_utils_public_config" ] 85 86 public_external_deps = [] 87 if (!is_arkui_x) { 88 public_external_deps += [ "json:nlohmann_json_static" ] 89 } 90 91 external_deps = [ 92 "access_token:libaccesstoken_sdk", 93 "access_token:libprivacy_sdk", 94 "av_codec:av_codec_client", 95 "bundle_framework:appexecfwk_base", 96 "bundle_framework:appexecfwk_core", 97 "c_utils:utils", 98 "graphic_surface:surface", 99 "hicollie:libhicollie", 100 "hilog:libhilog", 101 "hisysevent:libhisysevent", 102 "hitrace:hitrace_meter", 103 "hitrace:libhitracechain", 104 "init:libbegetutil", 105 "ipc:ipc_single", 106 "libxml2:libxml2", 107 "media_foundation:media_foundation", 108 "os_account:os_account_innerkits", 109 "qos_manager:qos", 110 "samgr:samgr_proxy", 111 ] 112 113 subsystem_name = "multimedia" 114 innerapi_tags = [ "platformsdk" ] 115 part_name = "player_framework" 116} 117