1# 2# Copyright (c) 2020 Huawei Device Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16minimp3_sources = [ 17 "minimp3.c", 18] 19 20if (defined(ohos_lite)) { 21 import("//build/lite/config/component/lite_component.gni") 22 import("//build/lite/ndk/ndk.gni") 23 defines = [] 24 25 config("minimp3_config") { 26 include_dirs = [ 27 "minimp3", 28 ] 29 } 30 31 lite_library("minimp3_shared") { 32 target_type = "shared_library" 33 public_configs = [ ":minimp3_config" ] 34 output_name = "minimp3" 35 sources = minimp3_sources 36 } 37 38 lite_library("minimp3_static") { 39 target_type = "static_library" 40 public_configs = [ ":minimp3_config" ] 41 if (ohos_kernel_type == "liteos_m") { 42 include_dirs = [ 43 "//kernel/liteos_m/kal/posix/include", 44 "//kernel/liteos_m/kernel/include", 45 "//kernel/liteos_m/utils", 46 "//third_party/musl/porting/liteos_m/kernel/include/", 47 ] 48 } 49 output_name = "minimp3" 50 sources = minimp3_sources 51 } 52 53 group("minimp3") { 54 if (ohos_kernel_type == "liteos_m") { 55 deps = [ ":minimp3_static" ] 56 } else { 57 deps = [ ":minimp3_shared" ] 58 } 59 } 60 61 ndk_lib("minimp3_ndk") { 62 if (ohos_kernel_type == "liteos_m") { 63 lib_extension = ".a" 64 } else { 65 lib_extension = ".so" 66 } 67 deps = [ ":minimp3" ] 68 head_files = [ "include" ] 69 } 70} else { 71 import("//build/ohos.gni") 72 config("minimp3_config") { 73 include_dirs = [ 74 "minimp3", 75 ] 76 } 77 78 ohos_shared_library("minimp3_shared") { 79 public_configs = [ ":minimp3_config" ] 80 output_name = "minimp3" 81 subsystem_name = "common" 82 part_name = "dsoftbus_standard" 83 sources = minimp3_sources 84 } 85 86 group("minimp3") { 87 deps = [ ":minimp3_shared" ] 88 } 89} 90