CMakeLists.txt 2.7 KB

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