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