From 9d45afdb0ad8e8f75ac976911d66a6f875050f26 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 30 Jun 2019 11:49:13 +0100 Subject: [PATCH] Update loot-condition-interpreter to v2.0.0 Using its new cbindgen config file needs an update to cbindgen v0.9.0. --- .travis.yml | 6 +++++- CMakeLists.txt | 4 ++-- appveyor.yml | 5 ++++- src/api/metadata/condition_evaluator.cpp | 18 +++++++++--------- src/api/metadata/condition_evaluator.h | 2 +- 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed387a48..719d9431 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,11 @@ install: # Add sphinx-build to PATH - export PATH="$HOME/.local/bin:$PATH" # Install cbindgen for generating C++ headers for Rust dependencies. - - cbindgen --version || cargo install cbindgen --version 0.6.6 + - | + if [[ "$(cbindgen --version)" != *0.9.0 ]] + then + cargo install cbindgen --version 0.9.0 --force + fi before_script: - mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt index e11531bf..8a160174 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -126,11 +126,11 @@ ENDIF () ExternalProject_Add(loot-condition-interpreter PREFIX "external" - URL "https://github.com/loot/loot-condition-interpreter/archive/1.3.0.tar.gz" + URL "https://github.com/loot/loot-condition-interpreter/archive/2.0.0.tar.gz" CONFIGURE_COMMAND "" BUILD_IN_SOURCE 1 BUILD_COMMAND cargo build --release --manifest-path ffi/Cargo.toml --target ${RUST_TARGET} && - cbindgen ffi/ -l c++ -o ffi/include/loot_condition_interpreter.hpp + cbindgen ffi/ -o ffi/include/loot_condition_interpreter.h INSTALL_COMMAND "") ExternalProject_Get_Property(loot-condition-interpreter SOURCE_DIR) set (LCI_INCLUDE_DIRS "${SOURCE_DIR}/ffi/include") diff --git a/appveyor.yml b/appveyor.yml index e36b6046..e74e7b82 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,7 +25,10 @@ install: - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe -y - rustup target add i686-pc-windows-msvc - - where cbindgen || cargo install cbindgen --version 0.6.6 + - ps: | + $version = cbindgen --version + if (!([string]$version).endswith('0.9.0')) { $env:INSTALL_CBINDGEN=1 } + - IF "%INSTALL_CBINDGEN%" == "1" cargo install cbindgen --version 0.9.0 --force - nuget install doxygen -Version 1.8.14 - py -3 -m pip install -r docs/requirements.txt - ps: (New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/Ortham/ci-scripts/2.1.3/delete_old_bintray_versions.py', "$env:APPVEYOR_BUILD_FOLDER\delete_old_bintray_versions.py") diff --git a/src/api/metadata/condition_evaluator.cpp b/src/api/metadata/condition_evaluator.cpp index 585851ba..8068efbd 100644 --- a/src/api/metadata/condition_evaluator.cpp +++ b/src/api/metadata/condition_evaluator.cpp @@ -59,23 +59,23 @@ void HandleError(const std::string operation, int returnCode) { int mapGameType(GameType gameType) { switch (gameType) { case GameType::tes3: - return LCI_GAME_TES3; + return LCI_GAME_MORROWIND; case GameType::tes4: - return LCI_GAME_TES4; + return LCI_GAME_OBLIVION; case GameType::tes5: - return LCI_GAME_TES5; + return LCI_GAME_SKYRIM; case GameType::tes5se: - return LCI_GAME_TES5SE; + return LCI_GAME_SKYRIM_SE; case GameType::tes5vr: - return LCI_GAME_TES5VR; + return LCI_GAME_SKYRIM_VR; case GameType::fo3: - return LCI_GAME_FO3; + return LCI_GAME_FALLOUT_3; case GameType::fonv: - return LCI_GAME_FNV; + return LCI_GAME_FALLOUT_NV; case GameType::fo4: - return LCI_GAME_FO4; + return LCI_GAME_FALLOUT_4; case GameType::fo4vr: - return LCI_GAME_FO4VR; + return LCI_GAME_FALLOUT_4_VR; default: throw std::runtime_error("Unrecognised game type encountered while mapping for condition evaluation."); } diff --git a/src/api/metadata/condition_evaluator.h b/src/api/metadata/condition_evaluator.h index a73c50b1..ff12483f 100644 --- a/src/api/metadata/condition_evaluator.h +++ b/src/api/metadata/condition_evaluator.h @@ -28,7 +28,7 @@ #include #include -#include +#include #include "api/game/game_cache.h" #include "api/game/load_order_handler.h"