1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

fix building vcmiLua for iOS

This commit is contained in:
Andrey Filipenkov 2022-08-15 14:38:17 +03:00
parent 7b411a5fc4
commit a851e630d5
75 changed files with 279 additions and 8 deletions

View File

@ -83,12 +83,16 @@ set(lib_HDRS
)
add_library(vcmiLua SHARED ${lib_SRCS} ${lib_HDRS})
target_link_libraries(vcmiLua Boost::boost luajit::luajit vcmi)
target_link_libraries(vcmiLua Boost::boost luajit::luajit ${VCMI_LIB_TARGET})
vcmi_set_output_dir(vcmiLua "scripting")
enable_pch(vcmiLua)
install(TARGETS vcmiLua LIBRARY DESTINATION ${SCRIPTING_LIB_DIR} OPTIONAL)
if(APPLE_IOS)
install(TARGETS vcmiLua LIBRARY DESTINATION ${SCRIPTING_LIB_DIR})
else()
install(TARGETS vcmiLua DESTINATION ${SCRIPTING_LIB_DIR})
endif()
#manually copy lua dll from vcpkg folder to build directory on windows since vcpkg deps copy feature has flaws, using hardcoded paths based on vcmi windows deps package 1.1 from github
if(MSVC)

View File

@ -13,6 +13,8 @@
#include "api/Registry.h"
#include "LuaStack.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -329,3 +331,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -21,3 +23,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -11,6 +11,8 @@
#include "LuaReference.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -42,3 +44,5 @@ void LuaReference::push()
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,6 +10,8 @@
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -31,3 +33,4 @@ private:
}
VCMI_LIB_NAMESPACE_END

View File

