blob: 29b0a6e42441c8802f55e92369d52393e2180043 [file] [log] [blame]
Alistair Strachan60f86622018-03-22 17:37:55 -07001//
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
17cc_defaults {
18 name: "libswiftshader",
Alistair Strachan60f86622018-03-22 17:37:55 -070019 vendor: true,
Chris Forbes69f25352019-08-14 11:09:34 -070020 host_supported: true,
Alistair Strachan60f86622018-03-22 17:37:55 -070021
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 Strachan60f86622018-03-22 17:37:55 -070029 "-DNO_SANITIZE_FUNCTION=",
30 // FIXME: Use <android/api-level.h> instead?
31 "-DANDROID_PLATFORM_SDK_VERSION=10000",
Nicolas Capens7cfb50c2018-12-08 12:35:32 -080032 "-Wno-implicit-fallthrough",
Alistair Strachan60f86622018-03-22 17:37:55 -070033 "-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 Macnak1de497c2020-04-08 11:31:50 -070046 cflags: [
47 "-DHAVE_GRALLOC1",
48 "-DHAVE_GRALLOC3",
49 ],
Chris Forbese7043252019-09-17 19:26:09 -070050 relative_install_path: "egl",
Alistair Strachan60f86622018-03-22 17:37:55 -070051 header_libs: [
52 "swiftshader_platform_headers",
Chris Forbes9f1e03b2020-01-09 11:45:28 -080053 "libnativebase_headers",
Alistair Strachan60f86622018-03-22 17:37:55 -070054 ],
55 shared_libs: [
Jason Macnak1de497c2020-04-08 11:31:50 -070056 "android.hardware.graphics.mapper@3.0",
Alistair Strachan60f86622018-03-22 17:37:55 -070057 "libnativewindow",
58 "libhardware",
Jason Macnak1de497c2020-04-08 11:31:50 -070059 "libhidlbase",
Alistair Strachan60f86622018-03-22 17:37:55 -070060 "libcutils",
61 "libsync",
62 "liblog",
Jason Macnak1de497c2020-04-08 11:31:50 -070063 "libutils",
Chris Forbese7043252019-09-17 19:26:09 -070064 ],
65 static_libs: [
66 "libarect",
Alistair Strachan60f86622018-03-22 17:37:55 -070067 ],
68 },
69
70 host: {
71 header_libs: [
72 "swiftshader_host_headers",
73 "swiftshader_platform_headers",
Chris Forbes9f1e03b2020-01-09 11:45:28 -080074 "libnativebase_headers",
Alistair Strachan60f86622018-03-22 17:37:55 -070075 ],
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
86cc_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
99cc_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
114cc_defaults {
115 name: "libswiftshader_common_defaults",
116
117 cflags: [
118 "-DLOG_TAG=\"swiftshader\"",
119 ],
120
121 srcs: [
Alistair Strachan60f86622018-03-22 17:37:55 -0700122 "Common/Configurator.cpp",
Ben Clayton25e06e02020-02-07 11:19:08 +0000123 "Common/CPUID.cpp",
Alistair Strachan60f86622018-03-22 17:37:55 -0700124 "Common/DebugAndroid.cpp",
125 "Common/GrallocAndroid.cpp",
126 "Common/Half.cpp",
127 "Common/Math.cpp",
128 "Common/Memory.cpp",
129 "Common/Resource.cpp",
Ben Clayton25e06e02020-02-07 11:19:08 +0000130 "Common/SharedLibrary.cpp",
Alistair Strachan60f86622018-03-22 17:37:55 -0700131 "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
181cc_defaults {
182 name: "libswiftshader_llvm_defaults",
183
184 defaults: [ "libswiftshader_common_defaults" ],
185
Ben Clayton25e06e02020-02-07 11:19:08 +0000186 header_libs: [
187 "swiftshader_platform_headers",
188 ],
189
Alistair Strachan60f86622018-03-22 17:37:55 -0700190 srcs: [
Ben Claytonb3b2a4f2020-02-08 14:20:20 +0000191 "Reactor/CPUID.cpp",
192 "Reactor/Debug.cpp",
193 "Reactor/EmulatedReactor.cpp",
194 "Reactor/ExecutableMemory.cpp",
Nicolas Capens41a73022020-01-30 00:30:14 -0500195 "Reactor/LLVMJIT.cpp",
Alistair Strachan60f86622018-03-22 17:37:55 -0700196 "Reactor/LLVMReactor.cpp",
Ben Claytonb3b2a4f2020-02-08 14:20:20 +0000197 "Reactor/Reactor.cpp",
Alistair Strachan60f86622018-03-22 17:37:55 -0700198 ],
199
Ben Claytond632e6d2019-04-12 16:51:47 -0400200 cflags: [
Ben Claytond632e6d2019-04-12 16:51:47 -0400201 "-Wno-unused-parameter",
202 "-Wno-implicit-fallthrough",
203 ],
204
Alistair Strachan60f86622018-03-22 17:37:55 -0700205 static_libs: [
Antonio Maiorano522b34c2020-07-09 15:04:13 -0400206 "libLLVM10_swiftshader",
Alistair Strachan60f86622018-03-22 17:37:55 -0700207 ],
Ben Clayton25e06e02020-02-07 11:19:08 +0000208
209 shared_libs: [
210 "liblog",
211 ],
Alistair Strachan60f86622018-03-22 17:37:55 -0700212}
213
214cc_defaults {
Chris Forbes0deebed2019-04-05 10:07:33 -0700215 name: "libswiftshadervk_llvm_defaults",
216
Ben Clayton25e06e02020-02-07 11:19:08 +0000217 header_libs: [
218 "swiftshader_platform_headers",
219 ],
220
Chris Forbes0deebed2019-04-05 10:07:33 -0700221 srcs: [
Ben Claytonb3b2a4f2020-02-08 14:20:20 +0000222 "Reactor/CPUID.cpp",
223 "Reactor/Debug.cpp",
224 "Reactor/EmulatedReactor.cpp",
225 "Reactor/ExecutableMemory.cpp",
Nicolas Capens41a73022020-01-30 00:30:14 -0500226 "Reactor/LLVMJIT.cpp",
Chris Forbes0deebed2019-04-05 10:07:33 -0700227 "Reactor/LLVMReactor.cpp",
Ben Claytonb3b2a4f2020-02-08 14:20:20 +0000228 "Reactor/Reactor.cpp",
Chris Forbes0deebed2019-04-05 10:07:33 -0700229 ],
230
231 cflags: [
Chris Forbes0deebed2019-04-05 10:07:33 -0700232 "-Wno-unused-parameter",
233 "-Wno-implicit-fallthrough",
234 ],
235
236 static_libs: [
Antonio Maiorano522b34c2020-07-09 15:04:13 -0400237 "libLLVM10_swiftshader",
Chris Forbes0deebed2019-04-05 10:07:33 -0700238 ],
239
240 shared_libs: [
241 "libcutils",
Ben Clayton25e06e02020-02-07 11:19:08 +0000242 "liblog",
Chris Forbes0deebed2019-04-05 10:07:33 -0700243 ],
244}
245
246cc_defaults {
Alistair Strachan60f86622018-03-22 17:37:55 -0700247 name: "libswiftshader_common",
248
249 defaults: [ "libswiftshader_release", "libswiftshader_common_defaults" ],
250}
251
252cc_defaults {
253 name: "libswiftshader_common_debug",
254
255 srcs: [ "OpenGL/common/debug.cpp" ],
256
257 defaults: [ "libswiftshader_debug", "libswiftshader_common_defaults" ],
Jason Macnak2ef66b62019-09-20 09:43:46 -0700258
259 shared_libs: [
260 "libutils",
261 ],
Alistair Strachan60f86622018-03-22 17:37:55 -0700262}
263
264cc_library_static {
265 name: "libswiftshader_llvm",
Alistair Strachan60f86622018-03-22 17:37:55 -0700266 defaults: [ "libswiftshader_common", "libswiftshader_llvm_defaults" ],
267}
268
269cc_library_static {
270 name: "libswiftshader_llvm_debug",
Alistair Strachan60f86622018-03-22 17:37:55 -0700271 defaults: [ "libswiftshader_common_debug", "libswiftshader_llvm_defaults" ],
272}
273
274cc_library_static {
Chris Forbes0deebed2019-04-05 10:07:33 -0700275 name: "libswiftshadervk_llvm",
Chris Forbes0deebed2019-04-05 10:07:33 -0700276 vendor: true,
Chris Forbes0deebed2019-04-05 10:07:33 -0700277 defaults: [ "libswiftshadervk_llvm_defaults" ],
278}
279
280cc_library_static {
281 name: "libswiftshadervk_llvm_debug",
Chris Forbes0deebed2019-04-05 10:07:33 -0700282 vendor: true,
Chris Forbes0deebed2019-04-05 10:07:33 -0700283 defaults: [ "libswiftshadervk_llvm_defaults" ],
284}
285
Alistair Strachan60f86622018-03-22 17:37:55 -0700286// compiler libraries
287
288cc_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
335cc_library_static {
336 name: "libswiftshader_compiler",
337
338 defaults: [ "libswiftshader_release", "libswiftshader_compiler_defaults" ],
339}
340
341cc_library_static {
342 name: "libswiftshader_compiler_debug",
343
344 defaults: [ "libswiftshader_debug", "libswiftshader_compiler_defaults" ],
345}
346
347// libEGL libraries
348
349cc_defaults {
Chris Forbes69f25352019-08-14 11:09:34 -0700350 name: "swiftshader_client_libraries",
Alistair Strachan60f86622018-03-22 17:37:55 -0700351
352 defaults: [ "libswiftshader_release" ],
Chris Forbes69f25352019-08-14 11:09:34 -0700353 static_libs: [
354 "libswiftshader_llvm",
Antonio Maiorano522b34c2020-07-09 15:04:13 -0400355 "libLLVM10_swiftshader",
Chris Forbes69f25352019-08-14 11:09:34 -0700356 ],
Alistair Strachan60f86622018-03-22 17:37:55 -0700357}
358
359cc_defaults {
Chris Forbes69f25352019-08-14 11:09:34 -0700360 name: "swiftshader_client_libraries_debug",
Alistair Strachan60f86622018-03-22 17:37:55 -0700361
362 defaults: [ "libswiftshader_debug" ],
Chris Forbes69f25352019-08-14 11:09:34 -0700363 static_libs: [
364 "libswiftshader_llvm_debug",
Antonio Maiorano522b34c2020-07-09 15:04:13 -0400365 "libLLVM10_swiftshader",
Chris Forbes69f25352019-08-14 11:09:34 -0700366 ],
Alistair Strachan60f86622018-03-22 17:37:55 -0700367}
368
369cc_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
392cc_library_shared {
393 name: "libEGL_swiftshader",
394
395 defaults: [
396 "libEGL_swiftshader_defaults",
Chris Forbes69f25352019-08-14 11:09:34 -0700397 "swiftshader_client_libraries",
Alistair Strachan60f86622018-03-22 17:37:55 -0700398 ],
399}
400
401cc_library_shared {
402 name: "libEGL_swiftshader_debug",
403
404 defaults: [
405 "libEGL_swiftshader_defaults",
Chris Forbes69f25352019-08-14 11:09:34 -0700406 "swiftshader_client_libraries_debug",
Alistair Strachan60f86622018-03-22 17:37:55 -0700407 ],
408}
409
410// libGLESv1_CM libraries
411
412cc_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
444cc_library_shared {
445 name: "libGLESv1_CM_swiftshader",
446
447 defaults: [
448 "libGLESv1_CM_swiftshader_defaults",
Chris Forbes69f25352019-08-14 11:09:34 -0700449 "swiftshader_client_libraries",
Alistair Strachan60f86622018-03-22 17:37:55 -0700450 ],
451}
452
453cc_library_shared {
454 name: "libGLESv1_CM_swiftshader_debug",
455
456 defaults: [
457 "libGLESv1_CM_swiftshader_defaults",
Chris Forbes69f25352019-08-14 11:09:34 -0700458 "swiftshader_client_libraries_debug",
Alistair Strachan60f86622018-03-22 17:37:55 -0700459 ],
460}
461
462// libGLESv2 libraries
463
464cc_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
504cc_library_shared {
505 name: "libGLESv2_swiftshader",
506
507 defaults: [
508 "libGLESv2_swiftshader_defaults",
Chris Forbes69f25352019-08-14 11:09:34 -0700509 "swiftshader_client_libraries",
Alistair Strachan60f86622018-03-22 17:37:55 -0700510 ],
511
512 static_libs: [ "libswiftshader_compiler" ],
513}
514
515cc_library_shared {
516 name: "libGLESv2_swiftshader_debug",
517
518 defaults: [
519 "libGLESv2_swiftshader_defaults",
Chris Forbes69f25352019-08-14 11:09:34 -0700520 "swiftshader_client_libraries_debug",
Alistair Strachan60f86622018-03-22 17:37:55 -0700521 ],
Alistair Strachan60f86622018-03-22 17:37:55 -0700522
523 static_libs: [ "libswiftshader_compiler_debug" ],
524}
Hernan Liatis94e03052019-03-29 11:55:30 -0700525
Hernan Liatis94e03052019-03-29 11:55:30 -0700526
527// Vulkan
528
Tim Van Patten9da287f2019-11-07 10:27:18 -0700529genrule {
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 Liatis94e03052019-03-29 11:55:30 -0700536cc_defaults {
Chris Forbes0deebed2019-04-05 10:07:33 -0700537 name: "libvk_swiftshader_defaults",
Hernan Liatis94e03052019-03-29 11:55:30 -0700538 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 Macnak1de497c2020-04-08 11:31:50 -0700548 "-DHAVE_GRALLOC3",
Hernan Liatis94e03052019-03-29 11:55:30 -0700549 "-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 Forbes0deebed2019-04-05 10:07:33 -0700555 "-Wno-missing-field-initializers",
Tim Van Patten9da287f2019-11-07 10:27:18 -0700556 // Enable to output commit hash when SwiftShader is initialized
557 //"-DENABLE_BUILD_VERSION_OUTPUT",
Hernan Liatis94e03052019-03-29 11:55:30 -0700558 ],
559
560 cppflags: [
561 "-Wno-sign-promo",
562 "-Wno-non-virtual-dtor",
563 ],
564
Nicolas Capense3621dc2020-02-25 22:45:42 -0500565 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 Liatis94e03052019-03-29 11:55:30 -0700571 local_include_dirs: [ "Vulkan" ],
572
Lingfeng Yangddee0f32020-02-03 18:04:48 -0800573 version_script: "Vulkan/android_vk_swiftshader.lds",
Chris Forbes0deebed2019-04-05 10:07:33 -0700574
Tim Van Patten9da287f2019-11-07 10:27:18 -0700575 generated_headers: [ "commit_header" ],
576
Hernan Liatis94e03052019-03-29 11:55:30 -0700577 target: {
578 android: {
579 relative_install_path: "hw",
580 header_libs: [
Chris Forbes0deebed2019-04-05 10:07:33 -0700581 "swiftshader_platform_headers",
Chris Forbes9f1e03b2020-01-09 11:45:28 -0800582 "vulkan_headers",
Chris Forbesd6ccc312019-04-23 17:39:58 -0700583 "hwvulkan_headers",
Hernan Liatis94e03052019-03-29 11:55:30 -0700584 ],
585 shared_libs: [
Jason Macnak1de497c2020-04-08 11:31:50 -0700586 "android.hardware.graphics.mapper@3.0",
Hernan Liatis94e03052019-03-29 11:55:30 -0700587 "libnativewindow",
588 "libhardware",
Jason Macnak1de497c2020-04-08 11:31:50 -0700589 "libhidlbase",
Hernan Liatis94e03052019-03-29 11:55:30 -0700590 "libcutils",
591 "libsync",
592 "liblog",
Jason Macnak1de497c2020-04-08 11:31:50 -0700593 "libutils",
Hernan Liatis94e03052019-03-29 11:55:30 -0700594 ],
Chris Forbes9f1e03b2020-01-09 11:45:28 -0800595 static_libs: [
596 "libarect",
597 ],
Hernan Liatis94e03052019-03-29 11:55:30 -0700598 },
Hernan Liatis94e03052019-03-29 11:55:30 -0700599 },
600}
601
Alexis Hetu1b900872020-02-24 12:09:16 -0500602cc_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 Liatis94e03052019-03-29 11:55:30 -0700624cc_defaults {
625 name: "libvk_swiftshader_common_defaults",
626
627 cflags: [
628 "-DLOG_TAG=\"swiftshader\"",
Chris Forbesaff33402020-03-18 15:01:37 +0000629 //"-DSWIFTSHADER_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER",
Nicolas Capensa4347a92020-03-01 08:29:25 -0500630 "-DSWIFTSHADER_ENABLE_ASTC", // TODO(b/150130101)
Hernan Liatis94e03052019-03-29 11:55:30 -0700631 ],
632
633 srcs: [
Ben Clayton77c89ff2020-01-08 19:10:14 +0000634 "System/Build.cpp",
Hernan Liatis628604e2019-05-07 15:30:18 -0700635 "System/Configurator.cpp",
Ben Clayton25e06e02020-02-07 11:19:08 +0000636 "System/CPUID.cpp",
Ben Clayton25e06e02020-02-07 11:19:08 +0000637 "System/GrallocAndroid.cpp",
Hernan Liatis628604e2019-05-07 15:30:18 -0700638 "System/Half.cpp",
David 'Digit' Turnerc9fa9fe2019-08-13 19:05:01 +0200639 "System/Linux/MemFd.cpp",
Hernan Liatis628604e2019-05-07 15:30:18 -0700640 "System/Math.cpp",
641 "System/Memory.cpp",
Hernan Liatis628604e2019-05-07 15:30:18 -0700642 "System/Socket.cpp",
Hernan Liatis628604e2019-05-07 15:30:18 -0700643 "System/Timer.cpp",
Chris Forbes0deebed2019-04-05 10:07:33 -0700644 "Device/*.cpp",
645 "Pipeline/*.cpp",
646 "Vulkan/*.cpp",
647 ],
648
649 static_libs: [
Alexis Hetu1b900872020-02-24 12:09:16 -0500650 "swiftshader_astc",
651 "swiftshader_debug",
Ben Claytone693b622019-09-05 12:48:37 +0100652 "swiftshader_marl",
Chris Forbes0deebed2019-04-05 10:07:33 -0700653 "swiftshader_spirv-tools",
Hernan Liatis94e03052019-03-29 11:55:30 -0700654 ],
655
656 include_dirs: [
657 "external/swiftshader/third_party/SPIRV-Headers/include",
658 "external/swiftshader/include"
659 ],
660}
661
Chris Forbes0deebed2019-04-05 10:07:33 -0700662cc_library_shared {
663 name: "vulkan.pastel",
Hernan Liatis94e03052019-03-29 11:55:30 -0700664
Chris Forbes0deebed2019-04-05 10:07:33 -0700665 static_libs: [
666 "libswiftshadervk_llvm_debug",
Antonio Maiorano522b34c2020-07-09 15:04:13 -0400667 "libLLVM10_swiftshader",
Chris Forbes0deebed2019-04-05 10:07:33 -0700668 ],
669
Chris Forbes0deebed2019-04-05 10:07:33 -0700670 defaults: [
671 "libvk_swiftshader_common_defaults",
672 "libvk_swiftshader_defaults"
673 ],
674}
675
676cc_library_shared {
677 name: "vulkan.pastel.debug",
678
Chris Forbes0deebed2019-04-05 10:07:33 -0700679 static_libs: [
680 "libswiftshadervk_llvm_debug",
Antonio Maiorano522b34c2020-07-09 15:04:13 -0400681 "libLLVM10_swiftshader",
Chris Forbes0deebed2019-04-05 10:07:33 -0700682 ],
683
Hernan Liatis94e03052019-03-29 11:55:30 -0700684 cflags: [
685 "-UNDEBUG",
686 "-g",
687 "-O0",
688 "-DDEFAULT_THREAD_COUNT=1",
689 ],
Hernan Liatis94e03052019-03-29 11:55:30 -0700690
691 defaults: [
Hernan Liatis94e03052019-03-29 11:55:30 -0700692 "libvk_swiftshader_common_defaults",
Chris Forbes0deebed2019-04-05 10:07:33 -0700693 "libvk_swiftshader_defaults",
Hernan Liatis94e03052019-03-29 11:55:30 -0700694 ],
Chris Forbes0deebed2019-04-05 10:07:33 -0700695}