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