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