blob: 9711bb9f6ad4d1c3ac5b4032a7c0cf0172d3b804 [file] [log] [blame]
Courtney Goeltzenleuchtere06e72d2014-08-01 12:44:23 -06001# Create the i965 XGL DRI library
Cody Northrop0eb5eea2014-09-19 15:11:52 -06002
3# Mesa required defines
Cody Northrope8455b12014-09-17 16:18:12 -06004add_definitions(-D_GNU_SOURCE -DHAVE_PTHREAD)
Cody Northrop0eb5eea2014-09-19 15:11:52 -06005# LLVM required defines
6add_definitions(-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS)
Cody Northrope8455b12014-09-17 16:18:12 -06007
Mark Lobodzinski953a1692015-01-09 15:12:03 -06008set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXGL_PROTOTYPES")
9
Cody Northrop065538b2014-12-05 14:20:04 -070010# DEBUG and NDEBUG flags are important for proper mesa behavior
11set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")
12set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")
13set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
14set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
15
Cody Northrope8455b12014-09-17 16:18:12 -060016# LunarG TODO: Get the llvm-config flags hooked up correctly and remove extra definitions from above
17
Steve K14e09812014-09-19 09:45:36 -060018execute_process(COMMAND ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/bin/llvm-config --libs engine bitwriter
19 OUTPUT_VARIABLE LLVM_LIBS_ALL_1
20 RESULT_VARIABLE LLVM_LIBS_RESULT)
21
Cody Northrop0eb5eea2014-09-19 15:11:52 -060022string(REPLACE "\n" "" LLVM_LIBS_ALL ${LLVM_LIBS_ALL_1})
23message(STATUS "llvm-config lib results")
24message(STATUS ${LLVM_LIBS_ALL})
25
Steve K66d40802014-09-19 09:59:26 -060026if(NOT "${LLVM_LIBS_RESULT}" EQUAL "0")
27 message(FATAL_ERROR "llvm-config failed: " ${LLVM_LIBS_RESULT})
Steve K14e09812014-09-19 09:45:36 -060028endif()
29
Courtney Goeltzenleuchter62b2e852014-10-03 15:34:53 -060030# Expect libraries to be in either the build (release build) or dbuild (debug) directories
31if(EXISTS ${GLSLANG_PREFIX}/build/install/lib)
32 set(GLSLANG_BUILD ${GLSLANG_PREFIX}/build)
33elseif(EXISTS ${GLSLANG_PREFIX}/dbuild/install/lib)
34 set(GLSLANG_BUILD ${GLSLANG_PREFIX}/dbuild)
35else()
36 message(FATAL_ERROR "Necessary glslang libraries cannot be found: " ${GLSLANG_PREFIX})
37endif()
38
39if(EXISTS ${LUNARGLASS_PREFIX}/build/install/lib)
40 set(LUNARGLASS_BUILD ${LUNARGLASS_PREFIX}/build)
41elseif(EXISTS ${LUNARGLASS_PREFIX}/dbuild/install/lib)
42 set(LUNARGLASS_BUILD ${LUNARGLASS_PREFIX}/dbuild)
43else()
44 message(FATAL_ERROR "Necessary LunarGLASS libraries cannot be found: " ${LUNARGLASS_PREFIX})
45endif()
Cody Northrope8455b12014-09-17 16:18:12 -060046
Cody Northrop0eb5eea2014-09-19 15:11:52 -060047execute_process(COMMAND ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/bin/llvm-config --cxxflags
48 OUTPUT_VARIABLE LLVM_CXX_CONFIG_ALL_1
Steve K66d40802014-09-19 09:59:26 -060049 RESULT_VARIABLE LLVM_CXX_CONFIG_RESULT)
50
Cody Northrop0eb5eea2014-09-19 15:11:52 -060051string(REPLACE "\n" "" LLVM_CXX_CONFIG_ALL ${LLVM_CXX_CONFIG_ALL_1})
52string(REPLACE "-Woverloaded-virtual" "" LLVM_CXX_CONFIG_1 ${LLVM_CXX_CONFIG_ALL})
53string(REPLACE "-fvisibility-inlines-hidden" "" LLVM_CXX_CONFIG ${LLVM_CXX_CONFIG_1})
54message(STATUS "llvm-config cxxflags results")
55message(STATUS ${LLVM_CXX_CONFIG})
56
Steve K66d40802014-09-19 09:59:26 -060057# if(NOT "${LLVM_CXX_CONFIG_RESULT}" EQUAL "0")
58# message(FATAL_ERROR "llvm-config failed: " ${LLVM_CXX_CONFIG_RESULT})
59# endif()
60
Steve K66d40802014-09-19 09:59:26 -060061
62set_target_properties(icd
63 PROPERTIES
64 COMPILE_FLAGS "${LLVM_CXX_CONFIG}")
65
Cody Northrope8455b12014-09-17 16:18:12 -060066SET(COMPILER_LINK_DIRS
Courtney Goeltzenleuchter62b2e852014-10-03 15:34:53 -060067 ${GLSLANG_BUILD}/install/lib
Cody Northrope8455b12014-09-17 16:18:12 -060068 ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/lib
Steve K42652ba2014-10-07 10:44:41 -060069 ${LUNARGLASS_PREFIX}/build/Core
70 ${LUNARGLASS_PREFIX}/build/Frontends/glslang
71 ${LUNARGLASS_PREFIX}/build/Frontends/Bil
72 ${LUNARGLASS_PREFIX}/build/Core/Passes/Transforms
73 ${LUNARGLASS_PREFIX}/build/Core/Passes/Immutable
74 ${LUNARGLASS_PREFIX}/build/Core/Passes/Analysis
75 ${LUNARGLASS_PREFIX}/build/Core/Passes/Util
Cody Northrope8455b12014-09-17 16:18:12 -060076)
Courtney Goeltzenleuchtere06e72d2014-08-01 12:44:23 -060077
Chia-I Wu22670d72015-01-10 23:59:54 +080078find_package(DRM REQUIRED COMPONENTS libdrm libdrm_intel)
Chia-I Wuddbc8e22014-09-18 17:05:09 +080079
Cody Northrope8455b12014-09-17 16:18:12 -060080link_directories (
81 ${ICD_LIBRARY_DIRS}
Cody Northrope8455b12014-09-17 16:18:12 -060082 ${COMPILER_LINK_DIRS}
Chia-I Wuddbc8e22014-09-18 17:05:09 +080083)
84
Cody Northrope8455b12014-09-17 16:18:12 -060085SET(COMPILER_LIBS
86 glslangFrontend
Steve K42652ba2014-10-07 10:44:41 -060087 BilFrontend
Cody Northrope8455b12014-09-17 16:18:12 -060088 core
89 LLVMipo
90 glslang
Steve K42652ba2014-10-07 10:44:41 -060091 BIL
Cody Northrope8455b12014-09-17 16:18:12 -060092 OGLCompiler
93 ${LLVM_LIBS_ALL}
Courtney Goeltzenleuchtere06e72d2014-08-01 12:44:23 -060094)
95
96link_libraries (
Chia-I Wucafc88a2015-01-04 00:31:33 +080097 icd
Cody Northrope8455b12014-09-17 16:18:12 -060098 ${ICD_LIBRARIES}
99 ${DRM_LIBRARIES}
100 ${COMPILER_LIBS}
101 m
Steve Kda224042014-09-19 08:46:17 -0600102 pthread
103 dl
Cody Northrope8455b12014-09-17 16:18:12 -0600104)
105
106SET(COMPILER_INCLUDE_DIRS
107 ${GLSLANG_PREFIX}
108 ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/include
109 ${LUNARGLASS_PREFIX}
Cody Northrop0eb5eea2014-09-19 15:11:52 -0600110 ${CMAKE_CURRENT_SOURCE_DIR}
Cody Northropbc851432014-09-23 10:06:32 -0600111 compiler/shader
Cody Northrope8455b12014-09-17 16:18:12 -0600112 compiler/mesa-utils/include
Cody Northropbc851432014-09-23 10:06:32 -0600113 compiler/mesa-utils/src
Cody Northrope8455b12014-09-17 16:18:12 -0600114 compiler/mesa-utils/src/glsl
115 compiler/mesa-utils/src/mesa
Cody Northropbc851432014-09-23 10:06:32 -0600116 compiler/mesa-utils/src/mesa/program
Cody Northrope8455b12014-09-17 16:18:12 -0600117 compiler/mesa-utils/src/mapi
118)
119
120include_directories (
121 ${ICD_INCLUDE_DIRS}
122 ${DRM_INCLUDE_DIRS}
123 ${COMPILER_INCLUDE_DIRS}
124)
125
126
127SET(COMPILER_SOURCES
128 compiler/shader/ast_array_index.cpp
129 compiler/shader/ast_expr.cpp
130 compiler/shader/ast_function.cpp
131 compiler/shader/ast_to_hir.cpp
132 compiler/shader/ast_type.cpp
133 compiler/shader/builtin_functions.cpp
134 compiler/shader/builtin_types.cpp
135 compiler/shader/builtin_variables.cpp
136 compiler/shader/ir.cpp
137 compiler/shader/ir_basic_block.cpp
138 compiler/shader/ir_builder.cpp
139 compiler/shader/ir_clone.cpp
140 compiler/shader/ir_constant_expression.cpp
141 compiler/shader/ir_deserializer.cpp
142 compiler/shader/ir_equals.cpp
143 compiler/shader/ir_expression_flattening.cpp
144 compiler/shader/ir_function_can_inline.cpp
145 compiler/shader/ir_function.cpp
146 compiler/shader/ir_function_detect_recursion.cpp
147 compiler/shader/ir_hierarchical_visitor.cpp
148 compiler/shader/ir_hv_accept.cpp
149 compiler/shader/ir_import_prototypes.cpp
150 compiler/shader/ir_print_visitor.cpp
151 compiler/shader/ir_reader.cpp
152 compiler/shader/ir_rvalue_visitor.cpp
153 compiler/shader/ir_serialize.cpp
154 compiler/shader/ir_set_program_inouts.cpp
155 compiler/shader/ir_validate.cpp
156 compiler/shader/ir_variable_refcount.cpp
157 compiler/shader/link_atomics.cpp
158 compiler/shader/linker.cpp
159 compiler/shader/link_functions.cpp
160 compiler/shader/link_interface_blocks.cpp
161 compiler/shader/link_uniform_block_active_visitor.cpp
162 compiler/shader/link_uniform_blocks.cpp
163 compiler/shader/link_uniform_initializers.cpp
164 compiler/shader/link_uniforms.cpp
165 compiler/shader/link_varyings.cpp
166 compiler/shader/loop_analysis.cpp
167 compiler/shader/loop_controls.cpp
168 compiler/shader/loop_unroll.cpp
169 compiler/shader/lower_clip_distance.cpp
170 compiler/shader/lower_discard.cpp
171 compiler/shader/lower_discard_flow.cpp
172 compiler/shader/lower_if_to_cond_assign.cpp
173 compiler/shader/lower_instructions.cpp
174 compiler/shader/lower_jumps.cpp
175 compiler/shader/lower_mat_op_to_vec.cpp
176 compiler/shader/lower_named_interface_blocks.cpp
177 compiler/shader/lower_noise.cpp
178 compiler/shader/lower_offset_array.cpp
179 compiler/shader/lower_output_reads.cpp
180 compiler/shader/lower_packed_varyings.cpp
181 compiler/shader/lower_packing_builtins.cpp
182 compiler/shader/lower_texture_projection.cpp
183 compiler/shader/lower_ubo_reference.cpp
184 compiler/shader/lower_variable_index_to_cond_assign.cpp
185 compiler/shader/lower_vec_index_to_cond_assign.cpp
186 compiler/shader/lower_vec_index_to_swizzle.cpp
187 compiler/shader/lower_vector.cpp
188 compiler/shader/lower_vector_insert.cpp
189 compiler/shader/opt_algebraic.cpp
190 compiler/shader/opt_array_splitting.cpp
191 compiler/shader/opt_constant_folding.cpp
192 compiler/shader/opt_constant_propagation.cpp
193 compiler/shader/opt_constant_variable.cpp
194 compiler/shader/opt_copy_propagation.cpp
195 compiler/shader/opt_copy_propagation_elements.cpp
196 compiler/shader/opt_cse.cpp
197 compiler/shader/opt_dead_builtin_varyings.cpp
198 compiler/shader/opt_dead_code.cpp
199 compiler/shader/opt_dead_code_local.cpp
200 compiler/shader/opt_dead_functions.cpp
201 compiler/shader/opt_flatten_nested_if_blocks.cpp
202 compiler/shader/opt_flip_matrices.cpp
203 compiler/shader/opt_function_inlining.cpp
204 compiler/shader/opt_if_simplification.cpp
205 compiler/shader/opt_noop_swizzle.cpp
206 compiler/shader/opt_redundant_jumps.cpp
207 compiler/shader/opt_structure_splitting.cpp
208 compiler/shader/opt_swizzle_swizzle.cpp
209 compiler/shader/opt_tree_grafting.cpp
210 compiler/shader/opt_vectorize.cpp
211 compiler/shader/s_expression.cpp
212# compiler/shader/shader_deserialize.cpp
213# compiler/shader/shader_serialize.cpp
214# compiler/shader/standalone_scaffolding.cpp
215 compiler/shader/strtod.cpp
216
217 compiler/mesa-utils/src/glsl/ralloc.c
218 compiler/mesa-utils/src/mesa/program/program.c
219# compiler/mesa-utils/src/mesa/program/prog_execute.c
220 # compiler/mesa-utils/src/mesa/program/prog_noise.c
Steve Kda224042014-09-19 08:46:17 -0600221 compiler/mesa-utils/src/mesa/program/prog_statevars.c
Cody Northrope8455b12014-09-17 16:18:12 -0600222 # compiler/mesa-utils/src/mesa/program/prog_opt_constant_fold.c
223 compiler/mesa-utils/src/mesa/program/symbol_table.c
Steve Kda224042014-09-19 08:46:17 -0600224# compiler/mesa-utils/src/mesa/program/prog_cache.c
Cody Northrope8455b12014-09-17 16:18:12 -0600225 compiler/mesa-utils/src/mesa/program/prog_instruction.c
226 # compiler/mesa-utils/src/mesa/program/prog_optimize.c
227 # compiler/mesa-utils/src/mesa/program/arbprogparse.c
228 compiler/mesa-utils/src/mesa/program/prog_hash_table.c
229 compiler/mesa-utils/src/mesa/program/prog_parameter.c
230 # compiler/mesa-utils/src/mesa/program/prog_diskcache.c
231 # compiler/mesa-utils/src/mesa/program/program_parse.tab.c
232 # compiler/mesa-utils/src/mesa/program/programopt.c
233 # compiler/mesa-utils/src/mesa/program/prog_print.c
234 # compiler/mesa-utils/src/mesa/program/program_parse_extra.c
235 # compiler/mesa-utils/src/mesa/program/prog_parameter_layout.c
Cody Northropbc851432014-09-23 10:06:32 -0600236 compiler/mesa-utils/src/mesa/program/register_allocate.c
Cody Northrope8455b12014-09-17 16:18:12 -0600237 # compiler/mesa-utils/src/mesa/math/m_matrix.c
238 # compiler/mesa-utils/src/mesa/main/enums.c
239 # compiler/mesa-utils/src/mesa/main/imports.c
240 compiler/mesa-utils/src/mesa/main/hash.c
241 compiler/mesa-utils/src/mesa/main/hash_table.c
242 # compiler/mesa-utils/src/mesa/main/errors.c
243 # compiler/mesa-utils/src/mesa/main/formats.c
244
245 compiler/mesa-utils/src/mesa/main/errors.c
246 # compiler/mesa-utils/src/mesa/main/context.c
247 compiler/mesa-utils/src/mesa/main/enums.c
248 compiler/mesa-utils/src/mesa/main/imports.c
249 compiler/mesa-utils/src/mesa/main/version.c
Cody Northropfb3b8982014-10-21 09:47:26 -0600250 compiler/mesa-utils/src/mesa/main/uniforms.c
Cody Northrope8455b12014-09-17 16:18:12 -0600251
Cody Northrop0eb5eea2014-09-19 15:11:52 -0600252 #compiler/mesa-utils/src/mesa/main/shaderobj.c
253
Cody Northropbce1b882014-10-20 16:42:23 -0600254 compiler/mesa-utils/src/mesa/program/sampler.cpp
255
Cody Northrope8455b12014-09-17 16:18:12 -0600256 compiler/shader/glsl_glass_manager.cpp
257 compiler/shader/glsl_glass_backend_translator.cpp
258 compiler/shader/glsl_glass_backend.cpp
259
260 compiler/shader/glsl_parser_extras.cpp
261 compiler/shader/ossource.cpp
262 compiler/shader/standalone_scaffolding.cpp
263 compiler/shader/glsl_types.cpp
264 compiler/shader/glsl_symbol_table.cpp
265 compiler/shader/hir_field_selection.cpp
266
Cody Northrop0eb5eea2014-09-19 15:11:52 -0600267 compiler/shader/compiler_interface.cpp
268
Cody Northropbc851432014-09-23 10:06:32 -0600269 # File required for backend compiler
270 compiler/pipeline/pipeline_compiler_interface.cpp
Chia-I Wu7115a7a2014-10-22 13:48:59 +0800271 compiler/pipeline/pipeline_compiler_interface_meta.cpp
Chia-I Wue25293b2014-10-22 13:23:31 +0800272 compiler/pipeline/brw_blorp_blit_eu.cpp
Cody Northropbc851432014-09-23 10:06:32 -0600273 compiler/pipeline/brw_shader.cpp
274 compiler/pipeline/brw_fs.cpp
275 compiler/pipeline/brw_fs_visitor.cpp
276 compiler/pipeline/brw_fs_live_variables.cpp
277 compiler/pipeline/brw_cfg.cpp
278 compiler/pipeline/brw_fs_cse.cpp
279 compiler/pipeline/brw_fs_copy_propagation.cpp
280 compiler/pipeline/brw_fs_peephole_predicated_break.cpp
281 compiler/pipeline/brw_fs_dead_code_eliminate.cpp
282 compiler/pipeline/brw_fs_sel_peephole.cpp
283 compiler/pipeline/brw_dead_control_flow.cpp
284 compiler/pipeline/brw_fs_saturate_propagation.cpp
285 compiler/pipeline/brw_fs_register_coalesce.cpp
286 compiler/pipeline/brw_schedule_instructions.cpp
287 compiler/pipeline/brw_fs_reg_allocate.cpp
288 compiler/pipeline/brw_fs_generator.cpp
289 compiler/pipeline/brw_lower_texture_gradients.cpp
290 compiler/pipeline/brw_cubemap_normalize.cpp
291 compiler/pipeline/brw_lower_unnormalized_offset.cpp
292 compiler/pipeline/brw_fs_channel_expressions.cpp
293 compiler/pipeline/brw_fs_vector_splitting.cpp
Cody Northrope8455b12014-09-17 16:18:12 -0600294
Cody Northropbc851432014-09-23 10:06:32 -0600295 compiler/pipeline/brw_disasm.c
296 compiler/pipeline/brw_device_info.c
297 compiler/pipeline/brw_eu.c
298 compiler/pipeline/brw_program.c
299 compiler/pipeline/brw_wm.c
300 compiler/pipeline/brw_eu_emit.c
301 compiler/pipeline/brw_eu_compact.c
302 compiler/pipeline/intel_debug.c
Cody Northrop83e2b032014-09-25 17:00:31 -0600303
304 compiler/pipeline/brw_vs.c
305 compiler/pipeline/brw_vec4.cpp
306 compiler/pipeline/brw_vec4_visitor.cpp
307 compiler/pipeline/brw_vec4_vs_visitor.cpp
308 compiler/pipeline/brw_vec4_live_variables.cpp
309 compiler/pipeline/brw_vec4_copy_propagation.cpp
310 compiler/pipeline/brw_vec4_reg_allocate.cpp
311 compiler/pipeline/brw_vec4_generator.cpp
312 compiler/pipeline/gen8_vec4_generator.cpp
Cody Northrope8455b12014-09-17 16:18:12 -0600313 )
314
Chia-I Wufa6b3502014-12-15 23:46:12 +0800315set_source_files_properties(
316 compiler/shader/glsl_glass_manager.cpp
317 compiler/shader/glsl_glass_backend_translator.cpp
318 compiler/shader/glsl_glass_backend.cpp
319 compiler/shader/glsl_parser_extras.cpp
320 PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-ignored-qualifiers")
321
Cody Northrope8455b12014-09-17 16:18:12 -0600322SET(STANDALONE_COMPILER_SOURCES
323 compiler/shader/main.cpp
324 ${COMPILER_SOURCES}
Chia-I Wu155be032014-08-02 09:14:28 +0800325)
326
Chia-I Wuf77c2902015-01-04 00:34:44 +0800327add_custom_command(OUTPUT intel_gpa.c
328 COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py icd-get-proc-addr > intel_gpa.c
329 DEPENDS ${PROJECT_SOURCE_DIR}/xgl-generate.py ${PROJECT_SOURCE_DIR}/xgl.py)
330
Courtney Goeltzenleuchtercec72952014-08-01 18:06:40 -0600331SET(SOURCES
Chia-I Wu09142132014-08-11 15:42:55 +0800332 cmd.c
Chia-I Wu00b51a82014-09-09 12:07:37 +0800333 cmd_decode.c
Chia-I Wuc14d1562014-10-17 09:49:22 +0800334 cmd_meta.c
Chia-I Wu31ecdc72014-08-31 12:58:56 +0800335 cmd_mi.c
Chia-I Wu525c6602014-08-27 10:22:34 +0800336 cmd_prepare.c
Chia-I Wub2755562014-08-20 13:38:52 +0800337 cmd_pipeline.c
Chia-I Wue54854a2014-08-05 10:23:50 +0800338 dev.c
Chia-I Wu75577d92014-08-11 10:54:33 +0800339 dset.c
Chia-I Wu41be94b2014-08-19 14:46:02 +0800340 intel.c
Chia-I Wuf77c2902015-01-04 00:34:44 +0800341 intel_gpa.c
Chia-I Wu9737a102014-08-07 07:59:51 +0800342 event.c
Chia-I Wubdf4c562014-08-07 06:36:33 +0800343 fence.c
Chia-I Wuac6ba132014-08-07 14:21:43 +0800344 format.c
Chia-I Wu214dac62014-08-05 11:07:40 +0800345 gpu.c
Chia-I Wufeb441f2014-08-08 21:27:38 +0800346 img.c
Chia-I Wu8a8d8b62014-08-14 13:26:26 +0800347 layout.c
Chia-I Wuf9911eb2014-08-06 13:50:31 +0800348 mem.c
Chia-I Wu82f50aa2014-08-05 10:43:03 +0800349 obj.c
Courtney Goeltzenleuchter05a60542014-08-15 14:54:34 -0600350 pipeline.c
Chia-I Wue18ff1b2014-08-07 13:38:51 +0800351 query.c
Chia-I Wue09b5362014-08-07 09:25:14 +0800352 queue.c
Chia-I Wu28b89962014-08-18 14:40:49 +0800353 sampler.c
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -0600354 shader.c
Chia-I Wua5714e82014-08-11 15:33:42 +0800355 state.c
Chia-I Wu5a323262014-08-11 10:31:53 +0800356 view.c
Chia-I Wu770b3092014-08-05 14:22:03 +0800357 kmd/winsys_drm.c
Cody Northrope8455b12014-09-17 16:18:12 -0600358 ${COMPILER_SOURCES}
Courtney Goeltzenleuchtercec72952014-08-01 18:06:40 -0600359 )
360
Chia-I Wu44b92552015-01-10 23:16:41 +0800361find_package(XCB COMPONENTS xcb xcb-dri3 xcb-present)
362
363if (XCB_FOUND)
Chia-I Wu1db76e02014-09-15 14:21:14 +0800364 add_definitions(-DENABLE_WSI_X11)
Chia-I Wu44b92552015-01-10 23:16:41 +0800365 include_directories(${XCB_INCLUDE_DIRS})
366 link_libraries(${XCB_LIBRARIES})
Chia-I Wu1db76e02014-09-15 14:21:14 +0800367 set(SOURCES ${SOURCES} wsi_x11.c)
368endif()
369
Chia-I Wucafc88a2015-01-04 00:31:33 +0800370add_library(XGL_i965 SHARED ${SOURCES})
Cody Northrope8455b12014-09-17 16:18:12 -0600371
Chia-I Wu96177272015-01-03 15:27:41 +0800372# set -Bsymbolic-functions for xglGetProcAddr()
373set_target_properties(XGL_i965 PROPERTIES
374 LINK_FLAGS -Wl,-Bsymbolic-functions)
375
Cody Northrop1b8b8fd2014-09-25 13:56:51 -0600376#add_executable(xglCompiler
377# ${STANDALONE_COMPILER_SOURCES}
378#)