1# Copyright (c) 2020 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/lite/config/component/lite_component.gni")
15
16lite_library("media_common") {
17  if (ohos_kernel_type == "liteos_m") {
18    target_type = "static_library"
19  } else {
20    target_type = "shared_library"
21  }
22  sources = [
23    "src/format.cpp",
24    "src/source.cpp",
25  ]
26  include_dirs = [
27    "interfaces/kits",
28    "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits/hilog",
29  ]
30  if (ohos_kernel_type == "liteos_m") {
31    public_deps = [ "//third_party/bounds_checking_function:libsec_static" ]
32  } else {
33    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
34  }
35
36  if (ohos_kernel_type == "liteos_m") {
37    public_deps +=
38        [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ]
39    public_configs = [ ":media_common_public_config" ]
40  } else {
41    public_deps += [ "//foundation/graphic/surface_lite:surface_lite" ]
42    if (board_name == "hispark_taurus" || board_name == "hispark_aries") {
43      public_deps += [
44        "$ohos_board_adapter_dir/media:hardware_media_sdk",
45        "$ohos_board_adapter_dir/middleware:middleware_source_sdk",
46      ]
47    }
48  }
49}
50
51config("media_common_public_config") {
52  defines = [ "SURFACE_DISABLED" ]
53}
54