mirror of
https://github.com/openharmony/third_party_minimp3.git
synced 2026-07-01 10:05:26 -04:00
!2 add minimp3.c and BUILD.gn
Merge pull request !2 from beszhangtl/master
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
#
|
||||
# Copyright (c) 2020 Huawei Device Co., Ltd.
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
minimp3_sources = [
|
||||
"minimp3.c",
|
||||
]
|
||||
|
||||
if (defined(ohos_lite)) {
|
||||
import("//build/lite/config/component/lite_component.gni")
|
||||
import("//build/lite/ndk/ndk.gni")
|
||||
defines = []
|
||||
|
||||
config("minimp3_config") {
|
||||
include_dirs = [
|
||||
"minimp3",
|
||||
]
|
||||
}
|
||||
|
||||
lite_library("minimp3_shared") {
|
||||
target_type = "shared_library"
|
||||
public_configs = [ ":minimp3_config" ]
|
||||
output_name = "minimp3"
|
||||
sources = minimp3_sources
|
||||
}
|
||||
|
||||
lite_library("minimp3_static") {
|
||||
target_type = "static_library"
|
||||
public_configs = [ ":minimp3_config" ]
|
||||
if (ohos_kernel_type == "liteos_m") {
|
||||
include_dirs = [
|
||||
"//kernel/liteos_m/kal/posix/include",
|
||||
"//kernel/liteos_m/kernel/include",
|
||||
"//kernel/liteos_m/utils",
|
||||
"//third_party/musl/porting/liteos_m/kernel/include/",
|
||||
]
|
||||
}
|
||||
output_name = "minimp3"
|
||||
sources = minimp3_sources
|
||||
}
|
||||
|
||||
group("minimp3") {
|
||||
if (ohos_kernel_type == "liteos_m") {
|
||||
deps = [ ":minimp3_static" ]
|
||||
} else {
|
||||
deps = [ ":minimp3_shared" ]
|
||||
}
|
||||
}
|
||||
|
||||
ndk_lib("minimp3_ndk") {
|
||||
if (ohos_kernel_type == "liteos_m") {
|
||||
lib_extension = ".a"
|
||||
} else {
|
||||
lib_extension = ".so"
|
||||
}
|
||||
deps = [ ":minimp3" ]
|
||||
head_files = [ "include" ]
|
||||
}
|
||||
} else {
|
||||
import("//build/ohos.gni")
|
||||
config("minimp3_config") {
|
||||
include_dirs = [
|
||||
"minimp3",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_shared_library("minimp3_shared") {
|
||||
public_configs = [ ":minimp3_config" ]
|
||||
output_name = "minimp3"
|
||||
subsystem_name = "common"
|
||||
part_name = "dsoftbus_standard"
|
||||
sources = minimp3_sources
|
||||
}
|
||||
|
||||
group("minimp3") {
|
||||
deps = [ ":minimp3_shared" ]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user