Feature #1853 ยป 0050-Meson-Add-support-for-dynamically-loadable-AI-module.patch
| INSTALL | ||
|---|---|---|
|
* stub
|
||
|
Default is to build classic and tex.
|
||
|
dynaimod (boolean):
|
||
|
Whether to build im support for dynamic loading of AI modules.
|
||
|
Default is not to build the support.
|
||
|
appimage (boolean):
|
||
|
Make build suitable for AppImage packaging. This affects paths from
|
||
|
which various resources are looked from, and produces build that
|
||
| gen_headers/meson_fc_config.h.in | ||
|---|---|---|
|
#mesondefine AI_MOD_STATIC_TEX
|
||
|
#mesondefine AI_MOD_STATIC_STUB
|
||
|
/* Enable AI modules */
|
||
|
#mesondefine AI_MODULES
|
||
|
/* Directory to search AI modules from */
|
||
|
#mesondefine AI_MODULEDIR
|
||
|
#mesondefine DEFAULT_SOCK_PORT
|
||
|
#define INIT_BRACE_BEGIN {
|
||
| meson.build | ||
|---|---|---|
|
priv_conf_data.set('LOCALEDIR', join_paths(localeprefix, get_option('localedir')))
|
||
|
endif
|
||
|
if meson.is_cross_build()
|
||
|
cross_inc_str = meson.get_external_property('cross_inc_path', '')
|
||
|
cross_inc_path = [cross_inc_str]
|
||
|
cross_lib_path = [meson.get_external_property('cross_lib_path', '')]
|
||
|
crosser = meson.get_external_property('crosser', false)
|
||
|
# emscripten build is always cross-build, so check it only here
|
||
|
if c_compiler.compiles(
|
||
|
'''#ifndef __EMSCRIPTEN__
|
||
|
error fail
|
||
|
#endif''',
|
||
|
name: 'emscripten')
|
||
|
emscripten = true
|
||
|
else
|
||
|
emscripten = false
|
||
|
endif
|
||
|
else
|
||
|
cross_inc_str = ''
|
||
|
cross_inc_path = []
|
||
|
cross_lib_path = []
|
||
|
crosser = false
|
||
|
emscripten = false
|
||
|
endif
|
||
|
server_type = get_option('server')
|
||
|
if server_type == 'freeciv-web'
|
||
| ... | ... | |
|
aimodcount = 0
|
||
|
aisrc = []
|
||
|
if get_option('dynaimod')
|
||
|
priv_conf_data.set('AI_MODULES', 1)
|
||
|
priv_conf_data.set('AI_MODULEDIR',
|
||
|
'"' + join_paths(get_option('libdir'), 'fcai') + '"')
|
||
|
dynai_dep = c_compiler.find_library('ltdl', dirs: cross_lib_path)
|
||
|
else
|
||
|
dynai_dep = []
|
||
|
endif
|
||
|
if get_option('aimodules').contains('classic')
|
||
|
priv_conf_data.set('AI_MOD_STATIC_CLASSIC', 1)
|
||
|
priv_conf_data.set('AI_MOD_DEFAULT', '"classic"')
|
||
| ... | ... | |
|
pub_conf_data.set('FREECIV_AI_MOD_LAST', aimodcount)
|
||
|
endif
|
||
|
if meson.is_cross_build()
|
||
|
cross_inc_str = meson.get_external_property('cross_inc_path', '')
|
||
|
cross_inc_path = [cross_inc_str]
|
||
|
cross_lib_path = [meson.get_external_property('cross_lib_path', '')]
|
||
|
crosser = meson.get_external_property('crosser', false)
|
||
|
# emscripten build is always cross-build, so check it only here
|
||
|
if c_compiler.compiles(
|
||
|
'''#ifndef __EMSCRIPTEN__
|
||
|
error fail
|
||
|
#endif''',
|
||
|
name: 'emscripten')
|
||
|
emscripten = true
|
||
|
else
|
||
|
emscripten = false
|
||
|
endif
|
||
|
else
|
||
|
cross_inc_str = ''
|
||
|
cross_inc_path = []
|
||
|
cross_lib_path = []
|
||
|
crosser = false
|
||
|
emscripten = false
|
||
|
endif
|
||
|
if get_option('appimage')
|
||
|
pub_conf_data.set('FREECIV_APPIMAGE', 1)
|
||
|
endif
|
||
| ... | ... | |
|
sources: [ verhdr, pack_server,
|
||
|
tolua.process('server/scripting/tolua_fcdb.pkg',
|
||
|
'server/scripting/tolua_server.pkg')],
|
||
|
dependencies: lua_dep
|
||
|
dependencies: [ lua_dep, dynai_dep ]
|
||
|
)
|
||
|
endif
|
||
| meson_options.txt | ||
|---|---|---|
|
value: ['classic', 'tex'],
|
||
|
description: 'AI modules to include to the server')
|
||
|
option('dynaimod',
|
||
|
type: 'boolean',
|
||
|
value: false,
|
||
|
description: 'Support dynamically loadable AI modules')
|
||
|
option('appimage',
|
||
|
type: 'boolean',
|
||
|
value: false,
|
||