summaryrefslogtreecommitdiff
path: root/chromium/third_party/wayland/BUILD.gn
blob: 68e2951688ff5d25835625e55846f473b3632757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/linux/pkg_config.gni")
import("//third_party/wayland/features.gni")

if (!use_system_libwayland) {
  config("wayland_config") {
    include_dirs = [
      "include/src",
      "include/protocol",
      "src/src",
    ]

    # TODO(thomasanderson): Remove this once
    # https://patchwork.freedesktop.org/patch/242086/ lands.
    cflags = [ "-Wno-macro-redefined" ]
  }

  static_library("wayland_util") {
    sources = [
      "src/src/wayland-util.c",
      "src/src/wayland-util.h",
    ]

    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [ "//build/config/compiler:no_chromium_code" ]

    public_configs = [ ":wayland_config" ]
  }

  static_library("wayland_private") {
    sources = [
      "src/src/connection.c",
      "src/src/wayland-os.c",
      "src/src/wayland-os.h",
      "src/src/wayland-private.h",
    ]

    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [
      "//build/config/compiler:no_chromium_code",
      "//build/config/linux/libffi",
      ":wayland_config",
    ]
  }

  static_library("wayland_protocol") {
    sources = [ "protocol/wayland-protocol.c" ]

    deps = [ ":wayland_util" ]

    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [ "//build/config/compiler:no_chromium_code" ]

    public_configs = [ ":wayland_config" ]
  }

  static_library("wayland_server") {
    sources = [
      "include/protocol/wayland-server-protocol.h",
      "src/src/event-loop.c",
      "src/src/wayland-server.c",
      "src/src/wayland-shm.c",
    ]

    deps = [
      ":wayland_private",
      ":wayland_protocol",
      ":wayland_util",
    ]

    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [
      "//build/config/compiler:no_chromium_code",
      "//build/config/linux/libffi",
    ]

    public_configs = [ ":wayland_config" ]
  }

  static_library("wayland_client") {
    sources = [
      "include/protocol/wayland-client-protocol.h",
      "src/src/wayland-client.c",
    ]

    deps = [
      ":wayland_private",
      ":wayland_protocol",
      ":wayland_util",
    ]

    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [
      "//build/config/compiler:no_chromium_code",
      "//build/config/linux/libffi",
    ]

    public_configs = [ ":wayland_config" ]
  }

  config("wayland_scanner_config") {
    cflags = [
      "-Wno-int-conversion",
      "-Wno-implicit-function-declaration",
    ]

    include_dirs = [ "include/" ]
  }

  executable("wayland_scanner") {
    sources = [ "src/src/scanner.c" ]

    deps = [
      ":wayland_util",
      "//third_party/expat:expat",
    ]

    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [
      "//build/config/compiler:no_chromium_code",
      "//build/config/linux/libffi",
      ":wayland_scanner_config",
    ]
  }
}

if (use_system_libwayland) {
  pkg_config("wayland_client_config") {
    packages = [ "wayland-client" ]
  }

  pkg_config("wayland_server_config") {
    packages = [ "wayland-server" ]
  }

  group("wayland_client") {
    public_configs = [ ":wayland_client_config" ]
  }

  group("wayland_server") {
    public_configs = [ ":wayland_server_config" ]
  }

  group("wayland_util") {
    public_configs = [ ":wayland_client_config" ]
  }
}