CMakeLists.txt 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Definitions for all external bundled libraries
  2. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
  3. include(DownloadExternals)
  4. # Catch
  5. add_library(catch-single-include INTERFACE)
  6. target_include_directories(catch-single-include INTERFACE catch/single_include)
  7. # Crypto++
  8. add_subdirectory(cryptopp)
  9. # Dynarmic
  10. # Dynarmic will skip defining xbyak if it's already defined, we then define it below
  11. add_library(xbyak INTERFACE)
  12. option(DYNARMIC_TESTS OFF)
  13. set(DYNARMIC_NO_BUNDLED_FMT ON)
  14. add_subdirectory(dynarmic)
  15. # libfmt
  16. add_subdirectory(fmt)
  17. # getopt
  18. if (MSVC)
  19. add_subdirectory(getopt)
  20. endif()
  21. # Glad
  22. add_subdirectory(glad)
  23. # inih
  24. add_subdirectory(inih)
  25. # lz4
  26. set(LZ4_BUNDLED_MODE ON)
  27. add_subdirectory(lz4/contrib/cmake_unofficial)
  28. target_include_directories(lz4_static INTERFACE ./lz4/lib)
  29. # MicroProfile
  30. add_library(microprofile INTERFACE)
  31. target_include_directories(microprofile INTERFACE ./microprofile)
  32. # Nihstro
  33. add_library(nihstro-headers INTERFACE)
  34. target_include_directories(nihstro-headers INTERFACE ./nihstro/include)
  35. # SoundTouch
  36. add_subdirectory(soundtouch)
  37. # The SoundTouch target doesn't export the necessary include paths as properties by default
  38. target_include_directories(SoundTouch INTERFACE ./soundtouch/include)
  39. # Unicorn
  40. add_library(unicorn-headers INTERFACE)
  41. target_include_directories(unicorn-headers INTERFACE ./unicorn/include)
  42. # Xbyak
  43. if (ARCHITECTURE_x86_64)
  44. # Defined before "dynarmic" above
  45. # add_library(xbyak INTERFACE)
  46. target_include_directories(xbyak INTERFACE ./xbyak/xbyak)
  47. target_compile_definitions(xbyak INTERFACE XBYAK_NO_OP_NAMES)
  48. endif()
  49. # ENet
  50. add_subdirectory(enet)
  51. target_include_directories(enet INTERFACE ./enet/include)
  52. if (ENABLE_WEB_SERVICE)
  53. # msys installed curl is configured to use openssl, but that isn't portable
  54. # since it relies on having the bundled certs install in the home folder for SSL
  55. # by default on mingw, download the precompiled curl thats linked against windows native ssl
  56. if (MINGW AND CITRA_USE_BUNDLED_CURL)
  57. download_bundled_external("curl/" "curl-7_55_1" CURL_PREFIX)
  58. set(CURL_PREFIX "${CMAKE_BINARY_DIR}/externals/curl-7_55_1")
  59. set(CURL_FOUND YES)
  60. set(CURL_INCLUDE_DIR "${CURL_PREFIX}/include" CACHE PATH "Path to curl headers")
  61. set(CURL_LIBRARY "${CURL_PREFIX}/lib/libcurldll.a" CACHE PATH "Path to curl library")
  62. set(CURL_DLL_DIR "${CURL_PREFIX}/lib/" CACHE PATH "Path to curl.dll")
  63. set(USE_SYSTEM_CURL ON CACHE BOOL "")
  64. endif()
  65. # CPR
  66. set(BUILD_TESTING OFF CACHE BOOL "")
  67. set(BUILD_CPR_TESTS OFF CACHE BOOL "")
  68. add_subdirectory(cpr)
  69. target_include_directories(cpr INTERFACE ./cpr/include)
  70. # JSON
  71. add_library(json-headers INTERFACE)
  72. target_include_directories(json-headers INTERFACE ./json)
  73. endif()