1d722e3fbSopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd.
2d722e3fbSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3d722e3fbSopenharmony_ci# you may not use this file except in compliance with the License.
4d722e3fbSopenharmony_ci# You may obtain a copy of the License at
5d722e3fbSopenharmony_ci#
6d722e3fbSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7d722e3fbSopenharmony_ci#
8d722e3fbSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9d722e3fbSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10d722e3fbSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11d722e3fbSopenharmony_ci# See the License for the specific language governing permissions and
12d722e3fbSopenharmony_ci# limitations under the License.
13d722e3fbSopenharmony_ci
14d722e3fbSopenharmony_ciimport("//build/ohos.gni")
15d722e3fbSopenharmony_ci
16d722e3fbSopenharmony_ci## Build libdrm.so {{{
17d722e3fbSopenharmony_ciconfig("libdrm_config") {
18d722e3fbSopenharmony_ci  visibility = [ ":*" ]
19d722e3fbSopenharmony_ci
20d722e3fbSopenharmony_ci  include_dirs = []
21d722e3fbSopenharmony_ci
22d722e3fbSopenharmony_ci  cflags = [
23d722e3fbSopenharmony_ci    "-Wno-deprecated-declarations",
24d722e3fbSopenharmony_ci    "-Wno-enum-conversion",
25d722e3fbSopenharmony_ci    "-DMAJOR_IN_SYSMACROS=1",
26d722e3fbSopenharmony_ci  ]
27d722e3fbSopenharmony_ci}
28d722e3fbSopenharmony_ci
29d722e3fbSopenharmony_ciconfig("libdrm_public_config") {
30d722e3fbSopenharmony_ci  include_dirs = [
31d722e3fbSopenharmony_ci    ".",
32d722e3fbSopenharmony_ci    "include",
33d722e3fbSopenharmony_ci    "include/drm",
34d722e3fbSopenharmony_ci  ]
35d722e3fbSopenharmony_ci
36d722e3fbSopenharmony_ci  cflags = []
37d722e3fbSopenharmony_ci}
38d722e3fbSopenharmony_ci
39d722e3fbSopenharmony_ciohos_shared_library("libdrm") {
40d722e3fbSopenharmony_ci  output_prefix_override = true
41d722e3fbSopenharmony_ci  output_name = "libdrm"
42d722e3fbSopenharmony_ci  output_extension = "so"
43d722e3fbSopenharmony_ci
44d722e3fbSopenharmony_ci  sources = [
45d722e3fbSopenharmony_ci    "xf86drm.c",
46d722e3fbSopenharmony_ci    "xf86drmHash.c",
47d722e3fbSopenharmony_ci    "xf86drmMode.c",
48d722e3fbSopenharmony_ci    "xf86drmRandom.c",
49d722e3fbSopenharmony_ci  ]
50d722e3fbSopenharmony_ci
51d722e3fbSopenharmony_ci  configs = [ ":libdrm_config" ]
52d722e3fbSopenharmony_ci
53d722e3fbSopenharmony_ci  public_configs = [ ":libdrm_public_config" ]
54d722e3fbSopenharmony_ci
55d722e3fbSopenharmony_ci  deps = []
56d722e3fbSopenharmony_ci
57d722e3fbSopenharmony_ci  public_deps = []
58d722e3fbSopenharmony_ci  install_images = [
59d722e3fbSopenharmony_ci    "system",
60d722e3fbSopenharmony_ci    "updater",
61d722e3fbSopenharmony_ci  ]
62d722e3fbSopenharmony_ci  innerapi_tags = [ "chipsetsdk" ]
63d722e3fbSopenharmony_ci  part_name = "libdrm"
64d722e3fbSopenharmony_ci  subsystem_name = "thirdparty"
65d722e3fbSopenharmony_ci}
66d722e3fbSopenharmony_ci## Build libdrm.so }}}
67