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 15// Build and use the "wayland_protocol_codegen" extension. 16bootstrap_go_package { 17 name: "soong-wayland-protocol-codegen", 18 pkgPath: "android/soong/external/wayland-protocol", 19 deps: [ 20 "blueprint", 21 "blueprint-proptools", 22 "soong-android", 23 "soong-genrule", 24 ], 25 srcs: [ 26 "wayland_protocol_codegen.go", 27 ], 28 pluginFor: ["soong_build"], 29} 30 31filegroup { 32 name: "wayland_extension_protocols", 33 srcs: [ 34 "freedesktop.org/**/*.xml", 35 "chromium.org/**/*.xml", 36 ], 37} 38 39// Generate protocol source files used by both client and server 40wayland_protocol_codegen { 41 name: "wayland_extension_protocol_sources", 42 cmd: "$(location wayland_scanner) code < $(in) > $(out)", 43 suffix: ".c", 44 srcs: [":wayland_extension_protocols"], 45 tools: ["wayland_scanner"], 46} 47 48// Generate protocol header files used by the client 49wayland_protocol_codegen { 50 name: "wayland_extension_client_protocol_headers", 51 cmd: "$(location wayland_scanner) client-header < $(in) > $(out)", 52 suffix: "-client-protocol.h", 53 srcs: [":wayland_extension_protocols"], 54 tools: ["wayland_scanner"], 55} 56 57// Generate protocol header files used by the server 58wayland_protocol_codegen { 59 name: "wayland_extension_server_protocol_headers", 60 cmd: "$(location wayland_scanner) server-header < $(in) > $(out)", 61 suffix: "-server-protocol.h", 62 srcs: [":wayland_extension_protocols"], 63 tools: ["wayland_scanner"], 64} 65 66// Generate a library with the protocol files, configured to export the client 67// header files 68cc_library_static { 69 name: "libwayland_extension_client_protocols", 70 vendor_available: true, 71 cflags: [ 72 "-Wall", 73 "-Wextra", 74 "-Werror", 75 "-g", 76 "-fvisibility=hidden" 77 ], 78 static_libs: ["libwayland_client"], 79 generated_sources: ["wayland_extension_protocol_sources"], 80 generated_headers: ["wayland_extension_client_protocol_headers"], 81 export_generated_headers: ["wayland_extension_client_protocol_headers"], 82} 83 84subdirs = ["flinger_headers"] 85