@ -19,6 +19,8 @@
const char *g_cszAiName = "Lua interpreter";
VCMI_LIB_NAMESPACE_BEGIN
extern "C" DLL_EXPORT void GetAiName(char * name)
{
strcpy_s(name, strlen(g_cszAiName) + 1, g_cszAiName);
@ -54,3 +56,5 @@ void LuaScriptModule::registerSpellEffect(spells::effects::Registry * registry,
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "../../lib/CScriptingModule.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -31,3 +33,5 @@ private:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -26,6 +26,8 @@
#include "../../lib/CGameInfoCallback.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -605,3 +607,5 @@ int LuaContext::logErrorImpl()
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../../lib/ScriptHandler.h"
#include "../../lib/CScriptingModule.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -88,3 +90,5 @@ private:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -24,6 +24,8 @@ static const std::string APPLICABLE_GENERAL = "applicable";
static const std::string APPLICABLE_TARGET = "applicableTarget";
static const std::string APPLY = "apply";
VCMI_LIB_NAMESPACE_BEGIN
namespace spells
{
namespace effects
@ -184,3 +186,5 @@ void LuaSpellEffect::setContextVariables(const Mechanics * m, std::shared_ptr<Co
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "../../lib/spells/effects/Effect.h"
#include "../../lib/spells/effects/Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
class Script;
@ -24,8 +26,8 @@ namespace spells
namespace effects
{
using ::scripting::Script;
using ::scripting::Context;
using scripting::Script;
using scripting::Context;
class LuaSpellEffectFactory : public IEffectFactory
{
@ -71,3 +73,5 @@ private:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../../lib/JsonNode.h"
#include "../../lib/int3.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -251,3 +253,5 @@ int LuaStack::retVoid()
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "api/Registry.h"
#include "../../lib/GameConstants.h"
VCMI_LIB_NAMESPACE_BEGIN
class JsonNode;
class int3;
@ -362,3 +364,5 @@ private:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -20,6 +20,8 @@
*
*/
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
@ -231,3 +233,5 @@ public:
};
}
VCMI_LIB_NAMESPACE_END

View File

@ -1,2 +1,2 @@
// Creates the precompiled header
#include "StdInc.h"
#include "StdInc.h"

View File

@ -8,3 +8,4 @@
// Here you can add specific libraries and macros which are specific to this project.
VCMI_LIB_USING_NAMESPACE

View File

@ -17,6 +17,8 @@
#include "../LuaCallWrapper.h"
#include "../../../lib/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -44,3 +46,5 @@ const std::vector<ArtifactProxy::CustomRegType> ArtifactProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -29,3 +31,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -19,6 +19,8 @@
#include "../../../lib/battle/Unit.h"
#include "../../../lib/BattleFieldHandler.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -114,3 +116,5 @@ int BattleCbProxy::getUnitByPos(lua_State * L)
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -34,3 +36,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -18,6 +18,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -253,3 +255,5 @@ int BonusBearerProxy::getBonuses(lua_State * L)
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
struct Bonus;
class BonusList;
class IBonusBearer;
@ -70,3 +72,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -17,6 +17,8 @@
#include "../LuaCallWrapper.h"
#include "../../../lib/HeroBonus.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -60,3 +62,5 @@ const std::vector<CreatureProxy::CustomRegType> CreatureProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -30,3 +32,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -34,3 +36,5 @@ const std::vector<FactionProxy::CustomRegType> FactionProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -28,3 +30,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -17,6 +17,8 @@
#include "../../../lib/mapObjects/CGHeroInstance.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -39,3 +41,5 @@ const std::vector<GameCbProxy::CustomRegType> GameCbProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -31,3 +33,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -32,3 +34,5 @@ const std::vector<HeroClassProxy::CustomRegType> HeroClassProxy::REGISTER_CUSTOM
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -29,3 +31,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -31,3 +33,4 @@ const std::vector<HeroInstanceProxy::CustomRegType> HeroInstanceProxy::REGISTER_
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../../../lib/mapObjects/CGHeroInstance.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -32,3 +34,4 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -34,3 +36,5 @@ const std::vector<HeroTypeProxy::CustomRegType> HeroTypeProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -29,3 +31,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -34,3 +34,5 @@ const std::vector<ObjectInstanceProxy::CustomRegType> ObjectInstanceProxy::REGIS
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -32,3 +32,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -36,3 +36,5 @@ const std::vector<PlayerProxy::CustomRegType> PlayerProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -29,3 +29,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -11,6 +11,8 @@
#include "api/Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -86,3 +88,5 @@ const char * TypeRegistry::getKeyForType(const std::type_info & type)
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -27,6 +27,8 @@ RegisterCoreAPI<Type> _register ## Type (Name);\
}\
\
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -108,3 +110,5 @@ private:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,9 @@
#include "../LuaStack.h"
#include "../../../lib/NetPacks.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -100,3 +103,5 @@ int ServerCbProxy::apply(lua_State * L)
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -33,3 +35,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -26,6 +26,8 @@
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -95,3 +97,5 @@ const std::vector<SpellServiceProxy::CustomRegType> SpellServiceProxy::REGISTER_
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -22,6 +22,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -87,3 +89,5 @@ public:
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -32,3 +34,5 @@ const std::vector<SkillProxy::CustomRegType> SkillProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -29,3 +31,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../LuaStack.h"
#include "../LuaCallWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -51,3 +53,5 @@ const std::vector<SpellProxy::CustomRegType> SpellProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -28,3 +30,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -17,6 +17,8 @@
#include "../LuaCallWrapper.h"
#include <vcmi/Creature.h>
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -33,3 +35,4 @@ const std::vector<StackInstanceProxy::CustomRegType> StackInstanceProxy::REGISTE
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../../../lib/CCreatureSet.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -32,3 +34,4 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../../LuaCallWrapper.h"
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -38,3 +40,5 @@ const std::vector<UnitProxy::CustomRegType> UnitProxy::REGISTER_CUSTOM =
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -34,3 +36,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -38,3 +38,5 @@ const std::vector<ObjectVisitStartedProxy::CustomRegType> ObjectVisitStartedProx
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -38,3 +38,5 @@ public:
}
VCMI_LIB_NAMESPACE_END

View File

@ -17,6 +17,8 @@
#include "../../../../lib/battle/Unit.h"
#include "SubscriptionRegistryProxy.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -66,3 +68,5 @@ const std::vector<ApplyDamageProxy::CustomRegType> ApplyDamageProxy::REGISTER_CU
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "EventBusProxy.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -34,4 +36,4 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -30,3 +32,4 @@ const std::vector<EventBusProxy::CustomRegType> EventBusProxy::REGISTER_CUSTOM =
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../../LuaWrapper.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -31,3 +33,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "../Registry.h"
#include "SubscriptionRegistryProxy.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -86,3 +88,5 @@ const std::vector<TurnStartedProxy::CustomRegType> TurnStartedProxy::REGISTER_CU
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -16,6 +16,8 @@
#include "EventBusProxy.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -48,4 +50,4 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -13,6 +13,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -25,3 +27,5 @@ const std::vector<EventSubscriptionProxy::CustomRegType> EventSubscriptionProxy:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -18,6 +18,8 @@
#include "../../LuaStack.h"
#include "../../LuaReference.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -128,3 +130,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -56,3 +58,5 @@ int BattleLogMessageProxy::addText(lua_State * L)
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "PackForClient.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -32,3 +34,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -82,3 +84,5 @@ int BattleStackMovedProxy::setTeleporting(lua_State * L)
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "PackForClient.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -35,3 +37,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -112,3 +114,5 @@ int BattleUnitsChangedProxy::remove(lua_State * L)
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "PackForClient.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -35,3 +37,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -61,3 +63,5 @@ int EntitiesChangedProxy::update(lua_State * L)
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -10,9 +10,10 @@
#pragma once
#include "PackForClient.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -33,3 +34,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
using scripting::api::netpacks::InfoWindowProxy;
using scripting::api::RegisterAPI;
@ -126,3 +128,5 @@ int InfoWindowProxy::setPlayer(lua_State * L)
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "PackForClient.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -33,3 +35,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -14,6 +14,8 @@
#include "../../../../lib/NetPacks.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -43,3 +45,5 @@ public:
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -15,6 +15,8 @@
#include "../Registry.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -157,3 +159,5 @@ int SetResourcesProxy::clear(lua_State * L)
}
}
}
VCMI_LIB_NAMESPACE_END

View File

@ -12,6 +12,8 @@
#include "PackForClient.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace scripting
{
namespace api
@ -38,3 +40,5 @@ public:
}
}
}
VCMI_LIB_NAMESPACE_END