CMakeLists.txt 4.1 KB

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