Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 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 | |
Bob Badour | b199086 | 2021-02-12 15:32:10 -0800 | [diff] [blame] | 15 | package { |
| 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 |
| 33 | license { |
| 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 | |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 46 | cc_defaults { |
| 47 | name: "wayland_defaults", |
| 48 | |
| 49 | cflags: [ |
| 50 | "-Wall", |
| 51 | "-Wextra", |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 52 | "-g", |
| 53 | "-Wstrict-prototypes", |
| 54 | "-Wmissing-prototypes", |
| 55 | "-fvisibility=hidden", |
Yi Kong | 8daa00e | 2018-01-11 02:13:30 -0800 | [diff] [blame] | 56 | "-Wno-cast-qual", |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 57 | "-Wno-pointer-arith", |
Yi Kong | 8daa00e | 2018-01-11 02:13:30 -0800 | [diff] [blame] | 58 | "-Wno-unused-parameter", |
Lloyd Pique | b53eb39 | 2021-02-09 11:16:44 -0800 | [diff] [blame] | 59 | "-Wno-unused-variable", |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 60 | ], |
| 61 | } |
| 62 | |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 63 | filegroup { |
| 64 | name: "wayland_core_protocol", |
| 65 | srcs: [ |
| 66 | "protocol/wayland.xml", |
| 67 | ], |
| 68 | } |
| 69 | |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 70 | // Build wayland_scanner, used to generate code |
| 71 | cc_binary_host { |
| 72 | name: "wayland_scanner", |
| 73 | defaults: ["wayland_defaults"], |
Lloyd Pique | fe6a8ac | 2020-03-05 14:16:54 -0800 | [diff] [blame] | 74 | srcs: [ |
| 75 | "src/scanner.c", |
| 76 | "src/wayland-util.c", |
| 77 | ], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 78 | static_libs: ["libexpat"], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 81 | // Generate protocol source files used by both client and server (static) |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 82 | genrule { |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 83 | name: "wayland_core_protocol_sources_static", |
Lloyd Pique | 049d87c | 2021-01-26 19:07:58 -0800 | [diff] [blame] | 84 | cmd: "$(location wayland_scanner) -s private-code < $(in) > $(out)", |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 85 | srcs: [":wayland_core_protocol"], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 86 | out: ["wayland-protocol.c"], |
| 87 | tools: ["wayland_scanner"], |
| 88 | } |
| 89 | |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 90 | // Generate protocol source files used by both client and server (shared) |
| 91 | genrule { |
| 92 | name: "wayland_core_protocol_sources_shared", |
Lloyd Pique | 049d87c | 2021-01-26 19:07:58 -0800 | [diff] [blame] | 93 | cmd: "$(location wayland_scanner) -s public-code < $(in) > $(out)", |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 94 | srcs: [":wayland_core_protocol"], |
| 95 | out: ["wayland-protocol.c"], |
| 96 | tools: ["wayland_scanner"], |
| 97 | } |
| 98 | |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 99 | // Generate protocol header files used by the client |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 100 | genrule { |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 101 | name: "wayland_core_client_protocol_headers", |
Lloyd Pique | 049d87c | 2021-01-26 19:07:58 -0800 | [diff] [blame] | 102 | cmd: "$(location wayland_scanner) -s client-header < $(in) > $(out)", |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 103 | srcs: [":wayland_core_protocol"], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 104 | out: ["wayland-client-protocol.h"], |
| 105 | tools: ["wayland_scanner"], |
| 106 | } |
| 107 | |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 108 | // Generate protocol header files used by the server |
| 109 | genrule { |
| 110 | name: "wayland_core_server_protocol_headers", |
Lloyd Pique | 049d87c | 2021-01-26 19:07:58 -0800 | [diff] [blame] | 111 | cmd: "$(location wayland_scanner) -s server-header < $(in) > $(out)", |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 112 | srcs: [":wayland_core_protocol"], |
| 113 | out: ["wayland-server-protocol.h"], |
| 114 | tools: ["wayland_scanner"], |
| 115 | } |
| 116 | |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 117 | // Build wayland_client |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 118 | cc_defaults { |
| 119 | name: "libwayland_client_defaults", |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 120 | defaults: ["wayland_defaults"], |
| 121 | srcs: [ |
Lloyd Pique | fe6a8ac | 2020-03-05 14:16:54 -0800 | [diff] [blame] | 122 | "src/connection.c", |
| 123 | "src/wayland-client.c", |
| 124 | "src/wayland-os.c", |
| 125 | "src/wayland-util.c", |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 126 | ], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 127 | static_libs: ["libffi"], |
| 128 | local_include_dirs: ["src"], |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 129 | generated_headers: [ |
Lloyd Pique | fe6a8ac | 2020-03-05 14:16:54 -0800 | [diff] [blame] | 130 | "wayland_core_client_protocol_headers", |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 131 | ], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 132 | export_include_dirs: ["src"], |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 133 | export_generated_headers: [ |
Lloyd Pique | fe6a8ac | 2020-03-05 14:16:54 -0800 | [diff] [blame] | 134 | "wayland_core_client_protocol_headers", |
Lloyd Pique | a107f04 | 2017-12-04 19:10:39 -0800 | [diff] [blame] | 135 | ], |
Garfield Tan | 64bee92 | 2017-10-11 14:19:38 -0700 | [diff] [blame] | 136 | } |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 137 | cc_library_static { |
| 138 | name: "libwayland_client_static", |
| 139 | vendor_available: true, |
| 140 | defaults: ["libwayland_client_defaults"], |
| 141 | generated_sources: ["wayland_core_protocol_sources_static"], |
Jiyong Park | 657f503 | 2020-12-07 15:10:27 +0900 | [diff] [blame] | 142 | apex_available: [ |
| 143 | "//apex_available:platform", |
| 144 | "com.android.virt", |
| 145 | ], |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 146 | } |
| 147 | cc_library_host_shared { |
| 148 | name: "libwayland_client", |
| 149 | defaults: ["libwayland_client_defaults"], |
| 150 | generated_sources: ["wayland_core_protocol_sources_shared"], |
| 151 | target: { |
| 152 | linux_glibc_x86: { |
| 153 | // libffi broken on x86, see b/162610242 |
| 154 | enabled: false, |
| 155 | }, |
| 156 | }, |
| 157 | } |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 158 | |
| 159 | // Build wayland_server |
| 160 | cc_library_static { |
| 161 | name: "libwayland_server", |
| 162 | vendor_available: true, |
Jason Macnak | e5b8a15 | 2019-11-20 14:47:09 -0800 | [diff] [blame] | 163 | host_supported: true, |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 164 | defaults: ["wayland_defaults"], |
| 165 | srcs: [ |
| 166 | "src/connection.c", |
| 167 | "src/wayland-os.c", |
| 168 | "src/wayland-util.c", |
| 169 | "src/wayland-server.c", |
| 170 | "src/wayland-shm.c", |
| 171 | "src/event-loop.c", |
| 172 | ], |
Alistair Delva | a96d722 | 2020-07-31 14:58:28 -0700 | [diff] [blame] | 173 | generated_sources: ["wayland_core_protocol_sources_static"], |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 174 | static_libs: ["libffi"], |
| 175 | local_include_dirs: ["src"], |
| 176 | generated_headers: [ |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 177 | "wayland_core_server_protocol_headers", |
| 178 | ], |
| 179 | export_include_dirs: ["src"], |
| 180 | export_generated_headers: [ |
Sharif Elcott | 1bdd52b | 2018-07-25 11:51:45 +0900 | [diff] [blame] | 181 | "wayland_core_server_protocol_headers", |
| 182 | ], |
| 183 | } |