CMakeLists.txt 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. add_library(shader_recompiler STATIC
  2. backend/spirv/emit_context.cpp
  3. backend/spirv/emit_context.h
  4. backend/spirv/emit_spirv.cpp
  5. backend/spirv/emit_spirv.h
  6. backend/spirv/emit_spirv_bitwise_conversion.cpp
  7. backend/spirv/emit_spirv_composite.cpp
  8. backend/spirv/emit_spirv_context_get_set.cpp
  9. backend/spirv/emit_spirv_control_flow.cpp
  10. backend/spirv/emit_spirv_convert.cpp
  11. backend/spirv/emit_spirv_floating_point.cpp
  12. backend/spirv/emit_spirv_integer.cpp
  13. backend/spirv/emit_spirv_logical.cpp
  14. backend/spirv/emit_spirv_memory.cpp
  15. backend/spirv/emit_spirv_select.cpp
  16. backend/spirv/emit_spirv_undefined.cpp
  17. environment.h
  18. exception.h
  19. file_environment.cpp
  20. file_environment.h
  21. frontend/ir/attribute.cpp
  22. frontend/ir/attribute.h
  23. frontend/ir/basic_block.cpp
  24. frontend/ir/basic_block.h
  25. frontend/ir/condition.cpp
  26. frontend/ir/condition.h
  27. frontend/ir/flow_test.cpp
  28. frontend/ir/flow_test.h
  29. frontend/ir/function.cpp
  30. frontend/ir/function.h
  31. frontend/ir/ir_emitter.cpp
  32. frontend/ir/ir_emitter.h
  33. frontend/ir/microinstruction.cpp
  34. frontend/ir/microinstruction.h
  35. frontend/ir/modifiers.h
  36. frontend/ir/opcodes.cpp
  37. frontend/ir/opcodes.h
  38. frontend/ir/opcodes.inc
  39. frontend/ir/post_order.cpp
  40. frontend/ir/post_order.h
  41. frontend/ir/pred.h
  42. frontend/ir/program.cpp
  43. frontend/ir/program.h
  44. frontend/ir/reg.h
  45. frontend/ir/structured_control_flow.cpp
  46. frontend/ir/structured_control_flow.h
  47. frontend/ir/type.cpp
  48. frontend/ir/type.h
  49. frontend/ir/value.cpp
  50. frontend/ir/value.h
  51. frontend/maxwell/control_flow.cpp
  52. frontend/maxwell/control_flow.h
  53. frontend/maxwell/decode.cpp
  54. frontend/maxwell/decode.h
  55. frontend/maxwell/instruction.h
  56. frontend/maxwell/location.h
  57. frontend/maxwell/maxwell.inc
  58. frontend/maxwell/opcodes.cpp
  59. frontend/maxwell/opcodes.h
  60. frontend/maxwell/program.cpp
  61. frontend/maxwell/program.h
  62. frontend/maxwell/translate/impl/bitfield_extract.cpp
  63. frontend/maxwell/translate/impl/bitfield_insert.cpp
  64. frontend/maxwell/translate/impl/common_encoding.h
  65. frontend/maxwell/translate/impl/common_funcs.cpp
  66. frontend/maxwell/translate/impl/common_funcs.h
  67. frontend/maxwell/translate/impl/find_leading_one.cpp
  68. frontend/maxwell/translate/impl/floating_point_add.cpp
  69. frontend/maxwell/translate/impl/floating_point_conversion_integer.cpp
  70. frontend/maxwell/translate/impl/floating_point_fused_multiply_add.cpp
  71. frontend/maxwell/translate/impl/floating_point_multi_function.cpp
  72. frontend/maxwell/translate/impl/floating_point_multiply.cpp
  73. frontend/maxwell/translate/impl/floating_point_range_reduction.cpp
  74. frontend/maxwell/translate/impl/impl.cpp
  75. frontend/maxwell/translate/impl/impl.h
  76. frontend/maxwell/translate/impl/integer_add.cpp
  77. frontend/maxwell/translate/impl/integer_compare.cpp
  78. frontend/maxwell/translate/impl/integer_compare_and_set.cpp
  79. frontend/maxwell/translate/impl/integer_minimum_maximum.cpp
  80. frontend/maxwell/translate/impl/integer_popcount.cpp
  81. frontend/maxwell/translate/impl/integer_scaled_add.cpp
  82. frontend/maxwell/translate/impl/integer_set_predicate.cpp
  83. frontend/maxwell/translate/impl/integer_shift_left.cpp
  84. frontend/maxwell/translate/impl/integer_shift_right.cpp
  85. frontend/maxwell/translate/impl/integer_short_multiply_add.cpp
  86. frontend/maxwell/translate/impl/load_store_attribute.cpp
  87. frontend/maxwell/translate/impl/load_store_memory.cpp
  88. frontend/maxwell/translate/impl/move_predicate_to_register.cpp
  89. frontend/maxwell/translate/impl/move_register.cpp
  90. frontend/maxwell/translate/impl/move_special_register.cpp
  91. frontend/maxwell/translate/impl/not_implemented.cpp
  92. frontend/maxwell/translate/impl/predicate_set.cpp
  93. frontend/maxwell/translate/impl/select_source_with_predicate.cpp
  94. frontend/maxwell/translate/translate.cpp
  95. frontend/maxwell/translate/translate.h
  96. ir_opt/collect_shader_info_pass.cpp
  97. ir_opt/constant_propagation_pass.cpp
  98. ir_opt/dead_code_elimination_pass.cpp
  99. ir_opt/global_memory_to_storage_buffer_pass.cpp
  100. ir_opt/identity_removal_pass.cpp
  101. ir_opt/lower_fp16_to_fp32.cpp
  102. ir_opt/passes.h
  103. ir_opt/ssa_rewrite_pass.cpp
  104. ir_opt/verification_pass.cpp
  105. object_pool.h
  106. profile.h
  107. recompiler.cpp
  108. recompiler.h
  109. shader_info.h
  110. )
  111. target_link_libraries(shader_recompiler PUBLIC fmt::fmt sirit)
  112. add_executable(shader_util main.cpp)
  113. target_link_libraries(shader_util PRIVATE shader_recompiler)
  114. if (MSVC)
  115. target_compile_options(shader_recompiler PRIVATE
  116. /W4
  117. /WX
  118. /we4018 # 'expression' : signed/unsigned mismatch
  119. /we4244 # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point)
  120. /we4245 # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
  121. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  122. /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
  123. /we4305 # 'context' : truncation from 'type1' to 'type2'
  124. /we4800 # Implicit conversion from 'type' to bool. Possible information loss
  125. /we4826 # Conversion from 'type1' to 'type2' is sign-extended. This may cause unexpected runtime behavior.
  126. )
  127. else()
  128. target_compile_options(shader_recompiler PRIVATE
  129. -Werror
  130. -Werror=conversion
  131. -Werror=ignored-qualifiers
  132. -Werror=implicit-fallthrough
  133. -Werror=shadow
  134. -Werror=sign-compare
  135. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
  136. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
  137. -Werror=unused-variable
  138. )
  139. endif()
  140. create_target_directory_groups(shader_recompiler)
  141. create_target_directory_groups(shader_util)