1// 2// Copyright (C) 2018 The Android Open Source Project 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17genrule { 18 name: "glesv1_dec_cuttlefish_gensrc", 19 srcs: ["GLESv1_dec/*"], 20 tools: ["emugen_cuttlefish"], 21 cmd: "$(location emugen_cuttlefish) " + 22 "-i device/generic/opengl-transport/host/libs/virglrenderer/GLESv1_dec " + 23 "-D $(genDir) gles1", 24 out: ["gles1_dec.cpp"], 25} 26 27genrule { 28 name: "glesv1_dec_cuttlefish_genhdr", 29 srcs: ["GLESv1_dec/*"], 30 tools: ["emugen_cuttlefish"], 31 cmd: "$(location emugen_cuttlefish) " + 32 "-i device/generic/opengl-transport/host/libs/virglrenderer/GLESv1_dec " + 33 "-D $(genDir) gles1", 34 out: [ 35 "gles1_dec.h", 36 "gles1_opcodes.h", 37 "gles1_server_context.h", 38 "gles1_server_proc.h", 39 ], 40} 41 42genrule { 43 name: "glesv3_dec_cuttlefish_gensrc", 44 srcs: ["GLESv3_dec/*"], 45 tools: ["emugen_cuttlefish"], 46 cmd: "$(location emugen_cuttlefish) " + 47 "-i device/generic/opengl-transport/host/libs/virglrenderer/GLESv3_dec " + 48 "-D $(genDir) gles3", 49 out: ["gles3_dec.cpp"], 50} 51 52genrule { 53 name: "glesv3_dec_cuttlefish_genhdr", 54 srcs: ["GLESv3_dec/*"], 55 tools: ["emugen_cuttlefish"], 56 cmd: "$(location emugen_cuttlefish) " + 57 "-i device/generic/opengl-transport/host/libs/virglrenderer/GLESv3_dec " + 58 "-D $(genDir) gles3", 59 out: [ 60 "gles3_dec.h", 61 "gles3_opcodes.h", 62 "gles3_server_context.h", 63 "gles3_server_proc.h", 64 ], 65} 66 67genrule { 68 name: "rendercontrol_dec_cuttlefish_gensrc", 69 srcs: ["renderControl_dec/*"], 70 tools: ["emugen_cuttlefish"], 71 cmd: "$(location emugen_cuttlefish) " + 72 "-i device/generic/opengl-transport/host/libs/virglrenderer/renderControl_dec " + 73 "-D $(genDir) renderControl", 74 out: ["renderControl_dec.cpp"], 75} 76 77genrule { 78 name: "rendercontrol_dec_cuttlefish_genhdr", 79 srcs: ["renderControl_dec/*"], 80 tools: ["emugen_cuttlefish"], 81 cmd: "$(location emugen_cuttlefish) " + 82 "-i device/generic/opengl-transport/host/libs/virglrenderer/renderControl_dec " + 83 "-D $(genDir) renderControl", 84 out: [ 85 "renderControl_dec.h", 86 "renderControl_opcodes.h", 87 "renderControl_server_context.h", 88 "renderControl_server_proc.h", 89 ], 90} 91 92genrule { 93 name: "gles1_core_functions_hdr", 94 tool_files: ["gen_entries.py"], 95 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 96 srcs: ["OpenGLESDispatch/gles1_core.entries"], 97 out: ["gles1_core_functions.h"], 98} 99 100genrule { 101 name: "gles1_extensions_functions_hdr", 102 tool_files: ["gen_entries.py"], 103 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 104 srcs: ["OpenGLESDispatch/gles1_extensions.entries"], 105 out: ["gles1_extensions_functions.h"], 106} 107 108genrule { 109 name: "egl_functions_hdr", 110 tool_files: ["gen_entries.py"], 111 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 112 srcs: ["OpenGLESDispatch/egl.entries"], 113 out: ["egl_functions.h"], 114} 115 116genrule { 117 name: "gles3_only_functions_hdr", 118 tool_files: ["gen_entries.py"], 119 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 120 srcs: ["OpenGLESDispatch/gles3_only.entries"], 121 out: ["gles3_only_functions.h"], 122} 123 124genrule { 125 name: "gles31_only_functions_hdr", 126 tool_files: ["gen_entries.py"], 127 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 128 srcs: ["OpenGLESDispatch/gles31_only.entries"], 129 out: ["gles31_only_functions.h"], 130} 131 132genrule { 133 name: "gles2_extensions_functions_hdr", 134 tool_files: ["gen_entries.py"], 135 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 136 srcs: ["OpenGLESDispatch/gles2_extensions.entries"], 137 out: ["gles2_extensions_functions.h"], 138} 139 140genrule { 141 name: "egl_extensions_functions_hdr", 142 tool_files: ["gen_entries.py"], 143 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 144 srcs: ["OpenGLESDispatch/egl_extensions.entries"], 145 out: ["egl_extensions_functions.h"], 146} 147 148genrule { 149 name: "gles2_core_functions_hdr", 150 tool_files: ["gen_entries.py"], 151 cmd: "python device/generic/opengl-transport/host/libs/virglrenderer/gen_entries.py --mode=funcargs $(in) --output $(out)", 152 srcs: ["OpenGLESDispatch/gles2_core.entries"], 153 out: ["gles2_core_functions.h"], 154} 155 156cc_library_host_shared { 157 name: "libvirglrenderer_cuttlefish", 158 include_dirs: [ 159 "external/libdrm", 160 "external/libdrm/include", 161 "device/generic/goldfish-opengl/system", 162 ], 163 local_include_dirs: [ 164 "GLESv1_dec", 165 "GLESv3_dec", 166 "include", 167 "renderControl_dec", 168 ], 169 srcs: [ 170 "AVDVirglRenderer.cpp", 171 "ChecksumCalculator.cpp", 172 "GLESv1.cpp", 173 "GLESv3.cpp", 174 "Gralloc1.cpp", 175 "OpenGLESDispatch/EGLDispatch.cpp", 176 "OpenGLESDispatch/GLESv1Dispatch.cpp", 177 "OpenGLESDispatch/GLESv3Dispatch.cpp", 178 "RenderControl.cpp", 179 ], 180 cflags: ["-Wno-unused-parameter", "-DOPENGL_DEBUG_PRINTOUT"], 181 host_ldlibs: [ "-ldl" ], 182 generated_sources: [ 183 "glesv1_dec_cuttlefish_gensrc", 184 "glesv3_dec_cuttlefish_gensrc", 185 "rendercontrol_dec_cuttlefish_gensrc", 186 ], 187 generated_headers: [ 188 "glesv1_dec_cuttlefish_genhdr", 189 "glesv3_dec_cuttlefish_genhdr", 190 "rendercontrol_dec_cuttlefish_genhdr", 191 "gles1_core_functions_hdr", 192 "gles1_extensions_functions_hdr", 193 "egl_functions_hdr", 194 "gles3_only_functions_hdr", 195 "gles31_only_functions_hdr", 196 "gles2_extensions_functions_hdr", 197 "egl_extensions_functions_hdr", 198 "gles2_core_functions_hdr", 199 ], 200 header_libs: [ 201 "virtio_gpu_uapi_headers", 202 "virgl_headers" 203 ], 204 205 // TODO(b/118466250): Make this work on the Mac 206 version_script : "libvirglrenderer.lds", 207 defaults: [ "cuttlefish_host_only" ], 208} 209