1# Copyright (c) 2020-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/test.gni") 15import("//foundation/multimedia/av_codec/config.gni") 16 17MEDIA_ROOT_DIR = "//foundation/multimedia/av_codec/" 18module_output_path = "av_codec/moduletest" 19 20ohos_unittest("muxer_native_module_test") { 21 sanitize = av_codec_test_sanitize 22 module_out_path = module_output_path 23 sources = [ 24 "Common/src/AVMuxerDemo.cpp", 25 "InnerAPI/InnerAVMuxerInterfaceDependCheckTest.cpp", 26 "InnerAPI/InnerAVMuxerParamCheckTest.cpp", 27 "NativeAPI/NativeAVMuxerInterfaceDependCheckTest.cpp", 28 "NativeAPI/NativeAVMuxerNullCheckTest.cpp", 29 "NativeAPI/NativeAVMuxerParamCheckTest.cpp", 30 ] 31 include_dirs = [ 32 "Common/include", 33 "$MEDIA_ROOT_DIR/interfaces/kits/c", 34 "$MEDIA_ROOT_DIR/interfaces/inner_api/native", 35 "$MEDIA_ROOT_DIR/services/utils", 36 ] 37 38 cflags = [ 39 "-Wall", 40 "-fno-rtti", 41 "-fno-exceptions", 42 "-fno-common", 43 "-fstack-protector-strong", 44 "-Wshadow", 45 "-FPIC", 46 "-FS", 47 "-O2", 48 "-D_FORTIFY_SOURCE=2", 49 "-fvisibility=hidden", 50 "-Wformat=2", 51 "-Wdate-time", 52 "-Werror", 53 "-Wextra", 54 "-Wimplicit-fallthrough", 55 "-Wsign-compare", 56 "-Wunused-parameter", 57 "-Wno-deprecated-declarations", 58 ] 59 60 cflags_cc = cflags 61 cflags_cc += [ "-std=c++17" ] 62 63 if (target_cpu == "arm64" || is_emulator) { 64 av_codec_path = "\"/system/lib64\"" 65 } else { 66 av_codec_path = "\"/system/lib\"" 67 } 68 defines = [ "AV_CODEC_PATH=${av_codec_path}" ] 69 70 deps = [ 71 "$MEDIA_ROOT_DIR/interfaces/inner_api/native:av_codec_client", 72 "$MEDIA_ROOT_DIR/interfaces/kits/c:capi_packages", 73 ] 74 75 external_deps = [ 76 "c_utils:utils", 77 "graphic_surface:surface", 78 "hilog:libhilog", 79 "media_foundation:media_foundation", 80 "media_foundation:native_media_core", 81 ] 82 83 resource_config_file = 84 "$MEDIA_ROOT_DIR/test/moduletest/resources/ohos_test.xml" 85} 86