• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-2025 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/ohos.gni")
15import("//foundation/graphic/graphic_surface/graphic_surface_config.gni")
16
17## Build sync_fence.so {{{
18config("sync_fence_config") {
19  visibility = [
20    ":sync_fence",
21    ":sync_fence_static",
22  ]
23
24  cflags = [
25    "-Wall",
26    "-Werror",
27    "-g3",
28    "-Wno-error=missing-braces",
29    "-Wno-error=#warnings",
30  ]
31  defines = rs_common_define
32}
33
34config("sync_fence_public_config") {
35  include_dirs = [
36    "include",
37    "//foundation/graphic/graphic_surface/interfaces/inner_api/utils",
38  ]
39}
40
41ohos_shared_library("sync_fence") {
42  deps = [ ":sync_fence_static" ]
43  sanitize = {
44    boundary_sanitize = true
45    integer_overflow = true
46    ubsan = true
47  }
48
49  public_configs = [ ":sync_fence_public_config" ]
50
51  external_deps = [
52    "c_utils:utils",
53    "eventhandler:libeventhandler",
54    "hilog:libhilog",
55    "hisysevent:libhisysevent",
56    "hitrace:hitrace_meter",
57    "init:libbegetutil",
58    "ipc:ipc_single",
59  ]
60
61  symlink_target_name = [ "libnative_fence.so" ]
62
63  innerapi_tags = [
64    "chipsetsdk_sp",
65    "platformsdk_indirect",
66    "ndk",
67  ]
68  part_name = "graphic_surface"
69  subsystem_name = "graphic"
70}
71
72ohos_static_library("sync_fence_static") {
73  sources = [
74    "src/acquire_fence_manager.cpp",
75    "src/frame_sched.cpp",
76    "src/native_fence.cpp",
77    "src/sync_fence.cpp",
78    "src/sync_fence_tracker.cpp",
79  ]
80
81  configs = [ ":sync_fence_config" ]
82
83  public_configs = [ ":sync_fence_public_config" ]
84
85  external_deps = [
86    "c_utils:utils",
87    "eventhandler:libeventhandler",
88    "hilog:libhilog",
89    "hisysevent:libhisysevent",
90    "hitrace:hitrace_meter",
91    "init:libbegetutil",
92    "ipc:ipc_single",
93  ]
94
95  if (!is_emulator && !build_ohos_sdk && current_os == "ohos") {
96    defines = [ "FENCE_SCHED_ENABLE" ]
97  }
98
99  part_name = "graphic_surface"
100  subsystem_name = "graphic"
101}
102## Build sync_fence.so }}}
103