blob: 38774f3b074f2a6bf826121c15aa3863ad88289e [file] [log] [blame]
Garfield Tan50dd5972017-10-12 12:38:16 -07001// 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
Lloyd Pique016680d2017-11-29 17:54:29 -080015// 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"],
Garfield Tan50dd5972017-10-12 12:38:16 -070029}
30
Lloyd Pique016680d2017-11-29 17:54:29 -080031filegroup {
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",
Garfield Tan50dd5972017-10-12 12:38:16 -070042 cmd: "$(location wayland_scanner) code < $(in) > $(out)",
Lloyd Pique016680d2017-11-29 17:54:29 -080043 suffix: ".c",
44 srcs: [":wayland_extension_protocols"],
Garfield Tan50dd5972017-10-12 12:38:16 -070045 tools: ["wayland_scanner"],
46}
47
Lloyd Pique016680d2017-11-29 17:54:29 -080048// 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"],
Garfield Tan50dd5972017-10-12 12:38:16 -070054 tools: ["wayland_scanner"],
Garfield Tan50dd5972017-10-12 12:38:16 -070055}
56
Lloyd Pique016680d2017-11-29 17:54:29 -080057// Generate a library with the protocol files, configured to export the client
58// header files
Garfield Tan50dd5972017-10-12 12:38:16 -070059cc_library_static {
Lloyd Pique016680d2017-11-29 17:54:29 -080060 name: "libwayland_extension_client_protocols",
Ben Linb7442f22018-04-25 10:36:04 -070061 vendor_available: true,
Garfield Tan50dd5972017-10-12 12:38:16 -070062 cflags: [
63 "-Wall",
64 "-Wextra",
Chih-Hung Hsiehae3135a2017-10-30 11:02:33 -070065 "-Werror",
Garfield Tan50dd5972017-10-12 12:38:16 -070066 "-g",
67 "-fvisibility=hidden"
68 ],
69 static_libs: ["libwayland_client"],
Lloyd Pique016680d2017-11-29 17:54:29 -080070 generated_sources: ["wayland_extension_protocol_sources"],
71 generated_headers: ["wayland_extension_client_protocol_headers"],
72 export_generated_headers: ["wayland_extension_client_protocol_headers"],
Garfield Tan50dd5972017-10-12 12:38:16 -070073}
Garfield Tan541e3542017-10-16 16:43:21 -070074
75subdirs = ["flinger_headers"]