CMakeLists.txt 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. # SPDX-FileCopyrightText: 2018 yuzu Emulator Project
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. if (DEFINED ENV{AZURECIREPO})
  4. set(BUILD_REPOSITORY $ENV{AZURECIREPO})
  5. endif()
  6. if (DEFINED ENV{TITLEBARFORMATIDLE})
  7. set(TITLE_BAR_FORMAT_IDLE $ENV{TITLEBARFORMATIDLE})
  8. endif ()
  9. if (DEFINED ENV{TITLEBARFORMATRUNNING})
  10. set(TITLE_BAR_FORMAT_RUNNING $ENV{TITLEBARFORMATRUNNING})
  11. endif ()
  12. if (DEFINED ENV{DISPLAYVERSION})
  13. set(DISPLAY_VERSION $ENV{DISPLAYVERSION})
  14. endif ()
  15. include(GenerateSCMRev)
  16. add_library(common STATIC
  17. address_space.cpp
  18. address_space.h
  19. algorithm.h
  20. alignment.h
  21. announce_multiplayer_room.h
  22. assert.cpp
  23. assert.h
  24. atomic_helpers.h
  25. atomic_ops.h
  26. detached_tasks.cpp
  27. detached_tasks.h
  28. bit_cast.h
  29. bit_field.h
  30. bit_set.h
  31. bit_util.h
  32. cityhash.cpp
  33. cityhash.h
  34. common_funcs.h
  35. common_types.h
  36. concepts.h
  37. div_ceil.h
  38. dynamic_library.cpp
  39. dynamic_library.h
  40. elf.h
  41. error.cpp
  42. error.h
  43. expected.h
  44. fiber.cpp
  45. fiber.h
  46. fixed_point.h
  47. fs/file.cpp
  48. fs/file.h
  49. fs/fs.cpp
  50. fs/fs.h
  51. fs/fs_paths.h
  52. fs/fs_types.h
  53. fs/fs_util.cpp
  54. fs/fs_util.h
  55. fs/path_util.cpp
  56. fs/path_util.h
  57. hash.h
  58. hex_util.cpp
  59. hex_util.h
  60. host_memory.cpp
  61. host_memory.h
  62. input.h
  63. intrusive_red_black_tree.h
  64. literals.h
  65. logging/backend.cpp
  66. logging/backend.h
  67. logging/filter.cpp
  68. logging/filter.h
  69. logging/formatter.h
  70. logging/log.h
  71. logging/log_entry.h
  72. logging/text_formatter.cpp
  73. logging/text_formatter.h
  74. logging/types.h
  75. lz4_compression.cpp
  76. lz4_compression.h
  77. math_util.h
  78. memory_detect.cpp
  79. memory_detect.h
  80. microprofile.cpp
  81. microprofile.h
  82. microprofileui.h
  83. multi_level_page_table.cpp
  84. multi_level_page_table.h
  85. nvidia_flags.cpp
  86. nvidia_flags.h
  87. page_table.cpp
  88. page_table.h
  89. param_package.cpp
  90. param_package.h
  91. parent_of_member.h
  92. point.h
  93. quaternion.h
  94. reader_writer_queue.h
  95. ring_buffer.h
  96. ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp
  97. scm_rev.h
  98. scope_exit.h
  99. settings.cpp
  100. settings.h
  101. settings_input.cpp
  102. settings_input.h
  103. socket_types.h
  104. spin_lock.cpp
  105. spin_lock.h
  106. stream.cpp
  107. stream.h
  108. string_util.cpp
  109. string_util.h
  110. swap.h
  111. telemetry.cpp
  112. telemetry.h
  113. thread.cpp
  114. thread.h
  115. thread_queue_list.h
  116. thread_worker.h
  117. threadsafe_queue.h
  118. time_zone.cpp
  119. time_zone.h
  120. tiny_mt.h
  121. tree.h
  122. uint128.h
  123. unique_function.h
  124. uuid.cpp
  125. uuid.h
  126. vector_math.h
  127. virtual_buffer.cpp
  128. virtual_buffer.h
  129. wall_clock.cpp
  130. wall_clock.h
  131. zstd_compression.cpp
  132. zstd_compression.h
  133. )
  134. if(ARCHITECTURE_x86_64)
  135. target_sources(common
  136. PRIVATE
  137. x64/cpu_detect.cpp
  138. x64/cpu_detect.h
  139. x64/native_clock.cpp
  140. x64/native_clock.h
  141. x64/xbyak_abi.h
  142. x64/xbyak_util.h
  143. )
  144. target_link_libraries(common PRIVATE xbyak)
  145. endif()
  146. if (MSVC)
  147. target_compile_definitions(common PRIVATE
  148. # The standard library doesn't provide any replacement for codecvt yet
  149. # so we can disable this deprecation warning for the time being.
  150. _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
  151. )
  152. target_compile_options(common PRIVATE
  153. /W4
  154. /WX
  155. )
  156. else()
  157. target_compile_options(common PRIVATE
  158. -Werror
  159. $<$<CXX_COMPILER_ID:Clang>:-fsized-deallocation>
  160. )
  161. endif()
  162. create_target_directory_groups(common)
  163. target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads)
  164. target_link_libraries(common PRIVATE lz4::lz4)
  165. if (TARGET zstd::zstd)
  166. target_link_libraries(common PRIVATE zstd::zstd)
  167. else()
  168. target_link_libraries(common PRIVATE
  169. $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)
  170. endif()