Add use_network_ana option to scons.

This commit is contained in:
Sergey Popov 2010-06-22 00:05:01 +00:00
parent d3f121c4e6
commit 5514c4e952
3 changed files with 26 additions and 2 deletions

View file

@ -82,6 +82,7 @@ opts.AddVariables(
('version_suffix', 'suffix that will be added to default values of prefsdir, program_suffix and datadirname', ""),
BoolVariable('raw_sockets', 'Set to use raw receiving sockets in the multiplayer network layer rather than the SDL_net facilities', False),
BoolVariable('forum_user_handler', 'Enable forum user handler in wesnothd', False),
BoolVariable('use_network_ana', 'Use the new network api', False),
BoolVariable('pool_alloc', 'Enable custom pool malloc', False),
('server_gid', 'group id of the user who runs wesnothd', ""),
('server_uid', 'user id of the user who runs wesnothd', ""),
@ -291,6 +292,11 @@ if env["prereqs"]:
conf.CheckBoost("smart_ptr", header_only = True) and \
conf.CheckSDL(require_version = '1.2.7') and \
conf.CheckSDL('SDL_net') or Warning("Base prerequisites are not met.")
if have_server_prereqs and env["use_network_ana"]:
have_server_prereqs = \
conf.CheckBoost("system") and \
conf.CheckBoost("thread") and \
conf.CheckBoost("asio", header_only = True) or Warning("Base prerequisites are not met.")
env = conf.Finish()
client_env = env.Clone()

View file

@ -22,7 +22,6 @@ libwesnoth_core_sources = Split("""
map.cpp
map_location.cpp
md5.cpp
network.cpp
thread.cpp
tstring.cpp
util.cpp
@ -42,6 +41,14 @@ if env["pool_alloc"]:
libwesnoth_core_sources.extend(env.Object("network_worker.cpp", EXTRA_DEFINE = env['raw_sockets'] and "NETWORK_USE_RAW_SOCKETS" or None))
if env["use_network_ana"]:
client_env.Append(CPPPATH = ["#/src/ana/api"])
libwesnoth_core_sources.append("network_ana.cpp")
ana = SConscript("ana/src/SConscript", exports = {"env" : client_env})
else:
libwesnoth_core_sources.append("network.cpp")
ana = []
game_config_env = env.Clone()
filesystem_env = env.Clone()
if env["PLATFORM"] != "win32":
@ -58,7 +65,7 @@ libwesnoth_core_sources.extend([
filesystem_env.Object("filesystem.cpp")
])
libwesnoth_core = env.Library("wesnoth_core", libwesnoth_core_sources)
libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources), ana]
libwesnoth_sources = Split("""
arrow.cpp

11
src/ana/src/SConscript Normal file
View file

@ -0,0 +1,11 @@
# vi: syntax=python:et:ts=4
Import("env")
ana = env.Library("ana", Split("""
asio_listener.cpp
asio_server.cpp
asio_client.cpp
asio_proxy_connection.cpp
"""))
Return("ana")