Courtney Goeltzenleuchter | e06e72d | 2014-08-01 12:44:23 -0600 | [diff] [blame] | 1 | # Create the i965 XGL DRI library |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 2 | add_definitions(-D_GNU_SOURCE -DHAVE_PTHREAD) |
| 3 | add_definitions(-DUSE_LUNARGLASS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS) |
| 4 | |
| 5 | # Hard code our LunarGLASS and glslang paths for now |
| 6 | SET(GLSLANG_PREFIX_REL ../../../glslang) |
| 7 | SET(LUNARGLASS_PREFIX_REL ../../../LunarGLASS) |
| 8 | |
| 9 | get_filename_component(GLSLANG_PREFIX ${GLSLANG_PREFIX_REL} ABSOLUTE) |
| 10 | get_filename_component(LUNARGLASS_PREFIX ${LUNARGLASS_PREFIX_REL} ABSOLUTE) |
| 11 | |
| 12 | # LunarG TODO: Get the llvm-config flags hooked up correctly and remove extra definitions from above |
| 13 | |
| 14 | #execute_process(COMMAND ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/bin/llvm-config --cxxflags OUTPUT_VARIABLE LLVM_CXX_CONFIG_ALL) |
| 15 | #string(REPLACE "-Woverloaded-virtual" "" LLVM_CXX_CONFIG_1 ${LLVM_CXX_CONFIG_ALL}) |
| 16 | #string(REPLACE "-fvisibility-inlines-hidden" "" LLVM_CXX_CONFIG ${LLVM_CXX_CONFIG_1}) |
| 17 | |
| 18 | #message(STATUS "llvm-config results") |
| 19 | #message(STATUS ${LLVM_CXX_CONFIG}) |
| 20 | |
| 21 | #set_target_properties($<TARGET_OBJECTS:icd> |
| 22 | # PROPERTIES |
| 23 | # COMPILE_FLAGS "${LLVM_CXX_CONFIG}") |
| 24 | |
Steve K | 14e0981 | 2014-09-19 09:45:36 -0600 | [diff] [blame^] | 25 | execute_process(COMMAND ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/bin/llvm-config --libs engine bitwriter |
| 26 | OUTPUT_VARIABLE LLVM_LIBS_ALL_1 |
| 27 | RESULT_VARIABLE LLVM_LIBS_RESULT) |
| 28 | |
| 29 | if(NOT ${LLVM_LIBS_RESULT} EQUAL 0) |
| 30 | message(FATAL_ERROR "llvm-config failed.") |
| 31 | endif() |
| 32 | |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 33 | string(REPLACE "\n" "" LLVM_LIBS_ALL ${LLVM_LIBS_ALL_1}) |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 34 | |
| 35 | SET(COMPILER_LINK_DIRS |
| 36 | ${GLSLANG_PREFIX}/build/install/lib |
| 37 | ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/lib |
| 38 | ${LUNARGLASS_PREFIX}/build/Core |
| 39 | ${LUNARGLASS_PREFIX}/build/Frontends/glslang |
| 40 | ${LUNARGLASS_PREFIX}/build/Core/Passes/Transforms |
| 41 | ${LUNARGLASS_PREFIX}/build/Core/Passes/Immutable |
| 42 | ${LUNARGLASS_PREFIX}/build/Core/Passes/Analysis |
| 43 | ${LUNARGLASS_PREFIX}/build/Core/Passes/Util |
| 44 | ) |
Courtney Goeltzenleuchter | e06e72d | 2014-08-01 12:44:23 -0600 | [diff] [blame] | 45 | |
Chia-I Wu | ddbc8e2 | 2014-09-18 17:05:09 +0800 | [diff] [blame] | 46 | pkg_check_modules(DRM REQUIRED libdrm libdrm_intel) |
| 47 | |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 48 | link_directories ( |
| 49 | ${ICD_LIBRARY_DIRS} |
| 50 | ${DRM_LIBRARY_DIRS} |
| 51 | ${COMPILER_LINK_DIRS} |
Chia-I Wu | ddbc8e2 | 2014-09-18 17:05:09 +0800 | [diff] [blame] | 52 | ) |
| 53 | |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 54 | SET(COMPILER_LIBS |
| 55 | glslangFrontend |
| 56 | core |
| 57 | LLVMipo |
| 58 | glslang |
| 59 | OGLCompiler |
| 60 | ${LLVM_LIBS_ALL} |
Courtney Goeltzenleuchter | e06e72d | 2014-08-01 12:44:23 -0600 | [diff] [blame] | 61 | ) |
| 62 | |
| 63 | link_libraries ( |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 64 | ${ICD_LIBRARIES} |
| 65 | ${DRM_LIBRARIES} |
| 66 | ${COMPILER_LIBS} |
| 67 | m |
Steve K | da22404 | 2014-09-19 08:46:17 -0600 | [diff] [blame] | 68 | pthread |
| 69 | dl |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 70 | ) |
| 71 | |
| 72 | SET(COMPILER_INCLUDE_DIRS |
| 73 | ${GLSLANG_PREFIX} |
| 74 | ${LUNARGLASS_PREFIX}/Core/LLVM/llvm-3.4/build/install/usr/local/include |
| 75 | ${LUNARGLASS_PREFIX} |
| 76 | compiler/mesa-utils/include |
| 77 | compiler/mesa-utils/src/glsl |
| 78 | compiler/mesa-utils/src/mesa |
| 79 | compiler/mesa-utils/src/mapi |
| 80 | ) |
| 81 | |
| 82 | include_directories ( |
| 83 | ${ICD_INCLUDE_DIRS} |
| 84 | ${DRM_INCLUDE_DIRS} |
| 85 | ${COMPILER_INCLUDE_DIRS} |
| 86 | ) |
| 87 | |
| 88 | |
| 89 | SET(COMPILER_SOURCES |
| 90 | compiler/shader/ast_array_index.cpp |
| 91 | compiler/shader/ast_expr.cpp |
| 92 | compiler/shader/ast_function.cpp |
| 93 | compiler/shader/ast_to_hir.cpp |
| 94 | compiler/shader/ast_type.cpp |
| 95 | compiler/shader/builtin_functions.cpp |
| 96 | compiler/shader/builtin_types.cpp |
| 97 | compiler/shader/builtin_variables.cpp |
| 98 | compiler/shader/ir.cpp |
| 99 | compiler/shader/ir_basic_block.cpp |
| 100 | compiler/shader/ir_builder.cpp |
| 101 | compiler/shader/ir_clone.cpp |
| 102 | compiler/shader/ir_constant_expression.cpp |
| 103 | compiler/shader/ir_deserializer.cpp |
| 104 | compiler/shader/ir_equals.cpp |
| 105 | compiler/shader/ir_expression_flattening.cpp |
| 106 | compiler/shader/ir_function_can_inline.cpp |
| 107 | compiler/shader/ir_function.cpp |
| 108 | compiler/shader/ir_function_detect_recursion.cpp |
| 109 | compiler/shader/ir_hierarchical_visitor.cpp |
| 110 | compiler/shader/ir_hv_accept.cpp |
| 111 | compiler/shader/ir_import_prototypes.cpp |
| 112 | compiler/shader/ir_print_visitor.cpp |
| 113 | compiler/shader/ir_reader.cpp |
| 114 | compiler/shader/ir_rvalue_visitor.cpp |
| 115 | compiler/shader/ir_serialize.cpp |
| 116 | compiler/shader/ir_set_program_inouts.cpp |
| 117 | compiler/shader/ir_validate.cpp |
| 118 | compiler/shader/ir_variable_refcount.cpp |
| 119 | compiler/shader/link_atomics.cpp |
| 120 | compiler/shader/linker.cpp |
| 121 | compiler/shader/link_functions.cpp |
| 122 | compiler/shader/link_interface_blocks.cpp |
| 123 | compiler/shader/link_uniform_block_active_visitor.cpp |
| 124 | compiler/shader/link_uniform_blocks.cpp |
| 125 | compiler/shader/link_uniform_initializers.cpp |
| 126 | compiler/shader/link_uniforms.cpp |
| 127 | compiler/shader/link_varyings.cpp |
| 128 | compiler/shader/loop_analysis.cpp |
| 129 | compiler/shader/loop_controls.cpp |
| 130 | compiler/shader/loop_unroll.cpp |
| 131 | compiler/shader/lower_clip_distance.cpp |
| 132 | compiler/shader/lower_discard.cpp |
| 133 | compiler/shader/lower_discard_flow.cpp |
| 134 | compiler/shader/lower_if_to_cond_assign.cpp |
| 135 | compiler/shader/lower_instructions.cpp |
| 136 | compiler/shader/lower_jumps.cpp |
| 137 | compiler/shader/lower_mat_op_to_vec.cpp |
| 138 | compiler/shader/lower_named_interface_blocks.cpp |
| 139 | compiler/shader/lower_noise.cpp |
| 140 | compiler/shader/lower_offset_array.cpp |
| 141 | compiler/shader/lower_output_reads.cpp |
| 142 | compiler/shader/lower_packed_varyings.cpp |
| 143 | compiler/shader/lower_packing_builtins.cpp |
| 144 | compiler/shader/lower_texture_projection.cpp |
| 145 | compiler/shader/lower_ubo_reference.cpp |
| 146 | compiler/shader/lower_variable_index_to_cond_assign.cpp |
| 147 | compiler/shader/lower_vec_index_to_cond_assign.cpp |
| 148 | compiler/shader/lower_vec_index_to_swizzle.cpp |
| 149 | compiler/shader/lower_vector.cpp |
| 150 | compiler/shader/lower_vector_insert.cpp |
| 151 | compiler/shader/opt_algebraic.cpp |
| 152 | compiler/shader/opt_array_splitting.cpp |
| 153 | compiler/shader/opt_constant_folding.cpp |
| 154 | compiler/shader/opt_constant_propagation.cpp |
| 155 | compiler/shader/opt_constant_variable.cpp |
| 156 | compiler/shader/opt_copy_propagation.cpp |
| 157 | compiler/shader/opt_copy_propagation_elements.cpp |
| 158 | compiler/shader/opt_cse.cpp |
| 159 | compiler/shader/opt_dead_builtin_varyings.cpp |
| 160 | compiler/shader/opt_dead_code.cpp |
| 161 | compiler/shader/opt_dead_code_local.cpp |
| 162 | compiler/shader/opt_dead_functions.cpp |
| 163 | compiler/shader/opt_flatten_nested_if_blocks.cpp |
| 164 | compiler/shader/opt_flip_matrices.cpp |
| 165 | compiler/shader/opt_function_inlining.cpp |
| 166 | compiler/shader/opt_if_simplification.cpp |
| 167 | compiler/shader/opt_noop_swizzle.cpp |
| 168 | compiler/shader/opt_redundant_jumps.cpp |
| 169 | compiler/shader/opt_structure_splitting.cpp |
| 170 | compiler/shader/opt_swizzle_swizzle.cpp |
| 171 | compiler/shader/opt_tree_grafting.cpp |
| 172 | compiler/shader/opt_vectorize.cpp |
| 173 | compiler/shader/s_expression.cpp |
| 174 | # compiler/shader/shader_deserialize.cpp |
| 175 | # compiler/shader/shader_serialize.cpp |
| 176 | # compiler/shader/standalone_scaffolding.cpp |
| 177 | compiler/shader/strtod.cpp |
| 178 | |
| 179 | compiler/mesa-utils/src/glsl/ralloc.c |
| 180 | compiler/mesa-utils/src/mesa/program/program.c |
| 181 | # compiler/mesa-utils/src/mesa/program/prog_execute.c |
| 182 | # compiler/mesa-utils/src/mesa/program/prog_noise.c |
Steve K | da22404 | 2014-09-19 08:46:17 -0600 | [diff] [blame] | 183 | compiler/mesa-utils/src/mesa/program/prog_statevars.c |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 184 | # compiler/mesa-utils/src/mesa/program/prog_opt_constant_fold.c |
| 185 | compiler/mesa-utils/src/mesa/program/symbol_table.c |
Steve K | da22404 | 2014-09-19 08:46:17 -0600 | [diff] [blame] | 186 | # compiler/mesa-utils/src/mesa/program/prog_cache.c |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 187 | compiler/mesa-utils/src/mesa/program/prog_instruction.c |
| 188 | # compiler/mesa-utils/src/mesa/program/prog_optimize.c |
| 189 | # compiler/mesa-utils/src/mesa/program/arbprogparse.c |
| 190 | compiler/mesa-utils/src/mesa/program/prog_hash_table.c |
| 191 | compiler/mesa-utils/src/mesa/program/prog_parameter.c |
| 192 | # compiler/mesa-utils/src/mesa/program/prog_diskcache.c |
| 193 | # compiler/mesa-utils/src/mesa/program/program_parse.tab.c |
| 194 | # compiler/mesa-utils/src/mesa/program/programopt.c |
| 195 | # compiler/mesa-utils/src/mesa/program/prog_print.c |
| 196 | # compiler/mesa-utils/src/mesa/program/program_parse_extra.c |
| 197 | # compiler/mesa-utils/src/mesa/program/prog_parameter_layout.c |
| 198 | # compiler/mesa-utils/src/mesa/program/register_allocate.c |
| 199 | # compiler/mesa-utils/src/mesa/math/m_matrix.c |
| 200 | # compiler/mesa-utils/src/mesa/main/enums.c |
| 201 | # compiler/mesa-utils/src/mesa/main/imports.c |
| 202 | compiler/mesa-utils/src/mesa/main/hash.c |
| 203 | compiler/mesa-utils/src/mesa/main/hash_table.c |
| 204 | # compiler/mesa-utils/src/mesa/main/errors.c |
| 205 | # compiler/mesa-utils/src/mesa/main/formats.c |
| 206 | |
| 207 | compiler/mesa-utils/src/mesa/main/errors.c |
| 208 | # compiler/mesa-utils/src/mesa/main/context.c |
| 209 | compiler/mesa-utils/src/mesa/main/enums.c |
| 210 | compiler/mesa-utils/src/mesa/main/imports.c |
| 211 | compiler/mesa-utils/src/mesa/main/version.c |
| 212 | |
| 213 | compiler/shader/glsl_glass_manager.cpp |
| 214 | compiler/shader/glsl_glass_backend_translator.cpp |
| 215 | compiler/shader/glsl_glass_backend.cpp |
| 216 | |
| 217 | compiler/shader/glsl_parser_extras.cpp |
| 218 | compiler/shader/ossource.cpp |
| 219 | compiler/shader/standalone_scaffolding.cpp |
| 220 | compiler/shader/glsl_types.cpp |
| 221 | compiler/shader/glsl_symbol_table.cpp |
| 222 | compiler/shader/hir_field_selection.cpp |
| 223 | |
| 224 | |
| 225 | ) |
| 226 | |
| 227 | SET(STANDALONE_COMPILER_SOURCES |
| 228 | compiler/shader/main.cpp |
| 229 | ${COMPILER_SOURCES} |
Chia-I Wu | 155be03 | 2014-08-02 09:14:28 +0800 | [diff] [blame] | 230 | ) |
| 231 | |
Courtney Goeltzenleuchter | cec7295 | 2014-08-01 18:06:40 -0600 | [diff] [blame] | 232 | SET(SOURCES |
Chia-I Wu | 0914213 | 2014-08-11 15:42:55 +0800 | [diff] [blame] | 233 | cmd.c |
Chia-I Wu | 00b51a8 | 2014-09-09 12:07:37 +0800 | [diff] [blame] | 234 | cmd_decode.c |
Chia-I Wu | c14d156 | 2014-10-17 09:49:22 +0800 | [diff] [blame] | 235 | cmd_meta.c |
Chia-I Wu | 31ecdc7 | 2014-08-31 12:58:56 +0800 | [diff] [blame] | 236 | cmd_mi.c |
Chia-I Wu | 525c660 | 2014-08-27 10:22:34 +0800 | [diff] [blame] | 237 | cmd_prepare.c |
Chia-I Wu | b275556 | 2014-08-20 13:38:52 +0800 | [diff] [blame] | 238 | cmd_pipeline.c |
Chia-I Wu | e54854a | 2014-08-05 10:23:50 +0800 | [diff] [blame] | 239 | dev.c |
Chia-I Wu | de2bb86 | 2014-08-19 14:32:47 +0800 | [diff] [blame] | 240 | dispatch.c |
Chia-I Wu | 75577d9 | 2014-08-11 10:54:33 +0800 | [diff] [blame] | 241 | dset.c |
Chia-I Wu | 41be94b | 2014-08-19 14:46:02 +0800 | [diff] [blame] | 242 | intel.c |
Chia-I Wu | 9737a10 | 2014-08-07 07:59:51 +0800 | [diff] [blame] | 243 | event.c |
Chia-I Wu | bdf4c56 | 2014-08-07 06:36:33 +0800 | [diff] [blame] | 244 | fence.c |
Chia-I Wu | ac6ba13 | 2014-08-07 14:21:43 +0800 | [diff] [blame] | 245 | format.c |
Chia-I Wu | 214dac6 | 2014-08-05 11:07:40 +0800 | [diff] [blame] | 246 | gpu.c |
Chia-I Wu | feb441f | 2014-08-08 21:27:38 +0800 | [diff] [blame] | 247 | img.c |
Chia-I Wu | 8a8d8b6 | 2014-08-14 13:26:26 +0800 | [diff] [blame] | 248 | layout.c |
Chia-I Wu | f9911eb | 2014-08-06 13:50:31 +0800 | [diff] [blame] | 249 | mem.c |
Chia-I Wu | 82f50aa | 2014-08-05 10:43:03 +0800 | [diff] [blame] | 250 | obj.c |
Courtney Goeltzenleuchter | 05a6054 | 2014-08-15 14:54:34 -0600 | [diff] [blame] | 251 | pipeline.c |
Chia-I Wu | 6b4b278 | 2014-09-02 13:11:32 +0800 | [diff] [blame] | 252 | pipeline_shader.c |
Chia-I Wu | e18ff1b | 2014-08-07 13:38:51 +0800 | [diff] [blame] | 253 | query.c |
Chia-I Wu | e09b536 | 2014-08-07 09:25:14 +0800 | [diff] [blame] | 254 | queue.c |
Chia-I Wu | 28b8996 | 2014-08-18 14:40:49 +0800 | [diff] [blame] | 255 | sampler.c |
Courtney Goeltzenleuchter | 52ec336 | 2014-08-19 11:52:02 -0600 | [diff] [blame] | 256 | shader.c |
Chia-I Wu | a5714e8 | 2014-08-11 15:33:42 +0800 | [diff] [blame] | 257 | state.c |
Chia-I Wu | 5a32326 | 2014-08-11 10:31:53 +0800 | [diff] [blame] | 258 | view.c |
Chia-I Wu | 770b309 | 2014-08-05 14:22:03 +0800 | [diff] [blame] | 259 | kmd/winsys_drm.c |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 260 | ${COMPILER_SOURCES} |
Courtney Goeltzenleuchter | cec7295 | 2014-08-01 18:06:40 -0600 | [diff] [blame] | 261 | ) |
| 262 | |
Chia-I Wu | b5e95f9 | 2014-09-23 15:36:53 +0800 | [diff] [blame] | 263 | pkg_check_modules(DRI3 xcb xcb-dri3 xcb-present) |
Chia-I Wu | 1db76e0 | 2014-09-15 14:21:14 +0800 | [diff] [blame] | 264 | if (DRI3_FOUND) |
| 265 | add_definitions(-DENABLE_WSI_X11) |
| 266 | include_directories(${DRI3_INCLUDE_DIRS}) |
| 267 | link_directories(${DRI3_LIBRARY_DIRS}) |
| 268 | link_libraries(${DRI3_LIBRARIES}) |
| 269 | set(SOURCES ${SOURCES} wsi_x11.c) |
| 270 | endif() |
| 271 | |
Courtney Goeltzenleuchter | e06e72d | 2014-08-01 12:44:23 -0600 | [diff] [blame] | 272 | add_library(XGL_i965 SHARED |
Courtney Goeltzenleuchter | cec7295 | 2014-08-01 18:06:40 -0600 | [diff] [blame] | 273 | ${SOURCES} |
Chia-I Wu | 3065c9c | 2014-08-04 06:28:31 +0800 | [diff] [blame] | 274 | $<TARGET_OBJECTS:icd> |
Courtney Goeltzenleuchter | e06e72d | 2014-08-01 12:44:23 -0600 | [diff] [blame] | 275 | ) |
Cody Northrop | e8455b1 | 2014-09-17 16:18:12 -0600 | [diff] [blame] | 276 | |
| 277 | add_executable(xglCompiler |
| 278 | ${STANDALONE_COMPILER_SOURCES} |
| 279 | ) |