From 96b7ddd5f610903d7a0eae5eddf73cd6fe4ba0f9 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Thu, 23 Aug 2018 20:41:02 +0100 Subject: [PATCH] Update yaml-cpp Now depending on a specific tag rather than a branch to avoid any future rebases breaking anything. The tagged commit contains merge key support on top of a revision slightly more recent than the latest release (0.6.2), which has a few issues. --- CMakeLists.txt | 15 +++++++++++++-- src/api/metadata/yaml/file.h | 2 ++ src/api/metadata/yaml/group.h | 2 ++ src/api/metadata/yaml/location.h | 2 ++ src/api/metadata/yaml/message.h | 2 ++ src/api/metadata/yaml/message_content.h | 2 ++ src/api/metadata/yaml/plugin_cleaning_data.h | 2 ++ src/api/metadata/yaml/plugin_metadata.h | 2 ++ src/api/metadata/yaml/set.h | 2 ++ src/api/metadata/yaml/tag.h | 2 ++ 10 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c376e6af..1b901c6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,13 +149,24 @@ set(SPDLOG_INCLUDE_DIRS "${SOURCE_DIR}/include") ExternalProject_Add(yaml-cpp PREFIX "external" - URL "https://github.com/WrinklyNinja/yaml-cpp/archive/patched-for-loot.tar.gz" + URL "https://github.com/loot/yaml-cpp/archive/yaml-cpp-0.6.2+merge-key-support.2.tar.gz" CMAKE_ARGS -DMSVC_SHARED_RT=${MSVC_SHARED_RUNTIME} -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} BUILD_COMMAND ${CMAKE_COMMAND} --build . --target yaml-cpp --config $(CONFIGURATION) INSTALL_COMMAND "") ExternalProject_Get_Property(yaml-cpp SOURCE_DIR BINARY_DIR) + +if (MSVC) + if (MSVC_STATIC_RUNTIME) + set(YAML_CPP_LIBRARY_SUFFIX "${YAML_CPP_LIBRARY_SUFFIX}mt") + else() + set(YAML_CPP_LIBRARY_SUFFIX "${YAML_CPP_LIBRARY_SUFFIX}md") + endif() +endif() + +set(YAML_CPP_LIBRARY_SUFFIX "${LIB_SUFFIX}${YAML_CPP_LIBRARY_SUFFIX}$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX}") set(YAML_CPP_INCLUDE_DIRS "${SOURCE_DIR}/include") -set(YAML_CPP_LIBRARIES "${BINARY_DIR}/${CMAKE_CFG_INTDIR}/libyaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}") +set(YAML_CPP_LIBRARIES "${BINARY_DIR}/${CMAKE_CFG_INTDIR}/libyaml-cpp${YAML_CPP_LIBRARY_SUFFIX}") + ############################## # General Settings diff --git a/src/api/metadata/yaml/file.h b/src/api/metadata/yaml/file.h index dc62cefa..ec2bffdf 100644 --- a/src/api/metadata/yaml/file.h +++ b/src/api/metadata/yaml/file.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_FILE #define LOOT_YAML_FILE +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/group.h b/src/api/metadata/yaml/group.h index 3b991098..df90da07 100644 --- a/src/api/metadata/yaml/group.h +++ b/src/api/metadata/yaml/group.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_GROUP #define LOOT_YAML_GROUP +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/location.h b/src/api/metadata/yaml/location.h index 0f499ba0..ac24989f 100644 --- a/src/api/metadata/yaml/location.h +++ b/src/api/metadata/yaml/location.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_LOCATION #define LOOT_YAML_LOCATION +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/message.h b/src/api/metadata/yaml/message.h index 73e8abc9..41b92e3f 100644 --- a/src/api/metadata/yaml/message.h +++ b/src/api/metadata/yaml/message.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_MESSAGE #define LOOT_YAML_MESSAGE +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/message_content.h b/src/api/metadata/yaml/message_content.h index d7e9815d..7cbfa105 100644 --- a/src/api/metadata/yaml/message_content.h +++ b/src/api/metadata/yaml/message_content.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_MESSAGE_CONTENT #define LOOT_YAML_MESSAGE_CONTENT +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/plugin_cleaning_data.h b/src/api/metadata/yaml/plugin_cleaning_data.h index f461ea65..e2c5f450 100644 --- a/src/api/metadata/yaml/plugin_cleaning_data.h +++ b/src/api/metadata/yaml/plugin_cleaning_data.h @@ -25,6 +25,8 @@ #ifndef LOOT_YAML_PLUGIN_CLEANING_DATA #define LOOT_YAML_PLUGIN_CLEANING_DATA +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/plugin_metadata.h b/src/api/metadata/yaml/plugin_metadata.h index d63a8b6d..6a0ccdf9 100644 --- a/src/api/metadata/yaml/plugin_metadata.h +++ b/src/api/metadata/yaml/plugin_metadata.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_PLUGIN_METADATA #define LOOT_YAML_PLUGIN_METADATA +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include #include diff --git a/src/api/metadata/yaml/set.h b/src/api/metadata/yaml/set.h index 6c68d284..333c4fc0 100644 --- a/src/api/metadata/yaml/set.h +++ b/src/api/metadata/yaml/set.h @@ -25,6 +25,8 @@ #ifndef LOOT_YAML_SET #define LOOT_YAML_SET +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include diff --git a/src/api/metadata/yaml/tag.h b/src/api/metadata/yaml/tag.h index ed7c55d9..0d01ac69 100644 --- a/src/api/metadata/yaml/tag.h +++ b/src/api/metadata/yaml/tag.h @@ -24,6 +24,8 @@ #ifndef LOOT_YAML_TAG #define LOOT_YAML_TAG +#define YAML_CPP_SUPPORT_MERGE_KEYS + #include #include