C Interface for PokemonLibrary.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-05-04 18:07:39 +02:00
parent 4edfb6ca85
commit a19965c1c3
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
4 changed files with 20 additions and 4 deletions

View File

@ -0,0 +1,16 @@
#include "../../src/Library/PokemonLibrary.hpp"
#include "../Core.hpp"
using namespace PkmnLib::Library;
export uint8_t PkmnLib_PokemonLibrary_Construct(PokemonLibrary*& out, PkmnLib::Library::LibrarySettings* settings,
SpeciesLibrary* species, MoveLibrary* moves, ItemLibrary* items,
CreatureLib::Library::GrowthRateLibrary* growthRates,
CreatureLib::Library::TypeLibrary* typeLibrary,
NatureLibrary* natures) {
Try(out = new PokemonLibrary(settings, species, moves, items, growthRates, typeLibrary, natures));
}
export void PkmnLib_PokemonLibrary_Destruct(const PokemonLibrary* p) { delete p; }
export const NatureLibrary* PkmnLib_PokemonLibrary_GetNatureLibrary(const PokemonLibrary* p) {
return p->GetNatureLibrary();
}

View File

@ -41,10 +41,10 @@ if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
if (NOT WINDOWS)
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
-s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:staticC=${CONAN_STATIC_C})
-s compiler=clang -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True)
else ()
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:staticC=${CONAN_STATIC_C})
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=${VERSION} -s os=Windows -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True)
endif ()
endif ()
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)

View File

@ -43,7 +43,7 @@ class PkmnLibConan(ConanFile):
def configure(self):
if self.options.script_handler == "angelscript":
self.options["AngelScript"].shared = True
if self.settings.os == "Windows":
if self.options.staticC:
self.options["AngelScript"].link_std_statically = True
def requirements(self):

View File

@ -37,7 +37,7 @@ namespace PkmnLib::Library {
return (const ItemLibrary*)(CreatureLib::Library::DataLibrary::GetItemLibrary());
}
[[nodiscard]] const NatureLibrary* GetNatureLibrary() const { return _natures; }
[[nodiscard]] const NatureLibrary* GetNatureLibrary() const noexcept { return _natures; }
};
}