CMakeLists.txt 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # Generate cpp with Git revision from template
  2. # Also if this is a CI build, add the build name (ie: Nightly, Bleeding Edge) to the scm_rev file as well
  3. set(REPO_NAME "")
  4. if ($ENV{CI})
  5. if ($ENV{TRAVIS})
  6. set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG})
  7. elseif($ENV{APPVEYOR})
  8. set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME})
  9. endif()
  10. # regex capture the string nightly or bleeding-edge into CMAKE_MATCH_1
  11. string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY})
  12. if (${CMAKE_MATCH_COUNT} GREATER 0)
  13. # capitalize the first letter of each word in the repo name.
  14. string(REPLACE "-" ";" REPO_NAME_LIST ${CMAKE_MATCH_1})
  15. foreach(WORD ${REPO_NAME_LIST})
  16. string(SUBSTRING ${WORD} 0 1 FIRST_LETTER)
  17. string(SUBSTRING ${WORD} 1 -1 REMAINDER)
  18. string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
  19. # this leaves a trailing space on the last word, but we actually want that
  20. # because of how it's styled in the title bar.
  21. set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER} ")
  22. endforeach()
  23. endif()
  24. endif()
  25. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY)
  26. add_library(common STATIC
  27. alignment.h
  28. assert.h
  29. bit_field.h
  30. bit_set.h
  31. break_points.cpp
  32. break_points.h
  33. chunk_file.h
  34. cityhash.cpp
  35. cityhash.h
  36. code_block.h
  37. color.h
  38. common_funcs.h
  39. common_paths.h
  40. common_types.h
  41. file_util.cpp
  42. file_util.h
  43. hash.h
  44. linear_disk_cache.h
  45. logging/backend.cpp
  46. logging/backend.h
  47. logging/filter.cpp
  48. logging/filter.h
  49. logging/log.h
  50. logging/text_formatter.cpp
  51. logging/text_formatter.h
  52. math_util.h
  53. memory_util.cpp
  54. memory_util.h
  55. microprofile.cpp
  56. microprofile.h
  57. microprofileui.h
  58. misc.cpp
  59. param_package.cpp
  60. param_package.h
  61. quaternion.h
  62. scm_rev.cpp
  63. scm_rev.h
  64. scope_exit.h
  65. string_util.cpp
  66. string_util.h
  67. swap.h
  68. synchronized_wrapper.h
  69. telemetry.cpp
  70. telemetry.h
  71. thread.cpp
  72. thread.h
  73. thread_queue_list.h
  74. threadsafe_queue.h
  75. timer.cpp
  76. timer.h
  77. vector_math.h
  78. )
  79. if(ARCHITECTURE_x86_64)
  80. target_sources(common
  81. PRIVATE
  82. x64/cpu_detect.cpp
  83. x64/cpu_detect.h
  84. x64/xbyak_abi.h
  85. x64/xbyak_util.h
  86. )
  87. endif()
  88. create_target_directory_groups(common)
  89. target_link_libraries(common PUBLIC Boost::boost fmt microprofile)
  90. if (ARCHITECTURE_x86_64)
  91. target_link_libraries(common PRIVATE xbyak)
  92. endif()