Merge the two different libs together into the same library.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
5a41208fdb
commit
a4c4cad59b
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/Battle.hpp"
|
#include "../../src/Battling/Models/Battle.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export uint8_t CreatureLib_Battle_Construct(Battle*& out, const BattleLibrary* library, BattleParty* partyArr[],
|
export uint8_t CreatureLib_Battle_Construct(Battle*& out, const BattleLibrary* library, BattleParty* partyArr[],
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Library/BattleLibrary.hpp"
|
#include "../../src/Battling/Library/BattleLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export uint8_t CreatureLib_BattleLibrary_Construct(const BattleLibrary*& out,
|
export uint8_t CreatureLib_BattleLibrary_Construct(const BattleLibrary*& out,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/BattleParty.hpp"
|
#include "../../src/Battling/Models/BattleParty.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
// Note that creatureIndices should be twice the size of numberOfIndices, and have index of side, index of creature on
|
// Note that creatureIndices should be twice the size of numberOfIndices, and have index of side, index of creature on
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/BattleRandom.hpp"
|
#include "../../src/Battling/Models/BattleRandom.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export BattleRandom* CreatureLib_BattleRandom_Construct() { return new BattleRandom(); }
|
export BattleRandom* CreatureLib_BattleRandom_Construct() { return new BattleRandom(); }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/BattleSide.hpp"
|
#include "../../src/Battling/Models/BattleSide.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export BattleSide* CreatureLib_BattleSide_Construct(uint8_t index, Battle* battle, uint8_t creaturesPerSide) {
|
export BattleSide* CreatureLib_BattleSide_Construct(uint8_t index, Battle* battle, uint8_t creaturesPerSide) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Library/BattleStatCalculator.hpp"
|
#include "../../src/Battling/Library/BattleStatCalculator.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export const BattleStatCalculator* CreatureLib_BattleStatCalculator_Construct() { return new BattleStatCalculator(); }
|
export const BattleStatCalculator* CreatureLib_BattleStatCalculator_Construct() { return new BattleStatCalculator(); }
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
#ifndef CREATURELIB_CORE_HPP
|
|
||||||
#define CREATURELIB_CORE_HPP
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <exception>
|
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
|
||||||
#define export extern "C" [[maybe_unused]]
|
|
||||||
|
|
||||||
#define CreatureLibBattlingException 3;
|
|
||||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
|
||||||
|
|
||||||
class ExceptionHandler {
|
|
||||||
static std::string _creatureLibLastException;
|
|
||||||
|
|
||||||
public:
|
|
||||||
static void SetLastException(std::string function, const std::exception& e) {
|
|
||||||
std::stringstream ss;
|
|
||||||
ss << "[" << function << "] " << e.what();
|
|
||||||
_creatureLibLastException = ss.str();
|
|
||||||
}
|
|
||||||
static const char* GetLastException() { return _creatureLibLastException.c_str(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
#define Try(data) \
|
|
||||||
try { \
|
|
||||||
data; \
|
|
||||||
return 0; \
|
|
||||||
} catch (const std::exception& e) { \
|
|
||||||
ExceptionHandler::SetLastException(__FUNCTION__, e); \
|
|
||||||
return CreatureLibBattlingException; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define SIMPLE_GET_FUNC(type, name, returnType) \
|
|
||||||
export returnType CreatureLib_##type##_##name(const type* p) { return p->name(); }
|
|
||||||
#define BORROWED_GET_FUNC(type, name, returnType) \
|
|
||||||
export returnType CreatureLib_##type##_##name(const type* p) { return p->name().GetRaw(); }
|
|
||||||
#define SMART_GET_FUNC(type, name, returnType) \
|
|
||||||
export returnType CreatureLib_##type##_##name(const type* p) { return p->name().get(); }
|
|
||||||
|
|
||||||
#endif // CREATURELIB_CORE_HPP
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/Creature.hpp"
|
#include "../../src/Battling/Models/Creature.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export uint8_t CreatureLib_Creature_Construct(Creature*& out, const BattleLibrary* library,
|
export uint8_t CreatureLib_Creature_Construct(Creature*& out, const BattleLibrary* library,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/CreatureParty.hpp"
|
#include "../../src/Battling/Models/CreatureParty.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export CreatureParty* CreatureLib_CreatureParty_ConstructWithSize(size_t size) { return new CreatureParty(size); }
|
export CreatureParty* CreatureLib_CreatureParty_ConstructWithSize(size_t size) { return new CreatureParty(size); }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Library/DamageLibrary.hpp"
|
#include "../../src/Battling/Library/DamageLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export const DamageLibrary* CreatureLib_DamageLibrary_Construct() { return new DamageLibrary(); }
|
export const DamageLibrary* CreatureLib_DamageLibrary_Construct() { return new DamageLibrary(); }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/EventHooks/EventData.hpp"
|
#include "../../src/Battling/EventHooks/EventData.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export void CreatureLib_EventData_Destruct(const EventData* p) { delete p; }
|
export void CreatureLib_EventData_Destruct(const EventData* p) { delete p; }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/ExecutingAttack.hpp"
|
#include "../../src/Battling/Models/ExecutingAttack.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export uint8_t CreatureLib_ExecutingAttack_Construct(ExecutingAttack*& out, Creature* const* targets,
|
export uint8_t CreatureLib_ExecutingAttack_Construct(ExecutingAttack*& out, Creature* const* targets,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Library/ExperienceLibrary.hpp"
|
#include "../../src/Battling/Library/ExperienceLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export const ExperienceLibrary* CreatureLib_ExperienceLibrary_Construct() { return new ExperienceLibrary(); }
|
export const ExperienceLibrary* CreatureLib_ExperienceLibrary_Construct() { return new ExperienceLibrary(); }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Models/LearnedAttack.hpp"
|
#include "../../src/Battling/Models/LearnedAttack.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export uint8_t CreatureLib_LearnedAttack_Construct(LearnedAttack*& out, const CreatureLib::Library::AttackData* attack,
|
export uint8_t CreatureLib_LearnedAttack_Construct(LearnedAttack*& out, const CreatureLib::Library::AttackData* attack,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/Library/MiscLibrary.hpp"
|
#include "../../src/Battling/Library/MiscLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export MiscLibrary* CreatureLib_MiscLibrary_Construct() { return new MiscLibrary(); }
|
export MiscLibrary* CreatureLib_MiscLibrary_Construct() { return new MiscLibrary(); }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/ScriptHandling/Script.hpp"
|
#include "../../src/Battling/ScriptHandling/Script.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export void CreatureLib_Script_Destruct(Script* p) { delete p; }
|
export void CreatureLib_Script_Destruct(Script* p) { delete p; }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Battling/ScriptHandling/ScriptResolver.hpp"
|
#include "../../src/Battling/ScriptHandling/ScriptResolver.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export ScriptResolver* CreatureLib_ScriptResolver_Construct() { return new ScriptResolver(); }
|
export ScriptResolver* CreatureLib_ScriptResolver_Construct() { return new ScriptResolver(); }
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "../../src/Battling/TurnChoices/FleeTurnChoice.hpp"
|
#include "../../src/Battling/TurnChoices/FleeTurnChoice.hpp"
|
||||||
#include "../../src/Battling/TurnChoices/PassTurnChoice.hpp"
|
#include "../../src/Battling/TurnChoices/PassTurnChoice.hpp"
|
||||||
#include "../../src/Battling/TurnChoices/SwitchTurnChoice.hpp"
|
#include "../../src/Battling/TurnChoices/SwitchTurnChoice.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Battling;
|
using namespace CreatureLib::Battling;
|
||||||
|
|
||||||
export AttackTurnChoice* CreatureLib_AttackTurnChoice_Construct(Creature* user, LearnedAttack* attack,
|
export AttackTurnChoice* CreatureLib_AttackTurnChoice_Construct(Creature* user, LearnedAttack* attack,
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#define export extern "C" [[maybe_unused]]
|
#define export extern "C" [[maybe_unused]]
|
||||||
|
|
||||||
#define CreatureLibLibraryException 2;
|
#define CreatureLibException 2;
|
||||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||||
|
|
||||||
class ExceptionHandler {
|
class ExceptionHandler {
|
||||||
|
@ -28,7 +28,7 @@ public:
|
||||||
return 0; \
|
return 0; \
|
||||||
} catch (const std::exception& e) { \
|
} catch (const std::exception& e) { \
|
||||||
ExceptionHandler::SetLastException(__FUNCTION__, e); \
|
ExceptionHandler::SetLastException(__FUNCTION__, e); \
|
||||||
return CreatureLibLibraryException; \
|
return CreatureLibException; \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SIMPLE_GET_FUNC(type, name, returnType) \
|
#define SIMPLE_GET_FUNC(type, name, returnType) \
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/Attacks/AttackData.hpp"
|
#include "../../src/Library/Attacks/AttackData.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export uint8_t CreatureLib_AttackData_Construct(AttackData*& out, const char* name, uint8_t type,
|
export uint8_t CreatureLib_AttackData_Construct(AttackData*& out, const char* name, uint8_t type,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "../../src/Library/AttackLibrary.hpp"
|
#include "../../src/Library/AttackLibrary.hpp"
|
||||||
|
#include "../Core.hpp"
|
||||||
#include "BaseLibrary.cpp"
|
#include "BaseLibrary.cpp"
|
||||||
#include "Core.hpp"
|
|
||||||
|
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
|
|
||||||
#define BASELIBRARY(simpleName, fullname, returnType) \
|
#define BASELIBRARY(simpleName, fullname, returnType) \
|
||||||
export uint8_t simpleName##_Insert(fullname* p, const char* name, returnType* t) { \
|
export uint8_t simpleName##_Insert(fullname* p, const char* name, returnType* t) { \
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#include "Core.hpp"
|
|
||||||
|
|
||||||
std::string ExceptionHandler::_creatureLibLastException = "";
|
|
||||||
|
|
||||||
export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/CreatureData/CreatureSpecies.hpp"
|
#include "../../src/Library/CreatureData/CreatureSpecies.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export uint8_t CreatureLib_CreatureSpecies_Construct(CreatureSpecies*& out, uint16_t id, const char* name,
|
export uint8_t CreatureLib_CreatureSpecies_Construct(CreatureSpecies*& out, uint16_t id, const char* name,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/DataLibrary.hpp"
|
#include "../../src/Library/DataLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export uint8_t CreatureLib_DataLibrary_Construct(const DataLibrary*& out, LibrarySettings* settings,
|
export uint8_t CreatureLib_DataLibrary_Construct(const DataLibrary*& out, LibrarySettings* settings,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/EffectParameter.hpp"
|
#include "../../src/Library/EffectParameter.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export EffectParameter* CreatureLib_EffectParameter_FromBool(bool b) { return new EffectParameter(b); }
|
export EffectParameter* CreatureLib_EffectParameter_FromBool(bool b) { return new EffectParameter(b); }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "../../src/Library/GrowthRates/GrowthRate.hpp"
|
#include "../../src/Library/GrowthRates/GrowthRate.hpp"
|
||||||
#include "../../src/Library/GrowthRates/ExternGrowthRate.hpp"
|
#include "../../src/Library/GrowthRates/ExternGrowthRate.hpp"
|
||||||
#include "../../src/Library/GrowthRates/LookupGrowthRate.hpp"
|
#include "../../src/Library/GrowthRates/LookupGrowthRate.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export GrowthRate* CreatureLib_LookupGrowthRate_Construct(uint32_t experiencePerLevel[], size_t count) {
|
export GrowthRate* CreatureLib_LookupGrowthRate_Construct(uint32_t experiencePerLevel[], size_t count) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/GrowthRates/GrowthRateLibrary.hpp"
|
#include "../../src/Library/GrowthRates/GrowthRateLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export GrowthRateLibrary* CreatureLib_GrowthRateLibrary_Construct(size_t initialCapacity) {
|
export GrowthRateLibrary* CreatureLib_GrowthRateLibrary_Construct(size_t initialCapacity) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/Items/Item.hpp"
|
#include "../../src/Library/Items/Item.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export Item* CreatureLib_Item_Construct(const char* name, ItemCategory category, BattleItemCategory battleCategory,
|
export Item* CreatureLib_Item_Construct(const char* name, ItemCategory category, BattleItemCategory battleCategory,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "../../src/Library/ItemLibrary.hpp"
|
#include "../../src/Library/ItemLibrary.hpp"
|
||||||
|
#include "../Core.hpp"
|
||||||
#include "BaseLibrary.cpp"
|
#include "BaseLibrary.cpp"
|
||||||
#include "Core.hpp"
|
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export const ItemLibrary* CreatureLib_ItemLibrary_Construct(size_t initialCapacity = 32) {
|
export const ItemLibrary* CreatureLib_ItemLibrary_Construct(size_t initialCapacity = 32) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/CreatureData/LearnableAttacks.hpp"
|
#include "../../src/Library/CreatureData/LearnableAttacks.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export uint8_t CreatureLib_LearnableAttacks_Construct(LearnableAttacks*& out, size_t levelAttackCapacity) {
|
export uint8_t CreatureLib_LearnableAttacks_Construct(LearnableAttacks*& out, size_t levelAttackCapacity) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/LibrarySettings.hpp"
|
#include "../../src/Library/LibrarySettings.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export const LibrarySettings* CreatureLib_LibrarySettings_Construct(uint8_t maximalLevel, uint8_t maximalMoves) {
|
export const LibrarySettings* CreatureLib_LibrarySettings_Construct(uint8_t maximalLevel, uint8_t maximalMoves) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "../../src/Library/SpeciesLibrary.hpp"
|
#include "../../src/Library/SpeciesLibrary.hpp"
|
||||||
|
#include "../Core.hpp"
|
||||||
#include "BaseLibrary.cpp"
|
#include "BaseLibrary.cpp"
|
||||||
#include "Core.hpp"
|
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export const SpeciesLibrary* CreatureLib_SpeciesLibrary_Construct(size_t initialCapacity = 32) {
|
export const SpeciesLibrary* CreatureLib_SpeciesLibrary_Construct(size_t initialCapacity = 32) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/CreatureData/SpeciesVariant.hpp"
|
#include "../../src/Library/CreatureData/SpeciesVariant.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
|
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include "../../src/Library/TypeLibrary.hpp"
|
#include "../../src/Library/TypeLibrary.hpp"
|
||||||
#include "Core.hpp"
|
#include "../Core.hpp"
|
||||||
using namespace CreatureLib::Library;
|
using namespace CreatureLib::Library;
|
||||||
|
|
||||||
export TypeLibrary* CreatureLib_TypeLibrary_Construct(size_t initialCapacity) {
|
export TypeLibrary* CreatureLib_TypeLibrary_Construct(size_t initialCapacity) {
|
||||||
|
|
|
@ -20,13 +20,9 @@ if (SHARED)
|
||||||
set(LIBTYPE SHARED)
|
set(LIBTYPE SHARED)
|
||||||
endif (SHARED)
|
endif (SHARED)
|
||||||
|
|
||||||
# Create main Library library with files in src/Library
|
file(GLOB_RECURSE LIBRARY_SRC_FILES
|
||||||
file(GLOB_RECURSE LIBRARY_SRC_FILES "src/Library/*.cpp" "src/Library/*.hpp" "CInterface/Library/*.cpp" "CInterface/Library/*.hpp")
|
"src/*.cpp" "src/*.hpp" "CInterface/*.cpp" "CInterface/*.hpp")
|
||||||
add_library(CreatureLibLibrary SHARED ${LIBRARY_SRC_FILES})
|
add_library(CreatureLib SHARED ${LIBRARY_SRC_FILES})
|
||||||
|
|
||||||
# Create Battling library with files in src/Battling
|
|
||||||
file(GLOB_RECURSE BATTLING_SRC_FILES "src/Battling/*.cpp" "src/Battling/*.hpp" "CInterface/Battling/*.cpp" "CInterface/Battling/*.hpp")
|
|
||||||
add_library(CreatureLibBattling SHARED ${BATTLING_SRC_FILES})
|
|
||||||
|
|
||||||
# If we are building for Windows we need to set some specific variables.
|
# If we are building for Windows we need to set some specific variables.
|
||||||
if (WINDOWS)
|
if (WINDOWS)
|
||||||
|
@ -40,25 +36,21 @@ endif (WINDOWS)
|
||||||
|
|
||||||
# Set up links to all relevant libraries.
|
# Set up links to all relevant libraries.
|
||||||
SET(_LIBRARYLINKS Arbutils)
|
SET(_LIBRARYLINKS Arbutils)
|
||||||
SET(_BATTLINGLINKS CreatureLibLibrary Arbutils)
|
|
||||||
|
|
||||||
# If we need to link the C libraries statically, do so.
|
# If we need to link the C libraries statically, do so.
|
||||||
if (STATICC)
|
if (STATICC)
|
||||||
message(STATUS "Linking C statically.")
|
message(STATUS "Linking C statically.")
|
||||||
SET(_LIBRARYLINKS ${_LIBRARYLINKS} -static-libgcc -static-libstdc++)
|
SET(_LIBRARYLINKS ${_LIBRARYLINKS} -static-libgcc -static-libstdc++)
|
||||||
SET(_BATTLINGLINKS ${_BATTLINGLINKS} -static-libgcc -static-libstdc++)
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# And link the libraries together
|
# And link the libraries together
|
||||||
target_link_libraries(CreatureLibLibrary PUBLIC ${_LIBRARYLINKS})
|
target_link_libraries(CreatureLib PUBLIC ${_LIBRARYLINKS})
|
||||||
target_link_libraries(CreatureLibBattling PUBLIC ${_BATTLINGLINKS})
|
|
||||||
target_compile_definitions(CreatureLibBattling PRIVATE BATTLING)
|
|
||||||
|
|
||||||
if (TESTS)
|
if (TESTS)
|
||||||
# Create Test executable
|
# Create Test executable
|
||||||
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
||||||
add_executable(CreatureLibTests ${TEST_FILES} extern/catch.hpp)
|
add_executable(CreatureLibTests ${TEST_FILES} extern/catch.hpp)
|
||||||
target_link_libraries(CreatureLibTests PUBLIC CreatureLibLibrary CreatureLibBattling Arbutils)
|
target_link_libraries(CreatureLibTests PUBLIC CreatureLib Arbutils)
|
||||||
|
|
||||||
# Add a definition for the test library
|
# Add a definition for the test library
|
||||||
target_compile_definitions(CreatureLibTests PRIVATE TESTS_BUILD)
|
target_compile_definitions(CreatureLibTests PRIVATE TESTS_BUILD)
|
||||||
|
|
Loading…
Reference in New Issue