1# Copyright (c) 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
14import("//build/ohos.gni")
15import("//foundation/graphic/graphic_2d/graphic_config.gni")
16import("../render_service_base/config.gni")
17
18## Build libframe_analyzer.so {{{
19config("libframe_analyzer_config") {
20  visibility = [ ":*" ]
21
22  cflags = [
23    "-Wall",
24    "-Werror",
25    "-g3",
26  ]
27
28  if (current_os != "ohos") {
29    cflags += [
30      "-Wno-c++17-extensions",
31      "-Wno-unused-private-field",
32    ]
33  }
34}
35
36config("libframe_analyzer_public_config") {
37  include_dirs = [ "export" ]
38}
39
40ohos_shared_library("libframe_analyzer") {
41  if (current_os == "ohos") {
42    sources = [
43      "src/frame_collector.cpp",
44      "src/frame_painter.cpp",
45      "src/frame_saver.cpp",
46    ]
47
48    include_dirs = [ "$graphic_2d_root/utils/sandbox" ]
49
50    deps = [ "../../../utils/sandbox:sandbox_utils" ]
51
52    external_deps = [
53      "c_utils:utils",
54      "hilog:libhilog",
55      "hitrace:hitrace_meter",
56      "init:libbeget_proxy",
57      "init:libbegetutil",
58      "skia:skia_canvaskit",
59    ]
60  } else {
61    sources = [
62      "src/mingw/frame_collector.cpp",
63      "src/mingw/frame_painter.cpp",
64    ]
65  }
66
67  if (defined(use_rosen_drawing) && use_rosen_drawing) {
68    defines = [ "USE_ROSEN_DRAWING" ]
69    deps += [ "$rosen_root/modules/2d_graphics:2d_graphics" ]
70  }
71
72  configs = [ ":libframe_analyzer_config" ]
73
74  public_configs = [ ":libframe_analyzer_public_config" ]
75
76  subsystem_name = "graphic"
77  part_name = "graphic_2d"
78}
79## Build libframe_analyzer.so }}}
80