Updates to new CreatureLib, with removed precompiled header.
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Deukhoofd 2021-10-30 14:29:57 +02:00
parent 3732cab54b
commit ad3b3bebfa
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
13 changed files with 19 additions and 10 deletions

View File

@ -1,6 +1,7 @@
#ifndef PKMNLIB_CORE_HPP #ifndef PKMNLIB_CORE_HPP
#define PKMNLIB_CORE_HPP #define PKMNLIB_CORE_HPP
#include <Arbutils/Exception.hpp>
#include <cstring> #include <cstring>
#include <exception> #include <exception>
#include <string> #include <string>

View File

@ -99,7 +99,6 @@ endif ()
file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE}) file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE})
add_library(pkmnLib ${LIBTYPE} ${CORE_SRC_FILES}) add_library(pkmnLib ${LIBTYPE} ${CORE_SRC_FILES})
target_precompile_headers(pkmnLib PUBLIC src/Precompiled.hxx)
# Enable all warnings, and make them error when occurring. # Enable all warnings, and make them error when occurring.
target_compile_options(pkmnLib PRIVATE -Wall -Wextra -Werror) target_compile_options(pkmnLib PRIVATE -Wall -Wextra -Werror)

View File

@ -1,6 +1,7 @@
#ifndef PKMNLIB_EVOLUTIONDATA_HPP #ifndef PKMNLIB_EVOLUTIONDATA_HPP
#define PKMNLIB_EVOLUTIONDATA_HPP #define PKMNLIB_EVOLUTIONDATA_HPP
#include <Arbutils/Memory/Memory.hpp>
#include <CreatureLib/Library/EffectParameter.hpp> #include <CreatureLib/Library/EffectParameter.hpp>
#include <CreatureLib/Library/Gender.hpp> #include <CreatureLib/Library/Gender.hpp>
#include "../TimeOfDay.hpp" #include "../TimeOfDay.hpp"

View File

@ -1,6 +1,7 @@
#ifndef PKMNLIB_NATURELIBRARY_HPP #ifndef PKMNLIB_NATURELIBRARY_HPP
#define PKMNLIB_NATURELIBRARY_HPP #define PKMNLIB_NATURELIBRARY_HPP
#include <Arbutils/Memory/Memory.hpp>
#include <Arbutils/Random.hpp> #include <Arbutils/Random.hpp>
#include <CreatureLib/Library/Exceptions/CreatureException.hpp> #include <CreatureLib/Library/Exceptions/CreatureException.hpp>
#include "Nature.hpp" #include "Nature.hpp"

View File

@ -1,6 +0,0 @@
#ifndef PKMNLIB_PRECOMPILED_HXX
#define PKMNLIB_PRECOMPILED_HXX
#include <CreatureLib/Precompiled.hxx>
#endif // PKMNLIB_PRECOMPILED_HXX

View File

