CMakeLists.txt 2.7 KB

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