From 497acc1311beba21c59df3e95aad74172d57ff1f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 9 Jan 2020 19:03:38 +0100 Subject: [PATCH] Fixes as to make including AngelScript actually possible. --- CMakeLists.txt | 1 + conanfile.py | 5 +---- src/AngelScript/PokemonScriptResolver.cpp | 7 ++++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4871751..3e9e857 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,7 @@ endif (WINDOWS) target_link_libraries(pkmnLib PUBLIC ${_LINKS}) if (SCRIPT_PROVIDER STREQUAL "angelscript") + SET(GCC_COVERAGE_COMPILE_FLAGS "-fno-strict-aliasing") target_link_libraries(pkmnLib-angelscript PUBLIC ${_LINKS}) endif() diff --git a/conanfile.py b/conanfile.py index 65cad76..be38c7a 100644 --- a/conanfile.py +++ b/conanfile.py @@ -21,12 +21,9 @@ class PkmnLibConan(ConanFile): cmake.configure() cmake.build() - # Explicit way: - # self.run('cmake "%s/src" %s' % (self.source_folder, cmake.command_line)) - # self.run("cmake --build . %s" % cmake.build_config) - def package(self): self.copy("*.hpp", dst="include", src="src") + self.copy("*.h", dst="include", src="src") self.copy("*.lib", dst="lib", keep_path=False) self.copy("*.dll", dst="bin", keep_path=False) self.copy("*.dylib*", dst="lib", keep_path=False) diff --git a/src/AngelScript/PokemonScriptResolver.cpp b/src/AngelScript/PokemonScriptResolver.cpp index 77080ef..8721256 100644 --- a/src/AngelScript/PokemonScriptResolver.cpp +++ b/src/AngelScript/PokemonScriptResolver.cpp @@ -1,8 +1,13 @@ #include "../Battling/Library/PokemonScriptResolver.hpp" +#define ANGELSCRIPT_DLL_LIBRARY_IMPORT +#define GetPropertyCache +#undef GetProperty +#include +#define GetProperty GetPropertyCache + using namespace PkmnLib::Battling; void PokemonScriptResolver::Initialize(const PkmnLib::Battling::BattleLibrary* library){ - } CreatureLib::Battling::Script* PokemonScriptResolver::LoadScript(ScriptCategory category, const std::string& scriptName){