From abb5ffb562ddfeddc831c01394688f18b2fcb9ec Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 19 Apr 2025 14:52:07 +0100 Subject: [PATCH] Remove ability to use find_package for yaml-cpp dependency If the build system happens to have yaml-cpp installed as a system package it would link against that, causing non-obvious errors when libloot is then unable to resolve masterlist merge keys. As such, make it so that can't accidentally happen. Also document an alternative approach for getting FetchContent to use existing sources instead of trying to download them, which is relevant for building LOOT's Flatpak. --- CMakeLists.txt | 3 +-- README.md | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf76c372..b71abbe3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -179,8 +179,7 @@ set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1) FetchContent_Declare( yaml-cpp URL "https://github.com/loot/yaml-cpp/archive/0.8.0+merge-key-support.2.tar.gz" - URL_HASH "SHA256=e91779044cd4025ec10ed31986031031ef22ebce90a64cc8f85e7c7e95a1abc6" - FIND_PACKAGE_ARGS) + URL_HASH "SHA256=e91779044cd4025ec10ed31986031031ef22ebce90a64cc8f85e7c7e95a1abc6") # Set BUILD_SHARED_LIBS=OFF to prevent fmt and spdlog from being built as shared # libraries. diff --git a/README.md b/README.md index b3ff0518..5dca21b8 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Parameter | Values | Default |Description `ESPLUGIN_URL` | A URL | A GitHub release archive URL | The URL to get a source code archive from. This can be used to supply a local path if the archive has already been downloaded (e.g. for offline builds). `LIBLOADORDER_URL` | A URL | A GitHub release archive URL | The URL to get a source code archive from. This can be used to supply a local path if the archive has already been downloaded (e.g. for offline builds). `LOOT_CONDITION_INTERPRETER_URL` | A URL | A GitHub release archive URL | The URL to get a source code archive from. This can be used to supply a local path if the archive has already been downloaded (e.g. for offline builds). +`FETCHCONTENT_SOURCE_DIR_YAML-CPP` | A path | Unset | The path to an existing yaml-cpp source folder to build yaml-cpp from. Note that libloot relies on [a fork of yaml-cpp](https://github.com/loot/yaml-cpp) to support YAML merge keys in metadata files. If unset, CMake will download the source from GitHub when the libloot build is configured. You may also need to set `CMAKE_PREFIX_PATH` if CMake cannot find Boost.