CMakeLists.txt 2.4 KB

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