Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 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 | |
| 17 | cc_defaults { |
| 18 | name: "libswiftshader", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 19 | vendor: true, |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 20 | host_supported: true, |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 21 | |
| 22 | defaults: [ "swiftshader_common" ], |
| 23 | |
| 24 | cflags: [ |
| 25 | "-D_GNU_SOURCE", |
| 26 | "-D__STDC_LIMIT_MACROS", |
| 27 | "-D__STDC_CONSTANT_MACROS", |
| 28 | "-D__STDC_FORMAT_MACROS", |
| 29 | "-DHAVE_GRALLOC1", |
| 30 | "-DNO_SANITIZE_FUNCTION=", |
| 31 | // FIXME: Use <android/api-level.h> instead? |
| 32 | "-DANDROID_PLATFORM_SDK_VERSION=10000", |
Nicolas Capens | 7cfb50c | 2018-12-08 12:35:32 -0800 | [diff] [blame] | 33 | "-Wno-implicit-fallthrough", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 34 | "-Wno-unused-parameter", |
| 35 | "-Wno-unused-local-typedef", |
| 36 | ], |
| 37 | |
| 38 | cppflags: [ |
| 39 | "-Wno-sign-promo", |
| 40 | "-Wno-non-virtual-dtor", |
| 41 | ], |
| 42 | |
| 43 | local_include_dirs: [ "OpenGL" ], |
| 44 | |
| 45 | target: { |
| 46 | android: { |
Chris Forbes | e704325 | 2019-09-17 19:26:09 -0700 | [diff] [blame] | 47 | relative_install_path: "egl", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 48 | header_libs: [ |
| 49 | "swiftshader_platform_headers", |
Chris Forbes | 9f1e03b | 2020-01-09 11:45:28 -0800 | [diff] [blame] | 50 | "libnativebase_headers", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 51 | ], |
| 52 | shared_libs: [ |
| 53 | "libnativewindow", |
| 54 | "libhardware", |
| 55 | "libcutils", |
| 56 | "libsync", |
| 57 | "liblog", |
Chris Forbes | e704325 | 2019-09-17 19:26:09 -0700 | [diff] [blame] | 58 | ], |
| 59 | static_libs: [ |
| 60 | "libarect", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 61 | ], |
| 62 | }, |
| 63 | |
| 64 | host: { |
| 65 | header_libs: [ |
| 66 | "swiftshader_host_headers", |
| 67 | "swiftshader_platform_headers", |
Chris Forbes | 9f1e03b | 2020-01-09 11:45:28 -0800 | [diff] [blame] | 68 | "libnativebase_headers", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 69 | ], |
| 70 | |
| 71 | // Pretend to build for Android |
| 72 | cflags: [ "-D__ANDROID__", "-DANDROID_HOST_BUILD" ], |
| 73 | |
| 74 | allow_undefined_symbols: true, |
| 75 | host_ldlibs: ["-ldl"], |
| 76 | }, |
| 77 | }, |
| 78 | } |
| 79 | |
| 80 | cc_defaults { |
| 81 | name: "libswiftshader_release", |
| 82 | |
| 83 | defaults: [ "libswiftshader" ], |
| 84 | |
| 85 | cflags: [ |
| 86 | "-fomit-frame-pointer", |
| 87 | "-ffunction-sections", |
| 88 | "-fdata-sections", |
| 89 | "-DANGLE_DISABLE_TRACE", |
| 90 | ], |
| 91 | } |
| 92 | |
| 93 | cc_defaults { |
| 94 | name: "libswiftshader_debug", |
| 95 | |
| 96 | defaults: [ "libswiftshader" ], |
| 97 | |
| 98 | cflags: [ |
| 99 | "-UNDEBUG", |
| 100 | "-g", |
| 101 | "-O0", |
| 102 | "-DDEFAULT_THREAD_COUNT=1", |
| 103 | ], |
| 104 | } |
| 105 | |
| 106 | // Common libraries |
| 107 | |
| 108 | cc_defaults { |
| 109 | name: "libswiftshader_common_defaults", |
| 110 | |
| 111 | cflags: [ |
| 112 | "-DLOG_TAG=\"swiftshader\"", |
| 113 | ], |
| 114 | |
| 115 | srcs: [ |
| 116 | "Common/CPUID.cpp", |
| 117 | "Common/Configurator.cpp", |
| 118 | "Common/DebugAndroid.cpp", |
| 119 | "Common/GrallocAndroid.cpp", |
| 120 | "Common/Half.cpp", |
| 121 | "Common/Math.cpp", |
| 122 | "Common/Memory.cpp", |
| 123 | "Common/Resource.cpp", |
| 124 | "Common/Socket.cpp", |
| 125 | "Common/Thread.cpp", |
| 126 | "Common/Timer.cpp", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 127 | "Common/SharedLibrary.cpp", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 128 | "Main/Config.cpp", |
| 129 | "Main/FrameBuffer.cpp", |
| 130 | "Main/FrameBufferAndroid.cpp", |
| 131 | "Main/SwiftConfig.cpp", |
| 132 | "Renderer/Blitter.cpp", |
| 133 | "Renderer/Clipper.cpp", |
| 134 | "Renderer/Color.cpp", |
| 135 | "Renderer/Context.cpp", |
| 136 | "Renderer/ETC_Decoder.cpp", |
| 137 | "Renderer/Matrix.cpp", |
| 138 | "Renderer/PixelProcessor.cpp", |
| 139 | "Renderer/Plane.cpp", |
| 140 | "Renderer/Point.cpp", |
| 141 | "Renderer/QuadRasterizer.cpp", |
| 142 | "Renderer/Renderer.cpp", |
| 143 | "Renderer/Sampler.cpp", |
| 144 | "Renderer/SetupProcessor.cpp", |
| 145 | "Renderer/Surface.cpp", |
| 146 | "Renderer/TextureStage.cpp", |
| 147 | "Renderer/Vector.cpp", |
| 148 | "Renderer/VertexProcessor.cpp", |
| 149 | "Shader/Constants.cpp", |
| 150 | "Shader/PixelPipeline.cpp", |
| 151 | "Shader/PixelProgram.cpp", |
| 152 | "Shader/PixelRoutine.cpp", |
| 153 | "Shader/PixelShader.cpp", |
| 154 | "Shader/SamplerCore.cpp", |
| 155 | "Shader/SetupRoutine.cpp", |
| 156 | "Shader/Shader.cpp", |
| 157 | "Shader/ShaderCore.cpp", |
| 158 | "Shader/VertexPipeline.cpp", |
| 159 | "Shader/VertexProgram.cpp", |
| 160 | "Shader/VertexRoutine.cpp", |
| 161 | "Shader/VertexShader.cpp", |
| 162 | "OpenGL/common/Image.cpp", |
| 163 | "OpenGL/common/Object.cpp", |
| 164 | "OpenGL/common/MatrixStack.cpp", |
| 165 | ], |
| 166 | |
| 167 | target: { |
| 168 | host: { |
| 169 | exclude_srcs: [ "Common/DebugAndroid.cpp" ], |
| 170 | srcs: [ "Common/Debug.cpp" ], |
| 171 | }, |
| 172 | }, |
| 173 | } |
| 174 | |
| 175 | cc_defaults { |
| 176 | name: "libswiftshader_llvm_defaults", |
| 177 | |
| 178 | defaults: [ "libswiftshader_common_defaults" ], |
| 179 | |
| 180 | srcs: [ |
Nicolas Capens | b6d4ce3 | 2019-03-12 23:00:24 -0400 | [diff] [blame] | 181 | "Reactor/Reactor.cpp", |
Nicolas Capens | 41a7302 | 2020-01-30 00:30:14 -0500 | [diff] [blame] | 182 | "Reactor/LLVMJIT.cpp", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 183 | "Reactor/LLVMReactor.cpp", |
Chris Forbes | 47d879a | 2019-04-23 17:39:14 -0700 | [diff] [blame] | 184 | "Reactor/Debug.cpp", |
Chris Forbes | 144a3f5 | 2019-08-15 11:39:16 -0700 | [diff] [blame] | 185 | "Reactor/CPUID.cpp", |
Chris Forbes | fbbfeb7 | 2019-12-13 08:47:13 -0800 | [diff] [blame] | 186 | "Reactor/ExecutableMemory.cpp", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 187 | ], |
| 188 | |
Ben Clayton | d632e6d | 2019-04-12 16:51:47 -0400 | [diff] [blame] | 189 | cflags: [ |
Ben Clayton | d632e6d | 2019-04-12 16:51:47 -0400 | [diff] [blame] | 190 | "-Wno-unused-parameter", |
| 191 | "-Wno-implicit-fallthrough", |
| 192 | ], |
| 193 | |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 194 | static_libs: [ |
Ben Clayton | d632e6d | 2019-04-12 16:51:47 -0400 | [diff] [blame] | 195 | "libLLVM7_swiftshader", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 196 | ], |
| 197 | } |
| 198 | |
| 199 | cc_defaults { |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 200 | name: "libswiftshadervk_llvm_defaults", |
| 201 | |
| 202 | srcs: [ |
| 203 | "Reactor/Reactor.cpp", |
Nicolas Capens | 41a7302 | 2020-01-30 00:30:14 -0500 | [diff] [blame] | 204 | "Reactor/LLVMJIT.cpp", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 205 | "Reactor/LLVMReactor.cpp", |
Chris Forbes | 47d879a | 2019-04-23 17:39:14 -0700 | [diff] [blame] | 206 | "Reactor/Debug.cpp", |
Chris Forbes | 0b79e98 | 2019-08-08 17:18:27 -0700 | [diff] [blame] | 207 | "Reactor/CPUID.cpp", |
Chris Forbes | fbbfeb7 | 2019-12-13 08:47:13 -0800 | [diff] [blame] | 208 | "Reactor/ExecutableMemory.cpp", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 209 | ], |
| 210 | |
| 211 | cflags: [ |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 212 | "-Wno-unused-parameter", |
| 213 | "-Wno-implicit-fallthrough", |
| 214 | ], |
| 215 | |
| 216 | static_libs: [ |
| 217 | "libLLVM7_swiftshader", |
| 218 | ], |
| 219 | |
| 220 | shared_libs: [ |
| 221 | "libcutils", |
| 222 | ], |
| 223 | } |
| 224 | |
| 225 | cc_defaults { |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 226 | name: "libswiftshader_common", |
| 227 | |
| 228 | defaults: [ "libswiftshader_release", "libswiftshader_common_defaults" ], |
| 229 | } |
| 230 | |
| 231 | cc_defaults { |
| 232 | name: "libswiftshader_common_debug", |
| 233 | |
| 234 | srcs: [ "OpenGL/common/debug.cpp" ], |
| 235 | |
| 236 | defaults: [ "libswiftshader_debug", "libswiftshader_common_defaults" ], |
Jason Macnak | 2ef66b6 | 2019-09-20 09:43:46 -0700 | [diff] [blame] | 237 | |
| 238 | shared_libs: [ |
| 239 | "libutils", |
| 240 | ], |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | cc_library_static { |
| 244 | name: "libswiftshader_llvm", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 245 | defaults: [ "libswiftshader_common", "libswiftshader_llvm_defaults" ], |
| 246 | } |
| 247 | |
| 248 | cc_library_static { |
| 249 | name: "libswiftshader_llvm_debug", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 250 | defaults: [ "libswiftshader_common_debug", "libswiftshader_llvm_defaults" ], |
| 251 | } |
| 252 | |
| 253 | cc_library_static { |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 254 | name: "libswiftshadervk_llvm", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 255 | vendor: true, |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 256 | defaults: [ "libswiftshadervk_llvm_defaults" ], |
| 257 | } |
| 258 | |
| 259 | cc_library_static { |
| 260 | name: "libswiftshadervk_llvm_debug", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 261 | vendor: true, |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 262 | defaults: [ "libswiftshadervk_llvm_defaults" ], |
| 263 | } |
| 264 | |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 265 | // compiler libraries |
| 266 | |
| 267 | cc_defaults { |
| 268 | name: "libswiftshader_compiler_defaults", |
| 269 | |
| 270 | defaults: [ "libswiftshader" ], |
| 271 | |
| 272 | cflags: [ |
| 273 | "-DLOG_TAG=\"swiftshader_compiler\"", |
| 274 | ], |
| 275 | |
| 276 | srcs: [ |
| 277 | "OpenGL/compiler/preprocessor/DiagnosticsBase.cpp", |
| 278 | "OpenGL/compiler/preprocessor/DirectiveHandlerBase.cpp", |
| 279 | "OpenGL/compiler/preprocessor/DirectiveParser.cpp", |
| 280 | "OpenGL/compiler/preprocessor/ExpressionParser.cpp", |
| 281 | "OpenGL/compiler/preprocessor/Input.cpp", |
| 282 | "OpenGL/compiler/preprocessor/Lexer.cpp", |
| 283 | "OpenGL/compiler/preprocessor/Macro.cpp", |
| 284 | "OpenGL/compiler/preprocessor/MacroExpander.cpp", |
| 285 | "OpenGL/compiler/preprocessor/Preprocessor.cpp", |
| 286 | "OpenGL/compiler/preprocessor/Token.cpp", |
| 287 | "OpenGL/compiler/preprocessor/Tokenizer.cpp", |
| 288 | "OpenGL/compiler/AnalyzeCallDepth.cpp", |
| 289 | "OpenGL/compiler/Compiler.cpp", |
| 290 | "OpenGL/compiler/debug.cpp", |
| 291 | "OpenGL/compiler/Diagnostics.cpp", |
| 292 | "OpenGL/compiler/DirectiveHandler.cpp", |
| 293 | "OpenGL/compiler/glslang_lex.cpp", |
| 294 | "OpenGL/compiler/glslang_tab.cpp", |
| 295 | "OpenGL/compiler/InfoSink.cpp", |
| 296 | "OpenGL/compiler/Initialize.cpp", |
| 297 | "OpenGL/compiler/InitializeParseContext.cpp", |
| 298 | "OpenGL/compiler/IntermTraverse.cpp", |
| 299 | "OpenGL/compiler/Intermediate.cpp", |
| 300 | "OpenGL/compiler/intermOut.cpp", |
| 301 | "OpenGL/compiler/ossource_posix.cpp", |
| 302 | "OpenGL/compiler/OutputASM.cpp", |
| 303 | "OpenGL/compiler/parseConst.cpp", |
| 304 | "OpenGL/compiler/ParseHelper.cpp", |
| 305 | "OpenGL/compiler/PoolAlloc.cpp", |
| 306 | "OpenGL/compiler/SymbolTable.cpp", |
| 307 | "OpenGL/compiler/TranslatorASM.cpp", |
| 308 | "OpenGL/compiler/util.cpp", |
| 309 | "OpenGL/compiler/ValidateLimitations.cpp", |
| 310 | "OpenGL/compiler/ValidateSwitch.cpp", |
| 311 | ], |
| 312 | } |
| 313 | |
| 314 | cc_library_static { |
| 315 | name: "libswiftshader_compiler", |
| 316 | |
| 317 | defaults: [ "libswiftshader_release", "libswiftshader_compiler_defaults" ], |
| 318 | } |
| 319 | |
| 320 | cc_library_static { |
| 321 | name: "libswiftshader_compiler_debug", |
| 322 | |
| 323 | defaults: [ "libswiftshader_debug", "libswiftshader_compiler_defaults" ], |
| 324 | } |
| 325 | |
| 326 | // libEGL libraries |
| 327 | |
| 328 | cc_defaults { |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 329 | name: "swiftshader_client_libraries", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 330 | |
| 331 | defaults: [ "libswiftshader_release" ], |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 332 | static_libs: [ |
| 333 | "libswiftshader_llvm", |
| 334 | "libLLVM7_swiftshader", |
| 335 | ], |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | cc_defaults { |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 339 | name: "swiftshader_client_libraries_debug", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 340 | |
| 341 | defaults: [ "libswiftshader_debug" ], |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 342 | static_libs: [ |
| 343 | "libswiftshader_llvm_debug", |
| 344 | "libLLVM7_swiftshader", |
| 345 | ], |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | cc_defaults { |
| 349 | name: "libEGL_swiftshader_defaults", |
| 350 | |
| 351 | defaults: [ "libswiftshader" ], |
| 352 | |
| 353 | cflags: [ |
| 354 | "-DLOG_TAG=\"libEGL_swiftshader\"", |
| 355 | "-DEGLAPI=", |
| 356 | "-DEGL_EGLEXT_PROTOTYPES", |
| 357 | "-Wno-format", |
| 358 | ], |
| 359 | |
| 360 | srcs: [ |
| 361 | "OpenGL/libEGL/Config.cpp", |
| 362 | "OpenGL/libEGL/Display.cpp", |
| 363 | "OpenGL/libEGL/Surface.cpp", |
| 364 | "OpenGL/libEGL/libEGL.cpp", |
| 365 | "OpenGL/libEGL/main.cpp", |
| 366 | ], |
| 367 | |
| 368 | version_script: "OpenGL/libEGL/libEGL.lds", |
| 369 | } |
| 370 | |
| 371 | cc_library_shared { |
| 372 | name: "libEGL_swiftshader", |
| 373 | |
| 374 | defaults: [ |
| 375 | "libEGL_swiftshader_defaults", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 376 | "swiftshader_client_libraries", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 377 | ], |
| 378 | } |
| 379 | |
| 380 | cc_library_shared { |
| 381 | name: "libEGL_swiftshader_debug", |
| 382 | |
| 383 | defaults: [ |
| 384 | "libEGL_swiftshader_defaults", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 385 | "swiftshader_client_libraries_debug", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 386 | ], |
| 387 | } |
| 388 | |
| 389 | // libGLESv1_CM libraries |
| 390 | |
| 391 | cc_defaults { |
| 392 | name: "libGLESv1_CM_swiftshader_defaults", |
| 393 | |
| 394 | defaults: [ "libswiftshader" ], |
| 395 | |
| 396 | cflags: [ |
| 397 | "-DLOG_TAG=\"libGLES_CM_swiftshader\"", |
| 398 | "-DEGLAPI=", |
| 399 | "-DGL_API=", |
| 400 | "-DGL_APICALL=", |
| 401 | "-DGL_GLEXT_PROTOTYPES", |
| 402 | "-Wno-format", |
| 403 | ], |
| 404 | |
| 405 | srcs: [ |
| 406 | "OpenGL/libGLES_CM/Buffer.cpp", |
| 407 | "OpenGL/libGLES_CM/Context.cpp", |
| 408 | "OpenGL/libGLES_CM/Device.cpp", |
| 409 | "OpenGL/libGLES_CM/Framebuffer.cpp", |
| 410 | "OpenGL/libGLES_CM/IndexDataManager.cpp", |
| 411 | "OpenGL/libGLES_CM/libGLES_CM.cpp", |
| 412 | "OpenGL/libGLES_CM/main.cpp", |
| 413 | "OpenGL/libGLES_CM/Renderbuffer.cpp", |
| 414 | "OpenGL/libGLES_CM/ResourceManager.cpp", |
| 415 | "OpenGL/libGLES_CM/Texture.cpp", |
| 416 | "OpenGL/libGLES_CM/utilities.cpp", |
| 417 | "OpenGL/libGLES_CM/VertexDataManager.cpp", |
| 418 | ], |
| 419 | |
| 420 | version_script: "OpenGL/libGLES_CM/libGLES_CM.lds", |
| 421 | } |
| 422 | |
| 423 | cc_library_shared { |
| 424 | name: "libGLESv1_CM_swiftshader", |
| 425 | |
| 426 | defaults: [ |
| 427 | "libGLESv1_CM_swiftshader_defaults", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 428 | "swiftshader_client_libraries", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 429 | ], |
| 430 | } |
| 431 | |
| 432 | cc_library_shared { |
| 433 | name: "libGLESv1_CM_swiftshader_debug", |
| 434 | |
| 435 | defaults: [ |
| 436 | "libGLESv1_CM_swiftshader_defaults", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 437 | "swiftshader_client_libraries_debug", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 438 | ], |
| 439 | } |
| 440 | |
| 441 | // libGLESv2 libraries |
| 442 | |
| 443 | cc_defaults { |
| 444 | name: "libGLESv2_swiftshader_defaults", |
| 445 | |
| 446 | defaults: [ "libswiftshader" ], |
| 447 | |
| 448 | cflags: [ |
| 449 | "-DLOG_TAG=\"libGLESv2_swiftshader\"", |
| 450 | "-DEGLAPI=", |
| 451 | "-DGL_API=", |
| 452 | "-DGL_APICALL=", |
| 453 | "-DGL_GLEXT_PROTOTYPES", |
| 454 | "-Wno-format", |
| 455 | ], |
| 456 | |
| 457 | srcs: [ |
| 458 | "OpenGL/libGLESv2/Buffer.cpp", |
| 459 | "OpenGL/libGLESv2/Context.cpp", |
| 460 | "OpenGL/libGLESv2/Device.cpp", |
| 461 | "OpenGL/libGLESv2/Fence.cpp", |
| 462 | "OpenGL/libGLESv2/Framebuffer.cpp", |
| 463 | "OpenGL/libGLESv2/IndexDataManager.cpp", |
| 464 | "OpenGL/libGLESv2/libGLESv2.cpp", |
| 465 | "OpenGL/libGLESv2/libGLESv3.cpp", |
| 466 | "OpenGL/libGLESv2/main.cpp", |
| 467 | "OpenGL/libGLESv2/entry_points.cpp", |
| 468 | "OpenGL/libGLESv2/Program.cpp", |
| 469 | "OpenGL/libGLESv2/Query.cpp", |
| 470 | "OpenGL/libGLESv2/Renderbuffer.cpp", |
| 471 | "OpenGL/libGLESv2/ResourceManager.cpp", |
| 472 | "OpenGL/libGLESv2/Shader.cpp", |
| 473 | "OpenGL/libGLESv2/Texture.cpp", |
| 474 | "OpenGL/libGLESv2/TransformFeedback.cpp", |
| 475 | "OpenGL/libGLESv2/utilities.cpp", |
| 476 | "OpenGL/libGLESv2/VertexArray.cpp", |
| 477 | "OpenGL/libGLESv2/VertexDataManager.cpp", |
| 478 | ], |
| 479 | |
| 480 | version_script: "OpenGL/libGLESv2/libGLESv2.lds", |
| 481 | } |
| 482 | |
| 483 | cc_library_shared { |
| 484 | name: "libGLESv2_swiftshader", |
| 485 | |
| 486 | defaults: [ |
| 487 | "libGLESv2_swiftshader_defaults", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 488 | "swiftshader_client_libraries", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 489 | ], |
| 490 | |
| 491 | static_libs: [ "libswiftshader_compiler" ], |
| 492 | } |
| 493 | |
| 494 | cc_library_shared { |
| 495 | name: "libGLESv2_swiftshader_debug", |
| 496 | |
| 497 | defaults: [ |
| 498 | "libGLESv2_swiftshader_defaults", |
Chris Forbes | 69f2535 | 2019-08-14 11:09:34 -0700 | [diff] [blame] | 499 | "swiftshader_client_libraries_debug", |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 500 | ], |
Alistair Strachan | 60f8662 | 2018-03-22 17:37:55 -0700 | [diff] [blame] | 501 | |
| 502 | static_libs: [ "libswiftshader_compiler_debug" ], |
| 503 | } |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 504 | |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 505 | |
| 506 | // Vulkan |
| 507 | |
Tim Van Patten | 9da287f | 2019-11-07 10:27:18 -0700 | [diff] [blame] | 508 | genrule { |
| 509 | name: "commit_header", |
| 510 | out: ["commit.h"], |
| 511 | tool_files: ["commit_id.py"], |
| 512 | cmd: "$(location commit_id.py) gen $(genDir)/commit.h", |
| 513 | } |
| 514 | |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 515 | cc_defaults { |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 516 | name: "libvk_swiftshader_defaults", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 517 | vendor: true, |
| 518 | |
| 519 | defaults: [ "swiftshader_common" ], |
| 520 | |
| 521 | cflags: [ |
| 522 | "-D_GNU_SOURCE", |
| 523 | "-D__STDC_LIMIT_MACROS", |
| 524 | "-D__STDC_CONSTANT_MACROS", |
| 525 | "-D__STDC_FORMAT_MACROS", |
| 526 | "-DHAVE_GRALLOC1", |
| 527 | "-DNO_SANITIZE_FUNCTION=", |
| 528 | // FIXME: Use <android/api-level.h> instead? |
| 529 | "-DANDROID_PLATFORM_SDK_VERSION=10000", |
| 530 | "-Wno-implicit-fallthrough", |
| 531 | "-Wno-unused-parameter", |
| 532 | "-Wno-unused-local-typedef", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 533 | "-Wno-missing-field-initializers", |
Tim Van Patten | 9da287f | 2019-11-07 10:27:18 -0700 | [diff] [blame] | 534 | // Enable to output commit hash when SwiftShader is initialized |
| 535 | //"-DENABLE_BUILD_VERSION_OUTPUT", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 536 | ], |
| 537 | |
| 538 | cppflags: [ |
| 539 | "-Wno-sign-promo", |
| 540 | "-Wno-non-virtual-dtor", |
| 541 | ], |
| 542 | |
| 543 | local_include_dirs: [ "Vulkan" ], |
| 544 | |
Lingfeng Yang | ddee0f3 | 2020-02-03 18:04:48 -0800 | [diff] [blame] | 545 | version_script: "Vulkan/android_vk_swiftshader.lds", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 546 | |
Tim Van Patten | 9da287f | 2019-11-07 10:27:18 -0700 | [diff] [blame] | 547 | generated_headers: [ "commit_header" ], |
| 548 | |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 549 | target: { |
| 550 | android: { |
| 551 | relative_install_path: "hw", |
| 552 | header_libs: [ |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 553 | "swiftshader_platform_headers", |
Chris Forbes | 9f1e03b | 2020-01-09 11:45:28 -0800 | [diff] [blame] | 554 | "vulkan_headers", |
Chris Forbes | d6ccc31 | 2019-04-23 17:39:58 -0700 | [diff] [blame] | 555 | "hwvulkan_headers", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 556 | ], |
| 557 | shared_libs: [ |
| 558 | "libnativewindow", |
| 559 | "libhardware", |
| 560 | "libcutils", |
| 561 | "libsync", |
| 562 | "liblog", |
| 563 | ], |
Chris Forbes | 9f1e03b | 2020-01-09 11:45:28 -0800 | [diff] [blame] | 564 | static_libs: [ |
| 565 | "libarect", |
| 566 | ], |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 567 | }, |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 568 | }, |
| 569 | } |
| 570 | |
| 571 | cc_defaults { |
| 572 | name: "libvk_swiftshader_common_defaults", |
| 573 | |
| 574 | cflags: [ |
| 575 | "-DLOG_TAG=\"swiftshader\"", |
Chris Forbes | 9f1e03b | 2020-01-09 11:45:28 -0800 | [diff] [blame] | 576 | "-DSWIFTSHADER_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 577 | ], |
| 578 | |
| 579 | srcs: [ |
Ben Clayton | 77c89ff | 2020-01-08 19:10:14 +0000 | [diff] [blame] | 580 | "System/Build.cpp", |
Hernan Liatis | 628604e | 2019-05-07 15:30:18 -0700 | [diff] [blame] | 581 | "System/CPUID.cpp", |
| 582 | "System/Configurator.cpp", |
| 583 | "System/Half.cpp", |
David 'Digit' Turner | c9fa9fe | 2019-08-13 19:05:01 +0200 | [diff] [blame] | 584 | "System/Linux/MemFd.cpp", |
Hernan Liatis | 628604e | 2019-05-07 15:30:18 -0700 | [diff] [blame] | 585 | "System/Math.cpp", |
| 586 | "System/Memory.cpp", |
Hernan Liatis | 628604e | 2019-05-07 15:30:18 -0700 | [diff] [blame] | 587 | "System/Socket.cpp", |
Hernan Liatis | 628604e | 2019-05-07 15:30:18 -0700 | [diff] [blame] | 588 | "System/Timer.cpp", |
| 589 | "System/DebugAndroid.cpp", |
| 590 | "System/GrallocAndroid.cpp", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 591 | "Device/*.cpp", |
| 592 | "Pipeline/*.cpp", |
| 593 | "Vulkan/*.cpp", |
| 594 | ], |
| 595 | |
| 596 | static_libs: [ |
Ben Clayton | e693b62 | 2019-09-05 12:48:37 +0100 | [diff] [blame] | 597 | "swiftshader_marl", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 598 | "swiftshader_spirv-tools", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 599 | ], |
| 600 | |
| 601 | include_dirs: [ |
| 602 | "external/swiftshader/third_party/SPIRV-Headers/include", |
| 603 | "external/swiftshader/include" |
| 604 | ], |
| 605 | } |
| 606 | |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 607 | cc_library_shared { |
| 608 | name: "vulkan.pastel", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 609 | |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 610 | static_libs: [ |
| 611 | "libswiftshadervk_llvm_debug", |
| 612 | "libLLVM7_swiftshader", |
| 613 | ], |
| 614 | |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 615 | defaults: [ |
| 616 | "libvk_swiftshader_common_defaults", |
| 617 | "libvk_swiftshader_defaults" |
| 618 | ], |
| 619 | } |
| 620 | |
| 621 | cc_library_shared { |
| 622 | name: "vulkan.pastel.debug", |
| 623 | |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 624 | static_libs: [ |
| 625 | "libswiftshadervk_llvm_debug", |
| 626 | "libLLVM7_swiftshader", |
| 627 | ], |
| 628 | |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 629 | cflags: [ |
| 630 | "-UNDEBUG", |
| 631 | "-g", |
| 632 | "-O0", |
| 633 | "-DDEFAULT_THREAD_COUNT=1", |
| 634 | ], |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 635 | |
| 636 | defaults: [ |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 637 | "libvk_swiftshader_common_defaults", |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 638 | "libvk_swiftshader_defaults", |
Hernan Liatis | 94e0305 | 2019-03-29 11:55:30 -0700 | [diff] [blame] | 639 | ], |
Chris Forbes | 0deebed | 2019-04-05 10:07:33 -0700 | [diff] [blame] | 640 | } |