Fix Windows WebGL build after r209832
[WebKit-https.git] / Source / ThirdParty / ANGLE / CMakeLists.txt
1 include_directories(
2     .
3     src
4     src/common/third_party/numerics
5     include
6     include/KHR
7 )
8
9 set(ANGLEEGL_SOURCES
10     src/libEGL/libEGL.cpp
11 )
12
13 set(ANGLEEGL_COMPILE_DEFINITIONS
14     EGLAPI=
15 )
16
17 set(ANGLEGLESv2_SOURCES
18     src/libGLESv2/entry_points_egl.cpp
19     src/libGLESv2/entry_points_egl_ext.cpp
20     src/libGLESv2/entry_points_gles_2_0.cpp
21     src/libGLESv2/entry_points_gles_2_0_ext.cpp
22     src/libGLESv2/entry_points_gles_3_0.cpp
23     src/libGLESv2/entry_points_gles_3_1.cpp
24     src/libGLESv2/global_state.cpp
25     src/libGLESv2/libGLESv2.cpp
26 )
27
28 set(ANGLEGLESv2_COMPILE_DEFINITIONS
29     GL_APICALL=
30     LIBGLESV2_IMPLEMENTATION
31 )
32
33 set(ANGLEGLESv2_LIBRARIES
34     libANGLE
35 )
36
37 set(ANGLE_SOURCES
38     src/common/angleutils.cpp
39     src/common/debug.cpp
40     src/common/event_tracer.cpp
41     src/common/Float16ToFloat32.cpp
42     src/common/mathutil.cpp
43     src/common/MemoryBuffer.cpp
44     src/common/string_utils.cpp
45     src/common/tls.cpp
46     src/common/utilities.cpp
47     src/compiler/preprocessor/DiagnosticsBase.cpp
48     src/compiler/preprocessor/DirectiveHandlerBase.cpp
49     src/compiler/preprocessor/DirectiveParser.cpp
50     src/compiler/preprocessor/ExpressionParser.cpp
51     src/compiler/preprocessor/Input.cpp
52     src/compiler/preprocessor/Lexer.cpp
53     src/compiler/preprocessor/Macro.cpp
54     src/compiler/preprocessor/MacroExpander.cpp
55     src/compiler/preprocessor/Preprocessor.cpp
56     src/compiler/preprocessor/Token.cpp
57     src/compiler/preprocessor/Tokenizer.cpp
58     src/compiler/translator/AddAndTrueToLoopCondition.cpp
59     src/compiler/translator/AddDefaultReturnStatements.cpp
60     src/compiler/translator/ArrayReturnValueToOutParameter.cpp
61     src/compiler/translator/blocklayout.cpp
62     src/compiler/translator/BreakVariableAliasingInInnerLoops.cpp
63     src/compiler/translator/BuiltInFunctionEmulator.cpp
64     src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
65     src/compiler/translator/Cache.cpp
66     src/compiler/translator/CallDAG.cpp
67     src/compiler/translator/CodeGen.cpp
68     src/compiler/translator/Compiler.cpp
69     src/compiler/translator/ConstantUnion.cpp
70     src/compiler/translator/DeferGlobalInitializers.cpp
71     src/compiler/translator/Diagnostics.cpp
72     src/compiler/translator/DirectiveHandler.cpp
73     src/compiler/translator/EmulateGLFragColorBroadcast.cpp
74     src/compiler/translator/EmulatePrecision.cpp
75     src/compiler/translator/ExpandIntegerPowExpressions.cpp
76     src/compiler/translator/ExtensionGLSL.cpp
77     src/compiler/translator/FlagStd140Structs.cpp
78     src/compiler/translator/ForLoopUnroll.cpp
79     src/compiler/translator/glslang_lex.cpp
80     src/compiler/translator/glslang_tab.cpp
81     src/compiler/translator/InfoSink.cpp
82     src/compiler/translator/Initialize.cpp
83     src/compiler/translator/InitializeDll.cpp
84     src/compiler/translator/InitializeParseContext.cpp
85     src/compiler/translator/InitializeVariables.cpp
86     src/compiler/translator/Intermediate.cpp
87     src/compiler/translator/IntermNode.cpp
88     src/compiler/translator/IntermNodePatternMatcher.cpp
89     src/compiler/translator/intermOut.cpp
90     src/compiler/translator/IntermTraverse.cpp
91     src/compiler/translator/LoopInfo.cpp
92     src/compiler/translator/Operator.cpp
93     src/compiler/translator/OutputESSL.cpp
94     src/compiler/translator/OutputGLSL.cpp
95     src/compiler/translator/OutputGLSLBase.cpp
96     src/compiler/translator/ParseContext.cpp
97     src/compiler/translator/PoolAlloc.cpp
98     src/compiler/translator/PruneEmptyDeclarations.cpp
99     src/compiler/translator/QualifierTypes.cpp
100     src/compiler/translator/RecordConstantPrecision.cpp
101     src/compiler/translator/RegenerateStructNames.cpp
102     src/compiler/translator/RemoveDynamicIndexing.cpp
103     src/compiler/translator/RemovePow.cpp
104     src/compiler/translator/RemoveSwitchFallThrough.cpp
105     src/compiler/translator/RewriteDoWhile.cpp
106     src/compiler/translator/RewriteElseBlocks.cpp
107     src/compiler/translator/RewriteTexelFetchOffset.cpp
108     src/compiler/translator/RewriteUnaryMinusOperatorInt.cpp
109     src/compiler/translator/ScalarizeVecAndMatConstructorArgs.cpp
110     src/compiler/translator/SearchSymbol.cpp
111     src/compiler/translator/SearchSymbol.cpp
112     src/compiler/translator/SearchSymbol.cpp
113     src/compiler/translator/SeparateDeclarations.cpp
114     src/compiler/translator/SeparateExpressionsReturningArrays.cpp
115     src/compiler/translator/ShaderLang.cpp
116     src/compiler/translator/ShaderVars.cpp
117     src/compiler/translator/SimplifyLoopConditions.cpp
118     src/compiler/translator/SplitSequenceOperator.cpp
119     src/compiler/translator/SymbolTable.cpp
120     src/compiler/translator/TranslatorESSL.cpp
121     src/compiler/translator/TranslatorGLSL.cpp
122     src/compiler/translator/Types.cpp
123     src/compiler/translator/UnfoldShortCircuitAST.cpp
124     src/compiler/translator/UnfoldShortCircuitToIf.cpp
125     src/compiler/translator/UseInterfaceBlockFields.cpp
126     src/compiler/translator/util.cpp
127     src/compiler/translator/ValidateGlobalInitializer.cpp
128     src/compiler/translator/ValidateLimitations.cpp
129     src/compiler/translator/ValidateMaxParameters.cpp
130     src/compiler/translator/ValidateOutputs.cpp
131     src/compiler/translator/ValidateSwitch.cpp
132     src/compiler/translator/VariableInfo.cpp
133     src/compiler/translator/VariablePacker.cpp
134     src/compiler/translator/VersionGLSL.cpp
135     src/compiler/translator/VersionGLSL.cpp
136     src/image_util/copyimage.cpp
137     src/image_util/imageformats.cpp
138     src/image_util/loadimage_etc.cpp
139     src/image_util/loadimage.cpp
140     src/libANGLE/angletypes.cpp
141     src/libANGLE/AttributeMap.cpp
142     src/libANGLE/Buffer.cpp
143     src/libANGLE/Caps.cpp
144     src/libANGLE/Compiler.cpp
145     src/libANGLE/Config.cpp
146     src/libANGLE/Context.cpp
147     src/libANGLE/ContextState.cpp
148     src/libANGLE/Debug.cpp
149     src/libANGLE/Device.cpp
150     src/libANGLE/Display.cpp
151     src/libANGLE/Error.cpp
152     src/libANGLE/Fence.cpp
153     src/libANGLE/format_map_autogen.cpp
154     src/libANGLE/formatutils.cpp
155     src/libANGLE/Framebuffer.cpp
156     src/libANGLE/FramebufferAttachment.cpp
157     src/libANGLE/HandleAllocator.cpp
158     src/libANGLE/HandleRangeAllocator.cpp
159     src/libANGLE/Image.cpp
160     src/libANGLE/ImageIndex.cpp
161     src/libANGLE/IndexRangeCache.cpp
162     src/libANGLE/Path.cpp
163     src/libANGLE/Platform.cpp
164     src/libANGLE/Program.cpp
165     src/libANGLE/Query.cpp
166     src/libANGLE/queryconversions.cpp
167     src/libANGLE/queryutils.cpp
168     src/libANGLE/Renderbuffer.cpp
169     src/libANGLE/renderer/ContextImpl.cpp
170     src/libANGLE/renderer/DeviceImpl.cpp
171     src/libANGLE/renderer/DisplayImpl.cpp
172     src/libANGLE/renderer/Format_autogen.cpp
173     src/libANGLE/renderer/Format.cpp
174     src/libANGLE/renderer/load_functions_table_autogen.cpp
175     src/libANGLE/renderer/renderer_utils.cpp
176     src/libANGLE/renderer/SurfaceImpl.cpp
177     src/libANGLE/renderer/TextureImpl.cpp
178     src/libANGLE/ResourceManager.cpp
179     src/libANGLE/Sampler.cpp
180     src/libANGLE/Shader.cpp
181     src/libANGLE/signal_utils.cpp
182     src/libANGLE/State.cpp
183     src/libANGLE/Stream.cpp
184     src/libANGLE/Surface.cpp
185     src/libANGLE/Texture.cpp
186     src/libANGLE/TransformFeedback.cpp
187     src/libANGLE/Uniform.cpp
188     src/libANGLE/validationEGL.cpp
189     src/libANGLE/validationES.cpp
190     src/libANGLE/validationES2.cpp
191     src/libANGLE/validationES3.cpp
192     src/libANGLE/validationES31.cpp
193     src/libANGLE/VertexArray.cpp
194     src/libANGLE/VertexAttribute.cpp
195     src/third_party/compiler/ArrayBoundsClamper.cpp
196     src/third_party/murmurhash/MurmurHash3.cpp
197 )
198
199 set(ANGLE_COMPILE_DEFINITIONS
200     ANGLE_ENABLE_ESSL
201     ANGLE_ENABLE_GLSL
202     LIBANGLE_IMPLEMENTATION
203     NOMINMAX
204 )
205
206 if (NOT WIN32)
207     list(APPEND ANGLE_SOURCES
208         src/libANGLE/renderer/gl/BlitGL.cpp
209         src/libANGLE/renderer/gl/BufferGL.cpp
210         src/libANGLE/renderer/gl/CompilerGL.cpp
211         src/libANGLE/renderer/gl/ContextGL.cpp
212         src/libANGLE/renderer/gl/DisplayGL.cpp
213         src/libANGLE/renderer/gl/FenceNVGL.cpp
214         src/libANGLE/renderer/gl/FenceSyncGL.cpp
215         src/libANGLE/renderer/gl/FramebufferGL.cpp
216         src/libANGLE/renderer/gl/FunctionsGL.cpp
217         src/libANGLE/renderer/gl/PathGL.cpp
218         src/libANGLE/renderer/gl/ProgramGL.cpp
219         src/libANGLE/renderer/gl/QueryGL.cpp
220         src/libANGLE/renderer/gl/RenderbufferGL.cpp
221         src/libANGLE/renderer/gl/RendererGL.cpp
222         src/libANGLE/renderer/gl/SamplerGL.cpp
223         src/libANGLE/renderer/gl/ShaderGL.cpp
224         src/libANGLE/renderer/gl/StateManagerGL.cpp
225         src/libANGLE/renderer/gl/SurfaceGL.cpp
226         src/libANGLE/renderer/gl/TextureGL.cpp
227         src/libANGLE/renderer/gl/TransformFeedbackGL.cpp
228         src/libANGLE/renderer/gl/VertexArrayGL.cpp
229         src/libANGLE/renderer/gl/formatutilsgl.cpp
230         src/libANGLE/renderer/gl/renderergl_utils.cpp
231     )
232     list(APPEND ANGLE_COMPILE_DEFINITIONS
233         ANGLE_ENABLE_OPENGL
234     )
235 endif ()
236
237 WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
238
239 add_library(libEGL SHARED ${ANGLEEGL_SOURCES})
240 set_property(TARGET libEGL PROPERTY COMPILE_DEFINITIONS ${ANGLEEGL_COMPILE_DEFINITIONS})
241
242 add_library(libGLESv2 SHARED ${ANGLEGLESv2_SOURCES})
243 set_property(TARGET libGLESv2 PROPERTY COMPILE_DEFINITIONS ${ANGLEGLESv2_COMPILE_DEFINITIONS})
244
245 add_library(libANGLE STATIC ${ANGLE_SOURCES})
246 set_property(TARGET libANGLE PROPERTY COMPILE_DEFINITIONS ${ANGLE_COMPILE_DEFINITIONS})
247
248 target_link_libraries(libEGL
249     libGLESv2
250 )
251
252 target_link_libraries(libGLESv2 ${ANGLEGLESv2_LIBRARIES})
253
254 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/egl)
255 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/GLES2)
256 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/GLSLANG)
257 file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/khr)
258 file(GLOB _files_ANGLE "${THIRDPARTY_DIR}/ANGLE/ANGLE/*.h")
259 file(GLOB _files_egl "${THIRDPARTY_DIR}/ANGLE/include/egl/*.h")
260 file(GLOB _files_GLES2 "${THIRDPARTY_DIR}/ANGLE/include/GLES2/*.h")
261 file(GLOB _files_GLES3 "${THIRDPARTY_DIR}/ANGLE/include/GLES3/*.h")
262 file(GLOB _files_GLSLANG "${THIRDPARTY_DIR}/ANGLE/include/GLSLANG/*.h")
263 file(GLOB _files_khr "${THIRDPARTY_DIR}/ANGLE/include/khr/*.h")
264 foreach (_file ${_files_ANGLE})
265     file(COPY ${_file} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/)
266 endforeach ()
267 foreach (_file ${_files_egl})
268     file(COPY ${_file} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/egl)
269 endforeach ()
270 foreach (_file ${_files_GLES2})
271     file(COPY ${_file} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/GLES2)
272 endforeach ()
273 foreach (_file ${_files_GLES3})
274     file(COPY ${_file} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/GLES3)
275 endforeach ()
276 foreach (_file ${_files_GLSLANG})
277     file(COPY ${_file} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/GLSLANG)
278 endforeach ()
279 foreach (_file ${_files_khr})
280     file(COPY ${_file} DESTINATION ${DERIVED_SOURCES_DIR}/ForwardingHeaders/ANGLE/include/khr)
281 endforeach ()
282
283 set_property(DIRECTORY . PROPERTY FOLDER "ANGLE")