1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-06-19 22:57:37 +02:00
Files
Ivan Savenko 9b9a770327 Remove dynamic loading of AI and scripting modules
Now instead of having AI and scripting as separate .dll/.so that is
dynamically loaded on requests, these components are part of VCMI
library directly. This removes need of custom code for Android/iOS where
dynamic loading is blocked as well removes multiple issues on desktop
platforms

Changes:
- Added libFacade module that actually generates libvcmi.so and has all
librrary components as its dependencies to resolve circular dependencies
- All library components are now OBJECT libraries (and not dynamic or
static libraries). Reasoning: STATIC libraries don't work due to way
linker walks through compiled units, and DYNAMIC would work, but would
keep overhead from inability to inline functions from library.
- Removed no longer necessary RPATH handling since here are no more AI
and scripting libraries to load
- Replaced CDynLibHandler with scaled down AIFactory class
2026-06-12 17:46:39 +03:00

27 lines
690 B
C++

/*
* AIFactory.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
VCMI_LIB_NAMESPACE_BEGIN
class CGlobalAI;
class CBattleGameInterface;
namespace AIFactory
{
DLL_LINKAGE std::shared_ptr<CGlobalAI> createAdventureAI(const std::string & name);
DLL_LINKAGE std::shared_ptr<CBattleGameInterface> createBattleAI(const std::string & name);
/// Returns true if the given name maps to a known statically-linked adventure AI.
DLL_LINKAGE bool isAvailableAdventureAI(const std::string & name);
}
VCMI_LIB_NAMESPACE_END