xref: /aosp_15_r20/external/wayland/Android.bp (revision 84e872a0dc482bffdb63672969dd03a827d67c73)
1*84e872a0SLloyd Pique// Copyright (C) 2017 The Android Open Source Project
2*84e872a0SLloyd Pique//
3*84e872a0SLloyd Pique// Licensed under the Apache License, Version 2.0 (the "License");
4*84e872a0SLloyd Pique// you may not use this file except in compliance with the License.
5*84e872a0SLloyd Pique// You may obtain a copy of the License at
6*84e872a0SLloyd Pique//
7*84e872a0SLloyd Pique//      http://www.apache.org/licenses/LICENSE-2.0
8*84e872a0SLloyd Pique//
9*84e872a0SLloyd Pique// Unless required by applicable law or agreed to in writing, software
10*84e872a0SLloyd Pique// distributed under the License is distributed on an "AS IS" BASIS,
11*84e872a0SLloyd Pique// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*84e872a0SLloyd Pique// See the License for the specific language governing permissions and
13*84e872a0SLloyd Pique// limitations under the License.
14*84e872a0SLloyd Pique
15*84e872a0SLloyd Piquepackage {
16*84e872a0SLloyd Pique    default_applicable_licenses: ["external_wayland_license"],
17*84e872a0SLloyd Pique}
18*84e872a0SLloyd Pique
19*84e872a0SLloyd Pique// Added automatically by a large-scale-change that took the approach of
20*84e872a0SLloyd Pique// 'apply every license found to every target'. While this makes sure we respect
21*84e872a0SLloyd Pique// every license restriction, it may not be entirely correct.
22*84e872a0SLloyd Pique//
23*84e872a0SLloyd Pique// e.g. GPL in an MIT project might only apply to the contrib/ directory.
24*84e872a0SLloyd Pique//
25*84e872a0SLloyd Pique// Please consider splitting the single license below into multiple licenses,
26*84e872a0SLloyd Pique// taking care not to lose any license_kind information, and overriding the
27*84e872a0SLloyd Pique// default license using the 'licenses: [...]' property on targets as needed.
28*84e872a0SLloyd Pique//
29*84e872a0SLloyd Pique// For unused files, consider creating a 'fileGroup' with "//visibility:private"
30*84e872a0SLloyd Pique// to attach the license to, and including a comment whether the files may be
31*84e872a0SLloyd Pique// used in the current project.
32*84e872a0SLloyd Pique// See: http://go/android-license-faq
33*84e872a0SLloyd Piquelicense {
34*84e872a0SLloyd Pique    name: "external_wayland_license",
35*84e872a0SLloyd Pique    visibility: [":__subpackages__"],
36*84e872a0SLloyd Pique    license_kinds: [
37*84e872a0SLloyd Pique        "SPDX-license-identifier-Apache-2.0",
38*84e872a0SLloyd Pique        "SPDX-license-identifier-MIT",
39*84e872a0SLloyd Pique        "legacy_unencumbered",
40*84e872a0SLloyd Pique    ],
41*84e872a0SLloyd Pique    license_text: [
42*84e872a0SLloyd Pique        "COPYING",
43*84e872a0SLloyd Pique    ],
44*84e872a0SLloyd Pique}
45*84e872a0SLloyd Pique
46*84e872a0SLloyd Piquecc_defaults {
47*84e872a0SLloyd Pique    name: "wayland_defaults",
48*84e872a0SLloyd Pique
49*84e872a0SLloyd Pique    cflags: [
50*84e872a0SLloyd Pique        "-Wall",
51*84e872a0SLloyd Pique        "-Wextra",
52*84e872a0SLloyd Pique        "-g",
53*84e872a0SLloyd Pique        "-Wstrict-prototypes",
54*84e872a0SLloyd Pique        "-Wmissing-prototypes",
55*84e872a0SLloyd Pique        "-fvisibility=hidden",
56*84e872a0SLloyd Pique        "-Wno-cast-qual",
57*84e872a0SLloyd Pique        "-Wno-pointer-arith",
58*84e872a0SLloyd Pique        "-Wno-unused-parameter",
59*84e872a0SLloyd Pique        "-Wno-unused-variable",
60*84e872a0SLloyd Pique    ],
61*84e872a0SLloyd Pique}
62*84e872a0SLloyd Pique
63*84e872a0SLloyd Piquefilegroup {
64*84e872a0SLloyd Pique    name: "wayland_core_protocol",
65*84e872a0SLloyd Pique    srcs: [
66*84e872a0SLloyd Pique        "protocol/wayland.xml",
67*84e872a0SLloyd Pique    ],
68*84e872a0SLloyd Pique}
69*84e872a0SLloyd Pique
70*84e872a0SLloyd Pique// Build wayland_scanner, used to generate code
71*84e872a0SLloyd Piquecc_binary_host {
72*84e872a0SLloyd Pique    name: "wayland_scanner",
73*84e872a0SLloyd Pique    defaults: ["wayland_defaults"],
74*84e872a0SLloyd Pique    srcs: [
75*84e872a0SLloyd Pique        "src/scanner.c",
76*84e872a0SLloyd Pique        "src/wayland-util.c",
77*84e872a0SLloyd Pique    ],
78*84e872a0SLloyd Pique    static_libs: ["libexpat"],
79*84e872a0SLloyd Pique}
80*84e872a0SLloyd Pique
81*84e872a0SLloyd Pique// Generate protocol source files used by both client and server (static)
82*84e872a0SLloyd Piquegenrule {
83*84e872a0SLloyd Pique    name: "wayland_core_protocol_sources_static",
84*84e872a0SLloyd Pique    cmd: "$(location wayland_scanner) -s private-code < $(in) > $(out)",
85*84e872a0SLloyd Pique    srcs: [":wayland_core_protocol"],
86*84e872a0SLloyd Pique    out: ["wayland-protocol-private.c"],
87*84e872a0SLloyd Pique    tools: ["wayland_scanner"],
88*84e872a0SLloyd Pique}
89*84e872a0SLloyd Pique
90*84e872a0SLloyd Pique// Generate protocol source files used by both client and server (shared)
91*84e872a0SLloyd Piquegenrule {
92*84e872a0SLloyd Pique    name: "wayland_core_protocol_sources_shared",
93*84e872a0SLloyd Pique    cmd: "$(location wayland_scanner) -s public-code < $(in) > $(out)",
94*84e872a0SLloyd Pique    srcs: [":wayland_core_protocol"],
95*84e872a0SLloyd Pique    out: ["wayland-protocol-public.c"],
96*84e872a0SLloyd Pique    tools: ["wayland_scanner"],
97*84e872a0SLloyd Pique}
98*84e872a0SLloyd Pique
99*84e872a0SLloyd Pique// Generate protocol header files used by the client
100*84e872a0SLloyd Piquegenrule {
101*84e872a0SLloyd Pique    name: "wayland_core_client_protocol_headers",
102*84e872a0SLloyd Pique    cmd: "$(location wayland_scanner) -s client-header < $(in) > $(out)",
103*84e872a0SLloyd Pique    srcs: [":wayland_core_protocol"],
104*84e872a0SLloyd Pique    out: ["wayland-client-protocol.h"],
105*84e872a0SLloyd Pique    tools: ["wayland_scanner"],
106*84e872a0SLloyd Pique}
107*84e872a0SLloyd Pique
108*84e872a0SLloyd Pique// Generate protocol header files used by the server
109*84e872a0SLloyd Piquegenrule {
110*84e872a0SLloyd Pique    name: "wayland_core_server_protocol_headers",
111*84e872a0SLloyd Pique    cmd: "$(location wayland_scanner) -s server-header < $(in) > $(out)",
112*84e872a0SLloyd Pique    srcs: [":wayland_core_protocol"],
113*84e872a0SLloyd Pique    out: ["wayland-server-protocol.h"],
114*84e872a0SLloyd Pique    tools: ["wayland_scanner"],
115*84e872a0SLloyd Pique}
116*84e872a0SLloyd Pique
117*84e872a0SLloyd Pique// Build wayland_client
118*84e872a0SLloyd Piquecc_defaults {
119*84e872a0SLloyd Pique    name: "libwayland_client_defaults",
120*84e872a0SLloyd Pique    defaults: ["wayland_defaults"],
121*84e872a0SLloyd Pique    srcs: [
122*84e872a0SLloyd Pique        "src/connection.c",
123*84e872a0SLloyd Pique        "src/wayland-client.c",
124*84e872a0SLloyd Pique        "src/wayland-os.c",
125*84e872a0SLloyd Pique        "src/wayland-util.c",
126*84e872a0SLloyd Pique    ],
127*84e872a0SLloyd Pique    static_libs: ["libffi"],
128*84e872a0SLloyd Pique    local_include_dirs: ["src"],
129*84e872a0SLloyd Pique    generated_headers: [
130*84e872a0SLloyd Pique        "wayland_core_client_protocol_headers",
131*84e872a0SLloyd Pique    ],
132*84e872a0SLloyd Pique    export_include_dirs: ["src", "egl"],
133*84e872a0SLloyd Pique    export_generated_headers: [
134*84e872a0SLloyd Pique        "wayland_core_client_protocol_headers",
135*84e872a0SLloyd Pique    ],
136*84e872a0SLloyd Pique}
137*84e872a0SLloyd Piquecc_library_static {
138*84e872a0SLloyd Pique    name: "libwayland_client_static",
139*84e872a0SLloyd Pique    vendor_available: true,
140*84e872a0SLloyd Pique    defaults: ["libwayland_client_defaults"],
141*84e872a0SLloyd Pique    generated_sources: ["wayland_core_protocol_sources_static"],
142*84e872a0SLloyd Pique    apex_available: [
143*84e872a0SLloyd Pique        "//apex_available:platform",
144*84e872a0SLloyd Pique        "com.android.virt",
145*84e872a0SLloyd Pique    ],
146*84e872a0SLloyd Pique}
147*84e872a0SLloyd Piquecc_library_host_shared {
148*84e872a0SLloyd Pique    name: "libwayland_client",
149*84e872a0SLloyd Pique    defaults: ["libwayland_client_defaults"],
150*84e872a0SLloyd Pique    generated_sources: ["wayland_core_protocol_sources_shared"],
151*84e872a0SLloyd Pique}
152*84e872a0SLloyd Pique
153*84e872a0SLloyd Pique// Build wayland_server
154*84e872a0SLloyd Piquecc_library_static {
155*84e872a0SLloyd Pique    name: "libwayland_server",
156*84e872a0SLloyd Pique    vendor_available: true,
157*84e872a0SLloyd Pique    host_supported: true,
158*84e872a0SLloyd Pique    defaults: ["wayland_defaults"],
159*84e872a0SLloyd Pique    srcs: [
160*84e872a0SLloyd Pique        "src/connection.c",
161*84e872a0SLloyd Pique        "src/wayland-os.c",
162*84e872a0SLloyd Pique        "src/wayland-util.c",
163*84e872a0SLloyd Pique        "src/wayland-server.c",
164*84e872a0SLloyd Pique        "src/wayland-shm.c",
165*84e872a0SLloyd Pique        "src/event-loop.c",
166*84e872a0SLloyd Pique    ],
167*84e872a0SLloyd Pique    generated_sources: ["wayland_core_protocol_sources_static"],
168*84e872a0SLloyd Pique    static_libs: ["libffi"],
169*84e872a0SLloyd Pique    local_include_dirs: ["src"],
170*84e872a0SLloyd Pique    generated_headers: [
171*84e872a0SLloyd Pique        "wayland_core_server_protocol_headers",
172*84e872a0SLloyd Pique    ],
173*84e872a0SLloyd Pique    export_include_dirs: ["src"],
174*84e872a0SLloyd Pique    export_generated_headers: [
175*84e872a0SLloyd Pique        "wayland_core_server_protocol_headers",
176*84e872a0SLloyd Pique    ],
177*84e872a0SLloyd Pique}
178