CMakeLists.txt 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. cityhash.cpp
  34. cityhash.h
  35. color.h
  36. common_funcs.h
  37. common_paths.h
  38. common_types.h
  39. file_util.cpp
  40. file_util.h
  41. hash.h
  42. logging/backend.cpp
  43. logging/backend.h
  44. logging/filter.cpp
  45. logging/filter.h
  46. logging/log.h
  47. logging/text_formatter.cpp
  48. logging/text_formatter.h
  49. math_util.h
  50. memory_util.cpp
  51. memory_util.h
  52. microprofile.cpp
  53. microprofile.h
  54. microprofileui.h
  55. misc.cpp
  56. param_package.cpp
  57. param_package.h
  58. quaternion.h
  59. scm_rev.cpp
  60. scm_rev.h
  61. scope_exit.h
  62. string_util.cpp
  63. string_util.h
  64. swap.h
  65. telemetry.cpp
  66. telemetry.h
  67. thread.cpp
  68. thread.h
  69. thread_queue_list.h
  70. threadsafe_queue.h
  71. timer.cpp
  72. timer.h
  73. vector_math.h
  74. )
  75. if(ARCHITECTURE_x86_64)
  76. target_sources(common
  77. PRIVATE
  78. x64/cpu_detect.cpp
  79. x64/cpu_detect.h
  80. x64/xbyak_abi.h
  81. x64/xbyak_util.h
  82. )
  83. endif()
  84. create_target_directory_groups(common)
  85. target_link_libraries(common PUBLIC Boost::boost fmt microprofile)
  86. if (ARCHITECTURE_x86_64)
  87. target_link_libraries(common PRIVATE xbyak)
  88. endif()