xref: /aosp_15_r20/external/angle/build/config/linux/libdrm/BUILD.gn (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker# Copyright 2018 The Chromium Authors
2*8975f5c5SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
3*8975f5c5SAndroid Build Coastguard Worker# found in the LICENSE file.
4*8975f5c5SAndroid Build Coastguard Workerimport("//build/config/cast.gni")
5*8975f5c5SAndroid Build Coastguard Workerimport("//build/config/chromeos/args.gni")
6*8975f5c5SAndroid Build Coastguard Workerimport("//build/config/linux/pkg_config.gni")
7*8975f5c5SAndroid Build Coastguard Worker
8*8975f5c5SAndroid Build Coastguard Workerassert(is_linux || is_chromeos)
9*8975f5c5SAndroid Build Coastguard Worker
10*8975f5c5SAndroid Build Coastguard Workerdeclare_args() {
11*8975f5c5SAndroid Build Coastguard Worker  # Controls whether the build should use the version of libdrm library shipped
12*8975f5c5SAndroid Build Coastguard Worker  # with the system. In release builds of Chrome OS we use the system version.
13*8975f5c5SAndroid Build Coastguard Worker  # Some Chromecast devices use this as well.
14*8975f5c5SAndroid Build Coastguard Worker  use_system_libdrm = is_chromeos_device
15*8975f5c5SAndroid Build Coastguard Worker}
16*8975f5c5SAndroid Build Coastguard Worker
17*8975f5c5SAndroid Build Coastguard Workerif (use_system_libdrm) {
18*8975f5c5SAndroid Build Coastguard Worker  assert(!is_linux, "System libdrm is not supported in linux")
19*8975f5c5SAndroid Build Coastguard Worker  pkg_config("libdrm_config") {
20*8975f5c5SAndroid Build Coastguard Worker    packages = [ "libdrm" ]
21*8975f5c5SAndroid Build Coastguard Worker  }
22*8975f5c5SAndroid Build Coastguard Worker  group("libdrm") {
23*8975f5c5SAndroid Build Coastguard Worker    public_configs = [ ":libdrm_config" ]
24*8975f5c5SAndroid Build Coastguard Worker  }
25*8975f5c5SAndroid Build Coastguard Worker} else {
26*8975f5c5SAndroid Build Coastguard Worker  group("libdrm") {
27*8975f5c5SAndroid Build Coastguard Worker    public_deps = [ "//third_party/libdrm" ]
28*8975f5c5SAndroid Build Coastguard Worker  }
29*8975f5c5SAndroid Build Coastguard Worker  config("libdrm_exynos_include_config") {
30*8975f5c5SAndroid Build Coastguard Worker    include_dirs = [ "//third_party/libdrm/src/exynos" ]
31*8975f5c5SAndroid Build Coastguard Worker  }
32*8975f5c5SAndroid Build Coastguard Worker}
33