cmake: support `rapidyaml`

This commit is contained in:
Tyler Wilding 2021-12-23 21:55:32 -05:00 committed by refractionpcsx2
parent 9533fa25c3
commit 4d4b24f8b0
3 changed files with 10 additions and 15 deletions

View File

@ -229,7 +229,7 @@ for ARG in "$@"; do
echo "** Distribution Compatibilities **" echo "** Distribution Compatibilities **"
echo "--sdl12 : Build with SDL1.2 (requires if wx is linked against SDL1.2)" echo "--sdl12 : Build with SDL1.2 (requires if wx is linked against SDL1.2)"
echo "--no-portaudio : Skip portaudio for SPU2." echo "--no-portaudio : Skip portaudio for SPU2."
echo "--use-system-yaml : Use the system version of yaml-cpp, if available." echo "--use-system-yaml : Use system rapidyaml library"
echo echo
echo "** Expert Developer option **" echo "** Expert Developer option **"
echo "--gtk2 : use GTK 2 instead of GTK 3" echo "--gtk2 : use GTK 2 instead of GTK 3"

View File

@ -229,26 +229,21 @@ else()
endif() endif()
if(USE_SYSTEM_YAML) if(USE_SYSTEM_YAML)
find_package(yaml-cpp "0.6.3" QUIET) find_package(ryml REQUIRED)
if(NOT yaml-cpp_FOUND) if(NOT ryml_FOUND)
message(STATUS "No system yaml-cpp was found") message(STATUS "No system rapidyaml was found, using the submodule in the 3rdparty directory")
set(USE_SYSTEM_YAML OFF) set(USE_SYSTEM_YAML OFF)
else() else()
message(STATUS "Found yaml-cpp: ${yaml-cpp_VERSION}") message(STATUS "Found rapidyaml: ${rapidyaml_VERSION}")
message(STATUS "Note that the latest release of yaml-cpp is very outdated, and the bundled submodule in the repo has over a year of bug fixes and as such is preferred.")
endif() endif()
endif() endif()
if(NOT USE_SYSTEM_YAML) if(NOT USE_SYSTEM_YAML)
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/yaml-cpp/yaml-cpp/CMakeLists.txt") if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/rapidyaml/rapidyaml/CMakeLists.txt")
message(STATUS "Using bundled yaml-cpp") message(STATUS "Using bundled rapidyaml")
add_subdirectory(3rdparty/yaml-cpp/yaml-cpp EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/rapidyaml/rapidyaml EXCLUDE_FROM_ALL)
if (NOT MSVC)
# Remove once https://github.com/jbeder/yaml-cpp/pull/815 is merged
target_compile_options(yaml-cpp PRIVATE -Wno-shadow)
endif()
else() else()
message(FATAL_ERROR "No bundled yaml-cpp was found") message(FATAL_ERROR "No bundled rapidyaml was found")
endif() endif()
endif() endif()

View File

@ -1369,7 +1369,7 @@ target_link_libraries(PCSX2_FLAGS INTERFACE
common common
glad glad
fmt::fmt fmt::fmt
yaml-cpp ryml
chdr-static chdr-static
wxWidgets::all wxWidgets::all
ZLIB::ZLIB ZLIB::ZLIB