CMakeLists.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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_precompiled_headers.h
  36. common_types.h
  37. concepts.h
  38. div_ceil.h
  39. dynamic_library.cpp
  40. dynamic_library.h
  41. elf.h
  42. error.cpp
  43. error.h
  44. expected.h
  45. fiber.cpp
  46. fiber.h
  47. fixed_point.h
  48. fs/file.cpp
  49. fs/file.h
  50. fs/fs.cpp
  51. fs/fs.h
  52. fs/fs_paths.h
  53. fs/fs_types.h
  54. fs/fs_util.cpp
  55. fs/fs_util.h
  56. fs/path_util.cpp
  57. fs/path_util.h
  58. hash.h
  59. hex_util.cpp
  60. hex_util.h
  61. host_memory.cpp
  62. host_memory.h
  63. input.h
  64. intrusive_red_black_tree.h
  65. literals.h
  66. logging/backend.cpp
  67. logging/backend.h
  68. logging/filter.cpp
  69. logging/filter.h
  70. logging/formatter.h
  71. logging/log.h
  72. logging/log_entry.h
  73. logging/text_formatter.cpp
  74. logging/text_formatter.h
  75. logging/types.h
  76. lz4_compression.cpp
  77. lz4_compression.h
  78. make_unique_for_overwrite.h
  79. math_util.h
  80. memory_detect.cpp
  81. memory_detect.h
  82. microprofile.cpp
  83. microprofile.h
  84. microprofileui.h
  85. multi_level_page_table.cpp
  86. multi_level_page_table.h
  87. nvidia_flags.cpp
  88. nvidia_flags.h
  89. page_table.cpp
  90. page_table.h
  91. param_package.cpp
  92. param_package.h
  93. parent_of_member.h
  94. point.h
  95. precompiled_headers.h
  96. quaternion.h
  97. range_map.h
  98. reader_writer_queue.h
  99. ring_buffer.h
  100. ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp
  101. scm_rev.h
  102. scope_exit.h
  103. scratch_buffer.h
  104. settings.cpp
  105. settings.h
  106. settings_input.cpp
  107. settings_input.h
  108. socket_types.h
  109. spin_lock.cpp
  110. spin_lock.h
  111. stream.cpp
  112. stream.h
  113. string_util.cpp
  114. string_util.h
  115. swap.h
  116. telemetry.cpp
  117. telemetry.h
  118. thread.cpp
  119. thread.h
  120. thread_queue_list.h
  121. thread_worker.h
  122. threadsafe_queue.h
  123. time_zone.cpp
  124. time_zone.h
  125. tiny_mt.h
  126. tree.h
  127. uint128.h
  128. unique_function.h
  129. uuid.cpp
  130. uuid.h
  131. vector_math.h
  132. virtual_buffer.cpp
  133. virtual_buffer.h
  134. wall_clock.cpp
  135. wall_clock.h
  136. zstd_compression.cpp
  137. zstd_compression.h
  138. )
  139. if(ARCHITECTURE_x86_64)
  140. target_sources(common
  141. PRIVATE
  142. x64/cpu_detect.cpp
  143. x64/cpu_detect.h
  144. x64/native_clock.cpp
  145. x64/native_clock.h
  146. x64/xbyak_abi.h
  147. x64/xbyak_util.h
  148. )
  149. target_link_libraries(common PRIVATE xbyak::xbyak)
  150. endif()
  151. if (MSVC)
  152. target_compile_definitions(common PRIVATE
  153. # The standard library doesn't provide any replacement for codecvt yet
  154. # so we can disable this deprecation warning for the time being.
  155. _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
  156. )
  157. target_compile_options(common PRIVATE
  158. /W4
  159. /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
  160. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  161. /we4800 # Implicit conversion from 'type' to bool. Possible information loss
  162. )
  163. else()
  164. target_compile_options(common PRIVATE
  165. $<$<CXX_COMPILER_ID:Clang>:-fsized-deallocation>
  166. )
  167. endif()
  168. create_target_directory_groups(common)
  169. target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads)
  170. target_link_libraries(common PRIVATE lz4::lz4 zstd::zstd)
  171. if (YUZU_USE_PRECOMPILED_HEADERS)
  172. target_precompile_headers(common PRIVATE precompiled_headers.h)
  173. endif()