CMakeLists.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 "citra-emu/citra-?(.*)" 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 its 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. set(SRCS
  27. break_points.cpp
  28. file_util.cpp
  29. framebuffer_layout.cpp
  30. hash.cpp
  31. logging/filter.cpp
  32. logging/text_formatter.cpp
  33. logging/backend.cpp
  34. memory_util.cpp
  35. microprofile.cpp
  36. misc.cpp
  37. param_package.cpp
  38. scm_rev.cpp
  39. string_util.cpp
  40. telemetry.cpp
  41. thread.cpp
  42. timer.cpp
  43. )
  44. set(HEADERS
  45. alignment.h
  46. assert.h
  47. bit_field.h
  48. bit_set.h
  49. break_points.h
  50. chunk_file.h
  51. code_block.h
  52. color.h
  53. common_funcs.h
  54. common_paths.h
  55. common_types.h
  56. file_util.h
  57. framebuffer_layout.h
  58. hash.h
  59. linear_disk_cache.h
  60. logging/text_formatter.h
  61. logging/filter.h
  62. logging/log.h
  63. logging/backend.h
  64. math_util.h
  65. memory_util.h
  66. microprofile.h
  67. microprofileui.h
  68. param_package.h
  69. platform.h
  70. quaternion.h
  71. scm_rev.h
  72. scope_exit.h
  73. string_util.h
  74. swap.h
  75. synchronized_wrapper.h
  76. telemetry.h
  77. thread.h
  78. thread_queue_list.h
  79. timer.h
  80. vector_math.h
  81. )
  82. if(ARCHITECTURE_x86_64)
  83. set(SRCS ${SRCS}
  84. x64/cpu_detect.cpp
  85. )
  86. set(HEADERS ${HEADERS}
  87. x64/cpu_detect.h
  88. x64/xbyak_abi.h
  89. x64/xbyak_util.h
  90. )
  91. endif()
  92. create_directory_groups(${SRCS} ${HEADERS})
  93. add_library(common STATIC ${SRCS} ${HEADERS})
  94. if (ARCHITECTURE_x86_64)
  95. target_link_libraries(common xbyak)
  96. endif()