@ -1,5 +1,8 @@
#ifndef PKMNLIB_ANGELSCRIPTMETADATA_HPP #ifndef PKMNLIB_ANGELSCRIPTMETADATA_HPP
#define PKMNLIB_ANGELSCRIPTMETADATA_HPP #define PKMNLIB_ANGELSCRIPTMETADATA_HPP
#include <Arbutils/Collections/Dictionary.hpp>
#include <Arbutils/String/StringView.hpp>
#include <string>
class AngelscriptMetadata { class AngelscriptMetadata {
public: public:

View File

@ -2,6 +2,7 @@
#define PKMNLIB_ANGELSCRIPTTYPEINFO_HPP #define PKMNLIB_ANGELSCRIPTTYPEINFO_HPP
#define ANGELSCRIPT_DLL_LIBRARY_IMPORT #define ANGELSCRIPT_DLL_LIBRARY_IMPORT
#include <Arbutils/Collections/Dictionary.hpp>
#include <CreatureLib/Library/Exceptions/CreatureException.hpp> #include <CreatureLib/Library/Exceptions/CreatureException.hpp>
#include <angelscript.h> #include <angelscript.h>
@ -72,11 +73,11 @@ public:
const FunctionInfo& Get##name() const { return __##name; } const FunctionInfo& Get##name() const { return __##name; }
private: private:
FunctionInfo InitializeGetOwner(){ FunctionInfo InitializeGetOwner() {
auto t = _type; auto t = _type;
while (t != nullptr){ while (t != nullptr) {
auto val = t->GetMethodByDecl("ref@& GetOwner()", true); auto val = t->GetMethodByDecl("ref@& GetOwner()", true);
if (val != nullptr){ if (val != nullptr) {
return FunctionInfo{.Exists = true, .Function = val}; return FunctionInfo{.Exists = true, .Function = val};
} }
t = t->GetBaseType(); t = t->GetBaseType();
@ -85,6 +86,7 @@ private:
} }
FunctionInfo __GetOwner = InitializeGetOwner(); FunctionInfo __GetOwner = InitializeGetOwner();
public: public:
const FunctionInfo& GetGetOwner() const { return __GetOwner; } const FunctionInfo& GetGetOwner() const { return __GetOwner; }

View File

@ -1,4 +1,5 @@
#include "BasicScriptClass.hpp" #include "BasicScriptClass.hpp"
#include <Arbutils/Ensure.hpp>
void BasicScriptClass::Register(asIScriptEngine* engine) { void BasicScriptClass::Register(asIScriptEngine* engine) {
// As far as I am aware at the moment you can't create an abstract class with virtual members through the // As far as I am aware at the moment you can't create an abstract class with virtual members through the

View File

@ -1,4 +1,6 @@
#include "ConstString.hpp" #include "ConstString.hpp"
#include <Arbutils/StringView.hpp>
#include <Arbutils/Ensure.hpp>
static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); } static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); }
static void ConstructConstStringFromStd(void* self, const std::string& s) { static void ConstructConstStringFromStd(void* self, const std::string& s) {

View File

@ -1,4 +1,5 @@
#include "RegisterEffectParameter.hpp" #include "RegisterEffectParameter.hpp"
#include <Arbutils/Ensure.hpp>
#include <CreatureLib/Library/EffectParameter.hpp> #include <CreatureLib/Library/EffectParameter.hpp>
static CreatureLib::Library::EffectParameter* Ref_Factory() { return new CreatureLib::Library::EffectParameter(); } static CreatureLib::Library::EffectParameter* Ref_Factory() { return new CreatureLib::Library::EffectParameter(); }

View File

@ -1,4 +1,5 @@
#include "RegisterGrowthRateTypes.hpp" #include "RegisterGrowthRateTypes.hpp"
#include <Arbutils/Ensure.hpp>
#include <CreatureLib/Library/GrowthRates/GrowthRate.hpp> #include <CreatureLib/Library/GrowthRates/GrowthRate.hpp>
#include <CreatureLib/Library/GrowthRates/GrowthRateLibrary.hpp> #include <CreatureLib/Library/GrowthRates/GrowthRateLibrary.hpp>

View File

@ -1,6 +1,8 @@
#ifndef PKMNLIB_NATIVEARRAY_HPP #ifndef PKMNLIB_NATIVEARRAY_HPP
#define PKMNLIB_NATIVEARRAY_HPP #define PKMNLIB_NATIVEARRAY_HPP
#include <Arbutils/Ensure.hpp>
#include <CreatureLib/Defines.hpp>
#include <angelscript.h> #include <angelscript.h>
#include <atomic> #include <atomic>

View File

@ -1,4 +1,5 @@
#ifdef TESTS_BUILD #ifdef TESTS_BUILD
#include <Arbutils/StringView.hpp>
#include "../../extern/doctest.hpp" #include "../../extern/doctest.hpp"
#include "../../src/ScriptResolving/AngelScript/AngelScriptMetadata.hpp" #include "../../src/ScriptResolving/AngelScript/AngelScriptMetadata.hpp"