summaryrefslogtreecommitdiff
path: root/gfx/angle/src/libANGLE/moz.build
blob: e127ccce1e811e1c7b8a374a4434a6681fe7a9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399

#
# WARNING WARNING WARNING
#
# This file is generated by generate_mozbuild.py (from
# https://github.com/mozilla/angle). Do not modify it without also modifying
# generate_mozbuild.py.
#
# WARNING WARNING WARNING
#
UNIFIED_SOURCES += [
    '../common/angleutils.cpp',
    '../common/debug.cpp',
    '../common/event_tracer.cpp',
    '../common/Float16ToFloat32.cpp',
    '../common/mathutil.cpp',
    '../common/MemoryBuffer.cpp',
    '../common/string_utils.cpp',
    '../common/tls.cpp',
    '../common/utilities.cpp',
    '../compiler/preprocessor/DiagnosticsBase.cpp',
    '../compiler/preprocessor/DirectiveHandlerBase.cpp',
    '../compiler/preprocessor/DirectiveParser.cpp',
    '../compiler/preprocessor/ExpressionParser.cpp',
    '../compiler/preprocessor/Input.cpp',
    '../compiler/preprocessor/Lexer.cpp',
    '../compiler/preprocessor/Macro.cpp',
    '../compiler/preprocessor/MacroExpander.cpp',
    '../compiler/preprocessor/Preprocessor.cpp',
    '../compiler/preprocessor/Token.cpp',
    '../compiler/preprocessor/Tokenizer.cpp',
    '../compiler/translator/AddAndTrueToLoopCondition.cpp',
    '../compiler/translator/AddDefaultReturnStatements.cpp',
    '../compiler/translator/ArrayReturnValueToOutParameter.cpp',
    '../compiler/translator/ASTMetadataHLSL.cpp',
    '../compiler/translator/blocklayout.cpp',
    '../compiler/translator/blocklayoutHLSL.cpp',
    '../compiler/translator/BreakVariableAliasingInInnerLoops.cpp',
    '../compiler/translator/BuiltInFunctionEmulator.cpp',
    '../compiler/translator/BuiltInFunctionEmulatorGLSL.cpp',
    '../compiler/translator/BuiltInFunctionEmulatorHLSL.cpp',
    '../compiler/translator/Cache.cpp',
    '../compiler/translator/CallDAG.cpp',
    '../compiler/translator/CodeGen.cpp',
    '../compiler/translator/Compiler.cpp',
    '../compiler/translator/ConstantUnion.cpp',
    '../compiler/translator/DeferGlobalInitializers.cpp',
    '../compiler/translator/Diagnostics.cpp',
    '../compiler/translator/DirectiveHandler.cpp',
    '../compiler/translator/EmulatePrecision.cpp',
    '../compiler/translator/ExpandIntegerPowExpressions.cpp',
    '../compiler/translator/ExtensionGLSL.cpp',
    '../compiler/translator/FlagStd140Structs.cpp',
    '../compiler/translator/ForLoopUnroll.cpp',
    '../compiler/translator/InfoSink.cpp',
    '../compiler/translator/Initialize.cpp',
    '../compiler/translator/InitializeDll.cpp',
    '../compiler/translator/InitializeParseContext.cpp',
    '../compiler/translator/InitializeVariables.cpp',
    '../compiler/translator/Intermediate.cpp',
    '../compiler/translator/IntermNode.cpp',
    '../compiler/translator/IntermNodePatternMatcher.cpp',
    '../compiler/translator/intermOut.cpp',
    '../compiler/translator/IntermTraverse.cpp',
    '../compiler/translator/LoopInfo.cpp',
    '../compiler/translator/Operator.cpp',
    '../compiler/translator/OutputESSL.cpp',
    '../compiler/translator/OutputGLSL.cpp',
    '../compiler/translator/OutputGLSLBase.cpp',
    '../compiler/translator/OutputHLSL.cpp',
    '../compiler/translator/ParseContext.cpp',
    '../compiler/translator/PoolAlloc.cpp',
    '../compiler/translator/PruneEmptyDeclarations.cpp',
    '../compiler/translator/QualifierTypes.cpp',
    '../compiler/translator/RecordConstantPrecision.cpp',
    '../compiler/translator/RegenerateStructNames.cpp',
    '../compiler/translator/RemoveDynamicIndexing.cpp',
    '../compiler/translator/RemoveInvariantDeclaration.cpp',
    '../compiler/translator/RemovePow.cpp',
    '../compiler/translator/RemoveSwitchFallThrough.cpp',
    '../compiler/translator/RewriteDoWhile.cpp',
    '../compiler/translator/RewriteElseBlocks.cpp',
    '../compiler/translator/RewriteUnaryMinusOperatorInt.cpp',
    '../compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp',
    '../compiler/translator/SearchSymbol.cpp',
    '../compiler/translator/SeparateArrayInitialization.cpp',
    '../compiler/translator/SeparateDeclarations.cpp',
    '../compiler/translator/SeparateExpressionsReturningArrays.cpp',
    '../compiler/translator/ShaderVars.cpp',
    '../compiler/translator/SimplifyLoopConditions.cpp',
    '../compiler/translator/SplitSequenceOperator.cpp',
    '../compiler/translator/StructureHLSL.cpp',
    '../compiler/translator/SymbolTable.cpp',
    '../compiler/translator/TextureFunctionHLSL.cpp',
    '../compiler/translator/TranslatorESSL.cpp',
    '../compiler/translator/TranslatorGLSL.cpp',
    '../compiler/translator/TranslatorHLSL.cpp',
    '../compiler/translator/Types.cpp',
    '../compiler/translator/UnfoldShortCircuitAST.cpp',
    '../compiler/translator/UnfoldShortCircuitToIf.cpp',
    '../compiler/translator/UniformHLSL.cpp',
    '../compiler/translator/UseInterfaceBlockFields.cpp',
    '../compiler/translator/util.cpp',
    '../compiler/translator/UtilsHLSL.cpp',
    '../compiler/translator/ValidateGlobalInitializer.cpp',
    '../compiler/translator/ValidateLimitations.cpp',
    '../compiler/translator/ValidateMaxParameters.cpp',
    '../compiler/translator/ValidateOutputs.cpp',
    '../compiler/translator/ValidateSwitch.cpp',
    '../compiler/translator/VariableInfo.cpp',
    '../compiler/translator/VariablePacker.cpp',
    '../compiler/translator/VersionGLSL.cpp',
    '../image_util/copyimage.cpp',
    '../image_util/imageformats.cpp',
    '../image_util/loadimage.cpp',
    '../image_util/loadimage_etc.cpp',
    '../third_party/compiler/ArrayBoundsClamper.cpp',
    '../third_party/murmurhash/MurmurHash3.cpp',
    '../third_party/systeminfo/SystemInfo.cpp',
    'angletypes.cpp',
    'AttributeMap.cpp',
    'Buffer.cpp',
    'Caps.cpp',
    'Compiler.cpp',
    'Config.cpp',
    'Context.cpp',
    'ContextState.cpp',
    'Debug.cpp',
    'Device.cpp',
    'Error.cpp',
    'es3_copy_conversion_table_autogen.cpp',
    'Fence.cpp',
    'format_map_autogen.cpp',
    'formatutils.cpp',
    'Framebuffer.cpp',
    'FramebufferAttachment.cpp',
    'HandleAllocator.cpp',
    'HandleRangeAllocator.cpp',
    'Image.cpp',
    'ImageIndex.cpp',
    'IndexRangeCache.cpp',
    'Path.cpp',
    'Platform.cpp',
    'Program.cpp',
    'Query.cpp',
    'queryconversions.cpp',
    'queryutils.cpp',
    'Renderbuffer.cpp',
    'renderer/ContextImpl.cpp',
    'renderer/d3d/BufferD3D.cpp',
    'renderer/d3d/CompilerD3D.cpp',
    'renderer/d3d/d3d9/Blit9.cpp',
    'renderer/d3d/d3d9/Buffer9.cpp',
    'renderer/d3d/d3d9/Context9.cpp',
    'renderer/d3d/d3d9/DebugAnnotator9.cpp',
    'renderer/d3d/d3d9/Fence9.cpp',
    'renderer/d3d/d3d9/formatutils9.cpp',
    'renderer/d3d/d3d9/Framebuffer9.cpp',
    'renderer/d3d/d3d9/Image9.cpp',
    'renderer/d3d/d3d9/IndexBuffer9.cpp',
    'renderer/d3d/d3d9/NativeWindow9.cpp',
    'renderer/d3d/d3d9/Query9.cpp',
    'renderer/d3d/d3d9/Renderer9.cpp',
    'renderer/d3d/d3d9/renderer9_utils.cpp',
    'renderer/d3d/d3d9/RenderTarget9.cpp',
    'renderer/d3d/d3d9/ShaderExecutable9.cpp',
    'renderer/d3d/d3d9/StateManager9.cpp',
    'renderer/d3d/d3d9/SwapChain9.cpp',
    'renderer/d3d/d3d9/TextureStorage9.cpp',
    'renderer/d3d/d3d9/VertexBuffer9.cpp',
    'renderer/d3d/d3d9/VertexDeclarationCache.cpp',
    'renderer/d3d/DeviceD3D.cpp',
    'renderer/d3d/DynamicHLSL.cpp',
    'renderer/d3d/EGLImageD3D.cpp',
    'renderer/d3d/FramebufferD3D.cpp',
    'renderer/d3d/ImageD3D.cpp',
    'renderer/d3d/IndexBuffer.cpp',
    'renderer/d3d/IndexDataManager.cpp',
    'renderer/d3d/NativeWindowD3D.cpp',
    'renderer/d3d/ProgramD3D.cpp',
    'renderer/d3d/RenderbufferD3D.cpp',
    'renderer/d3d/RendererD3D.cpp',
    'renderer/d3d/RenderTargetD3D.cpp',
    'renderer/d3d/ShaderD3D.cpp',
    'renderer/d3d/ShaderExecutableD3D.cpp',
    'renderer/d3d/SurfaceD3D.cpp',
    'renderer/d3d/SwapChainD3D.cpp',
    'renderer/d3d/TextureD3D.cpp',
    'renderer/d3d/VaryingPacking.cpp',
    'renderer/d3d/VertexBuffer.cpp',
    'renderer/d3d/VertexDataManager.cpp',
    'renderer/DeviceImpl.cpp',
    'renderer/DisplayImpl.cpp',
    'renderer/driver_utils.cpp',
    'renderer/Format_table_autogen.cpp',
    'renderer/gl/BlitGL.cpp',
    'renderer/gl/BufferGL.cpp',
    'renderer/gl/CompilerGL.cpp',
    'renderer/gl/ContextGL.cpp',
    'renderer/gl/DisplayGL.cpp',
    'renderer/gl/FenceNVGL.cpp',
    'renderer/gl/FenceSyncGL.cpp',
    'renderer/gl/formatutilsgl.cpp',
    'renderer/gl/FramebufferGL.cpp',
    'renderer/gl/FunctionsGL.cpp',
    'renderer/gl/PathGL.cpp',
    'renderer/gl/ProgramGL.cpp',
    'renderer/gl/QueryGL.cpp',
    'renderer/gl/RenderbufferGL.cpp',
    'renderer/gl/RendererGL.cpp',
    'renderer/gl/renderergl_utils.cpp',
    'renderer/gl/SamplerGL.cpp',
    'renderer/gl/ShaderGL.cpp',
    'renderer/gl/StateManagerGL.cpp',
    'renderer/gl/SurfaceGL.cpp',
    'renderer/gl/TextureGL.cpp',
    'renderer/gl/TransformFeedbackGL.cpp',
    'renderer/gl/VertexArrayGL.cpp',
    'renderer/gl/wgl/D3DTextureSurfaceWGL.cpp',
    'renderer/gl/wgl/DisplayWGL.cpp',
    'renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp',
    'renderer/gl/wgl/FunctionsWGL.cpp',
    'renderer/gl/wgl/PbufferSurfaceWGL.cpp',
    'renderer/gl/wgl/wgl_utils.cpp',
    'renderer/gl/wgl/WindowSurfaceWGL.cpp',
    'renderer/load_functions_table_autogen.cpp',
    'renderer/null/BufferNULL.cpp',
    'renderer/null/CompilerNULL.cpp',
    'renderer/null/ContextNULL.cpp',
    'renderer/null/DeviceNULL.cpp',
    'renderer/null/DisplayNULL.cpp',
    'renderer/null/FenceNVNULL.cpp',
    'renderer/null/FenceSyncNULL.cpp',
    'renderer/null/FramebufferNULL.cpp',
    'renderer/null/ImageNULL.cpp',
    'renderer/null/PathNULL.cpp',
    'renderer/null/ProgramNULL.cpp',
    'renderer/null/QueryNULL.cpp',
    'renderer/null/RenderbufferNULL.cpp',
    'renderer/null/SamplerNULL.cpp',
    'renderer/null/ShaderNULL.cpp',
    'renderer/null/SurfaceNULL.cpp',
    'renderer/null/TextureNULL.cpp',
    'renderer/null/TransformFeedbackNULL.cpp',
    'renderer/null/VertexArrayNULL.cpp',
    'renderer/renderer_utils.cpp',
    'renderer/SurfaceImpl.cpp',
    'renderer/TextureImpl.cpp',
    'renderer/vulkan/BufferVk.cpp',
    'renderer/vulkan/CompilerVk.cpp',
    'renderer/vulkan/ContextVk.cpp',
    'renderer/vulkan/DeviceVk.cpp',
    'renderer/vulkan/DisplayVk.cpp',
    'renderer/vulkan/FenceNVVk.cpp',
    'renderer/vulkan/FenceSyncVk.cpp',
    'renderer/vulkan/FramebufferVk.cpp',
    'renderer/vulkan/ImageVk.cpp',
    'renderer/vulkan/ProgramVk.cpp',
    'renderer/vulkan/QueryVk.cpp',
    'renderer/vulkan/RenderbufferVk.cpp',
    'renderer/vulkan/RendererVk.cpp',
    'renderer/vulkan/SamplerVk.cpp',
    'renderer/vulkan/ShaderVk.cpp',
    'renderer/vulkan/SurfaceVk.cpp',
    'renderer/vulkan/TextureVk.cpp',
    'renderer/vulkan/TransformFeedbackVk.cpp',
    'renderer/vulkan/VertexArrayVk.cpp',
    'ResourceManager.cpp',
    'Sampler.cpp',
    'Shader.cpp',
    'signal_utils.cpp',
    'State.cpp',
    'Stream.cpp',
    'Surface.cpp',
    'Texture.cpp',
    'Thread.cpp',
    'TransformFeedback.cpp',
    'Uniform.cpp',
    'validationEGL.cpp',
    'validationES.cpp',
    'validationES2.cpp',
    'validationES3.cpp',
    'validationES31.cpp',
    'VertexArray.cpp',
    'VertexAttribute.cpp',
]
SOURCES += [
    '../compiler/translator/EmulateGLFragColorBroadcast.cpp',
    '../compiler/translator/glslang_lex.cpp',
    '../compiler/translator/glslang_tab.cpp',
    '../compiler/translator/RewriteTexelFetchOffset.cpp',
    '../compiler/translator/ShaderLang.cpp',
    'Display.cpp',
    'renderer/d3d/DisplayD3D.cpp',
    'renderer/d3d/HLSLCompiler.cpp',
]
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    UNIFIED_SOURCES += [
        'renderer/d3d/d3d11/Blit11.cpp',
        'renderer/d3d/d3d11/Buffer11.cpp',
        'renderer/d3d/d3d11/Clear11.cpp',
        'renderer/d3d/d3d11/Context11.cpp',
        'renderer/d3d/d3d11/DebugAnnotator11.cpp',
        'renderer/d3d/d3d11/dxgi_format_map_autogen.cpp',
        'renderer/d3d/d3d11/dxgi_support_table.cpp',
        'renderer/d3d/d3d11/Fence11.cpp',
        'renderer/d3d/d3d11/formatutils11.cpp',
        'renderer/d3d/d3d11/Framebuffer11.cpp',
        'renderer/d3d/d3d11/Image11.cpp',
        'renderer/d3d/d3d11/IndexBuffer11.cpp',
        'renderer/d3d/d3d11/InputLayoutCache.cpp',
        'renderer/d3d/d3d11/PixelTransfer11.cpp',
        'renderer/d3d/d3d11/Query11.cpp',
        'renderer/d3d/d3d11/Renderer11.cpp',
        'renderer/d3d/d3d11/renderer11_utils.cpp',
        'renderer/d3d/d3d11/RenderStateCache.cpp',
        'renderer/d3d/d3d11/RenderTarget11.cpp',
        'renderer/d3d/d3d11/ShaderExecutable11.cpp',
        'renderer/d3d/d3d11/StateManager11.cpp',
        'renderer/d3d/d3d11/StreamProducerNV12.cpp',
        'renderer/d3d/d3d11/texture_format_table.cpp',
        'renderer/d3d/d3d11/texture_format_table_autogen.cpp',
        'renderer/d3d/d3d11/TextureStorage11.cpp',
        'renderer/d3d/d3d11/TransformFeedback11.cpp',
        'renderer/d3d/d3d11/Trim11.cpp',
        'renderer/d3d/d3d11/VertexArray11.cpp',
        'renderer/d3d/d3d11/VertexBuffer11.cpp',
    ]
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    SOURCES += [
        'renderer/d3d/d3d11/SwapChain11.cpp',
        'renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp',
    ]

