CMakeLists.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. # Add a custom command to generate a new shader_cache_version hash when any of the following files change
  2. # NOTE: This is an approximation of what files affect shader generation, its possible something else
  3. # could affect the result, but much more unlikely than the following files. Keeping a list of files
  4. # like this allows for much better caching since it doesn't force the user to recompile binary shaders every update
  5. set(VIDEO_CORE "${CMAKE_SOURCE_DIR}/src/video_core")
  6. if (DEFINED ENV{CI})
  7. if (DEFINED ENV{TRAVIS})
  8. set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG})
  9. set(BUILD_TAG $ENV{TRAVIS_TAG})
  10. elseif(DEFINED ENV{APPVEYOR})
  11. set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME})
  12. set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME})
  13. elseif(DEFINED ENV{AZURE})
  14. set(BUILD_REPOSITORY $ENV{AZURE_REPO_NAME})
  15. set(BUILD_TAG $ENV{AZURE_REPO_TAG})
  16. endif()
  17. endif()
  18. if (DEFINED ENV{TITLEBARFORMATIDLE})
  19. set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE})
  20. endif ()
  21. if (DEFINED ENV{TITLEBARFORMATRUNNING})
  22. set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING})
  23. endif ()
  24. if (DEFINED ENV{DISPLAYVERSION})
  25. set(DISPLAY_VERSION $ENV{DISPLAYVERSION})
  26. endif ()
  27. add_custom_command(OUTPUT scm_rev.cpp
  28. COMMAND ${CMAKE_COMMAND}
  29. -DSRC_DIR="${CMAKE_SOURCE_DIR}"
  30. -DBUILD_REPOSITORY="${BUILD_REPOSITORY}"
  31. -DTITLE_BAR_FORMAT_IDLE="${TITLE_BAR_FORMAT_IDLE}"
  32. -DTITLE_BAR_FORMAT_RUNNING="${TITLE_BAR_FORMAT_RUNNING}"
  33. -DBUILD_TAG="${BUILD_TAG}"
  34. -DBUILD_ID="${DISPLAY_VERSION}"
  35. -P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake"
  36. DEPENDS
  37. # WARNING! It was too much work to try and make a common location for this list,
  38. # so if you need to change it, please update CMakeModules/GenerateSCMRev.cmake as well
  39. "${VIDEO_CORE}/renderer_opengl/gl_shader_cache.cpp"
  40. "${VIDEO_CORE}/renderer_opengl/gl_shader_cache.h"
  41. "${VIDEO_CORE}/renderer_opengl/gl_shader_decompiler.cpp"
  42. "${VIDEO_CORE}/renderer_opengl/gl_shader_decompiler.h"
  43. "${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.cpp"
  44. "${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.h"
  45. "${VIDEO_CORE}/renderer_opengl/gl_shader_gen.cpp"
  46. "${VIDEO_CORE}/renderer_opengl/gl_shader_gen.h"
  47. "${VIDEO_CORE}/shader/decode/arithmetic.cpp"
  48. "${VIDEO_CORE}/shader/decode/arithmetic_half.cpp"
  49. "${VIDEO_CORE}/shader/decode/arithmetic_half_immediate.cpp"
  50. "${VIDEO_CORE}/shader/decode/arithmetic_immediate.cpp"
  51. "${VIDEO_CORE}/shader/decode/arithmetic_integer.cpp"
  52. "${VIDEO_CORE}/shader/decode/arithmetic_integer_immediate.cpp"
  53. "${VIDEO_CORE}/shader/decode/bfe.cpp"
  54. "${VIDEO_CORE}/shader/decode/bfi.cpp"
  55. "${VIDEO_CORE}/shader/decode/conversion.cpp"
  56. "${VIDEO_CORE}/shader/decode/ffma.cpp"
  57. "${VIDEO_CORE}/shader/decode/float_set.cpp"
  58. "${VIDEO_CORE}/shader/decode/float_set_predicate.cpp"
  59. "${VIDEO_CORE}/shader/decode/half_set.cpp"
  60. "${VIDEO_CORE}/shader/decode/half_set_predicate.cpp"
  61. "${VIDEO_CORE}/shader/decode/hfma2.cpp"
  62. "${VIDEO_CORE}/shader/decode/image.cpp"
  63. "${VIDEO_CORE}/shader/decode/integer_set.cpp"
  64. "${VIDEO_CORE}/shader/decode/integer_set_predicate.cpp"
  65. "${VIDEO_CORE}/shader/decode/memory.cpp"
  66. "${VIDEO_CORE}/shader/decode/texture.cpp"
  67. "${VIDEO_CORE}/shader/decode/other.cpp"
  68. "${VIDEO_CORE}/shader/decode/predicate_set_predicate.cpp"
  69. "${VIDEO_CORE}/shader/decode/predicate_set_register.cpp"
  70. "${VIDEO_CORE}/shader/decode/register_set_predicate.cpp"
  71. "${VIDEO_CORE}/shader/decode/shift.cpp"
  72. "${VIDEO_CORE}/shader/decode/video.cpp"
  73. "${VIDEO_CORE}/shader/decode/warp.cpp"
  74. "${VIDEO_CORE}/shader/decode/xmad.cpp"
  75. "${VIDEO_CORE}/shader/ast.cpp"
  76. "${VIDEO_CORE}/shader/ast.h"
  77. "${VIDEO_CORE}/shader/control_flow.cpp"
  78. "${VIDEO_CORE}/shader/control_flow.h"
  79. "${VIDEO_CORE}/shader/compiler_settings.cpp"
  80. "${VIDEO_CORE}/shader/compiler_settings.h"
  81. "${VIDEO_CORE}/shader/decode.cpp"
  82. "${VIDEO_CORE}/shader/expr.cpp"
  83. "${VIDEO_CORE}/shader/expr.h"
  84. "${VIDEO_CORE}/shader/node.h"
  85. "${VIDEO_CORE}/shader/node_helper.cpp"
  86. "${VIDEO_CORE}/shader/node_helper.h"
  87. "${VIDEO_CORE}/shader/shader_ir.cpp"
  88. "${VIDEO_CORE}/shader/shader_ir.h"
  89. "${VIDEO_CORE}/shader/track.cpp"
  90. # and also check that the scm_rev files haven't changed
  91. "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in"
  92. "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h"
  93. # technically we should regenerate if the git version changed, but its not worth the effort imo
  94. "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake"
  95. )
  96. add_library(common STATIC
  97. alignment.h
  98. assert.h
  99. detached_tasks.cpp
  100. detached_tasks.h
  101. binary_find.h
  102. bit_field.h
  103. bit_util.h
  104. cityhash.cpp
  105. cityhash.h
  106. color.h
  107. common_funcs.h
  108. common_paths.h
  109. common_types.h
  110. file_util.cpp
  111. file_util.h
  112. hash.h
  113. hex_util.cpp
  114. hex_util.h
  115. logging/backend.cpp
  116. logging/backend.h
  117. logging/filter.cpp
  118. logging/filter.h
  119. logging/log.h
  120. logging/text_formatter.cpp
  121. logging/text_formatter.h
  122. lz4_compression.cpp
  123. lz4_compression.h
  124. math_util.h
  125. memory_hook.cpp
  126. memory_hook.h
  127. microprofile.cpp
  128. microprofile.h
  129. microprofileui.h
  130. misc.cpp
  131. multi_level_queue.h
  132. page_table.cpp
  133. page_table.h
  134. param_package.cpp
  135. param_package.h
  136. quaternion.h
  137. ring_buffer.h
  138. scm_rev.cpp
  139. scm_rev.h
  140. scope_exit.h
  141. string_util.cpp
  142. string_util.h
  143. swap.h
  144. telemetry.cpp
  145. telemetry.h
  146. thread.cpp
  147. thread.h
  148. thread_queue_list.h
  149. threadsafe_queue.h
  150. timer.cpp
  151. timer.h
  152. uint128.cpp
  153. uint128.h
  154. uuid.cpp
  155. uuid.h
  156. vector_math.h
  157. web_result.h
  158. zstd_compression.cpp
  159. zstd_compression.h
  160. )
  161. if(ARCHITECTURE_x86_64)
  162. target_sources(common
  163. PRIVATE
  164. x64/cpu_detect.cpp
  165. x64/cpu_detect.h
  166. )
  167. endif()
  168. create_target_directory_groups(common)
  169. target_link_libraries(common PUBLIC Boost::boost fmt microprofile)
  170. target_link_libraries(common PRIVATE lz4_static libzstd_static)