1# Copyright (c) 2021-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#
14
15import("//foundation/multimedia/media_foundation/config.gni")
16
17config("histreamer_foundation_config") {
18  include_dirs = [
19    "$histreamer_root_dir/interface/foundation",
20    "$histreamer_root_dir/foundation",
21  ]
22  if (hst_is_lite_sys) {
23    include_dirs += [
24      "$hmultimedia_root_dir/media_utils_lite/interfaces/kits",
25      "$hiviewdfx_root_dir/hilog_lite/interfaces/native/innerkits",
26    ]
27  } else {
28    include_dirs +=
29        [ "$hiviewdfx_root_dir/hilog/interfaces/native/innerkits/include" ]
30  }
31}
32
33if (hst_is_lite_sys) {
34  source_set("histreamer_foundation") {
35    include_dirs = [ "$hiviewdfx_root_dir/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
36    sources = [
37      "osal/filesystem/file_system.cpp",
38      "osal/thread/condition_variable.cpp",
39      "osal/thread/mutex.cpp",
40      "osal/thread/scoped_lock.cpp",
41      "osal/thread/task.cpp",
42      "osal/thread/thread.cpp",
43      "osal/utils/util.cpp",
44      "utils/constants.cpp",
45      "utils/dump_buffer.cpp",
46      "utils/hitrace_utils.cpp",
47      "utils/steady_clock.cpp",
48    ]
49    public_configs = [
50      ":histreamer_foundation_config",
51      "$histreamer_root_dir:histreamer_presets",
52    ]
53    deps = [ "$multimedia_root_dir/media_utils_lite:media_common" ]
54    if (hst_is_mini_sys) {
55      deps +=
56          [ "$hiviewdfx_root_dir/hilog_lite/frameworks/featured:hilog_static" ]
57      public_deps = [ "//third_party/bounds_checking_function:libsec_static" ]
58    } else {
59      deps +=
60          [ "$hiviewdfx_root_dir/hilog_lite/frameworks/featured:hilog_shared" ]
61      public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
62    }
63
64    if (defined(config_ohos_histreamer_stack_size) &&
65        config_ohos_histreamer_stack_size > 0) {
66      defines = [ "THREAD_STACK_SIZE=$config_ohos_histreamer_stack_size" ]
67    }
68  }
69} else {
70  ohos_source_set("histreamer_foundation") {
71    subsystem_name = "multimedia"
72    part_name = "media_foundation"
73    include_dirs = [ "$hiviewdfx_root_dir/hitrace/interfaces/native/innerkits/include/hitrace_meter" ]
74    sources = [
75      "osal/filesystem/file_system.cpp",
76      "osal/thread/condition_variable.cpp",
77      "osal/thread/mutex.cpp",
78      "osal/thread/scoped_lock.cpp",
79      "osal/thread/task.cpp",
80      "osal/thread/thread.cpp",
81      "osal/utils/util.cpp",
82      "utils/constants.cpp",
83      "utils/dump_buffer.cpp",
84      "utils/hitrace_utils.cpp",
85      "utils/steady_clock.cpp",
86    ]
87    public_configs = [
88      ":histreamer_foundation_config",
89      "$histreamer_root_dir:histreamer_presets",
90    ]
91    public_deps = [ "$histreamer_root_dir/plugin:histreamer_plugin_intf" ]
92    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
93    external_deps = [
94      "graphic_surface:surface",
95      "hilog:libhilog",
96      "hitrace:hitrace_meter",
97    ]
98
99    if (defined(config_ohos_histreamer_stack_size) &&
100        config_ohos_histreamer_stack_size > 0) {
101      defines = [ "THREAD_STACK_SIZE=$config_ohos_histreamer_stack_size" ]
102    }
103  }
104}
105