CXXFLAGS += CONFIG['SSE2_FLAGS']

if CONFIG['GNU_CXX']:
    CXXFLAGS += [
        '-Wno-attributes',
        '-Wno-shadow',
        '-Wno-sign-compare',
        '-Wno-unknown-pragmas',
        '-Wno-unreachable-code',
    ]
    if CONFIG['CLANG_CXX']:
        CXXFLAGS += [
            '-Wno-inconsistent-missing-override',
            '-Wno-unused-private-field',
        ]
    else:
        CXXFLAGS += [
            '-Wno-shadow-compatible-local',
            '-Wno-shadow-local',
        ]

DEFINES['_CRT_SECURE_NO_DEPRECATE'] = True
DEFINES['_HAS_EXCEPTIONS'] = 0

if not CONFIG['MOZ_DEBUG']:
    DEFINES['_SECURE_SCL'] = 0

DEFINES['ANGLE_ENABLE_D3D9'] = True
DEFINES['ANGLE_SKIP_DXGI_1_2_CHECK'] = True
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    DEFINES['ANGLE_ENABLE_D3D11'] = True

DEFINES['ANGLE_COMPILE_OPTIMIZATION_LEVEL'] = 'D3DCOMPILE_OPTIMIZATION_LEVEL1'
DEFINES['ANGLE_NO_EXCEPTIONS'] = True

# We need these defined to nothing so that we don't get bogus dllimport declspecs
DEFINES['GL_APICALL'] = ""
DEFINES['GL_GLEXT_PROTOTYPES'] = ""
DEFINES['EGLAPI'] = ""



LOCAL_INCLUDES += [ '../../include', '../../src', '../../src/common/third_party/numerics', '../../src/third_party/khronos' ]

DEFINES['LIBANGLE_IMPLEMENTATION'] = "1"
DEFINES['ANGLE_ENABLE_HLSL'] = "1"
DEFINES['ANGLE_ENABLE_GLSL'] = "1"
DEFINES['ANGLE_ENABLE_ESSL'] = "1"
DEFINES['ANGLE_ENABLE_KEYEDMUTEX'] = "1"
DEFINES['ANGLE_DEFAULT_D3D11'] = "0"

if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
  OS_LIBS += [ 'd3d9', 'dxguid' ]

Library('libANGLE')


SOURCES['renderer/d3d/HLSLCompiler.cpp'].flags += ['-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES=\'{ TEXT("d3dcompiler_47.dll"), TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }\'']

if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
    SOURCES['renderer/d3d/d3d11/SwapChain11.cpp'].flags += ['-DANGLE_RESOURCE_SHARE_TYPE=D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX']

# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True