wesnoth/src/SConscript
Ignacio R. Morelle 9e0e161f5a https://mail.gna.org/public/wesnoth-dev/2008-06/msg00002.html
- Make it possible to identify the type of add-ons if the authors supply
  it in .pbl files.

- Add a private information field, 'email', to .pbl files.

- Display add-on types in the add-ons download dialog.

- Update scons, cmake and autotools source code listings.

- The trunk campaign server must be recompiled.
2008-06-08 22:16:51 +00:00

317 lines
7.6 KiB
Python

# vi: syntax=python:et:ts=4
import commands, os
from subprocess import Popen, PIPE
from glob import glob
Import("*")
#color_range.cpp should be removed, but game_config depends on it.
#game_config has very few things that are needed elsewhere, it should be
#removed. Requires moving path and version at least to other files.
libwesnoth_core_sources = Split("""
color_range.cpp
config.cpp
filesystem.cpp
game_config.cpp
gettext.cpp
log.cpp
map.cpp
network.cpp
network_worker.cpp
thread.cpp
tstring.cpp
util.cpp
serialization/binary_or_text.cpp
serialization/binary_wml.cpp
serialization/parser.cpp
serialization/preprocessor.cpp
serialization/string_utils.cpp
serialization/tokenizer.cpp
""")
libwesnoth_core = env.Library("wesnoth_core", libwesnoth_core_sources)
libwesnoth_sources = Split("""
astarnode.cpp
astarsearch.cpp
builder.cpp
cavegen.cpp
clipboard.cpp
construct_dialog.cpp
cursor.cpp
display.cpp
events.cpp
filechooser.cpp
font.cpp
generic_event.cpp
hotkeys.cpp
image.cpp
key.cpp
language.cpp
loadscreen.cpp
map_create.cpp
map_label.cpp
mapgen.cpp
mapgen_dialog.cpp
marked-up_text.cpp
minimap.cpp
pathutils.cpp
preferences.cpp
preferences_display.cpp
race.cpp
random.cpp
reports.cpp
show_dialog.cpp
sound.cpp
soundsource.cpp
terrain.cpp
terrain_translation.cpp
tooltips.cpp
video.cpp
theme.cpp
widgets/button.cpp
widgets/file_menu.cpp
widgets/label.cpp
widgets/menu.cpp
widgets/menu_style.cpp
widgets/progressbar.cpp
widgets/scrollarea.cpp
widgets/scrollbar.cpp
widgets/slider.cpp
widgets/textbox.cpp
widgets/widget.cpp
wml_exception.cpp
gui/dialogs/language_selection.cpp
gui/dialogs/mp_method_selection.cpp
gui/dialogs/addon_connect.cpp
gui/widgets/button.cpp
gui/widgets/canvas.cpp
gui/widgets/control.cpp
gui/widgets/container.cpp
gui/widgets/event_handler.cpp
gui/widgets/grid.cpp
gui/widgets/helper.cpp
gui/widgets/label.cpp
gui/widgets/listbox.cpp
gui/widgets/panel.cpp
gui/widgets/settings.cpp
gui/widgets/scrollbar.cpp
gui/widgets/spacer.cpp
gui/widgets/text.cpp
gui/widgets/text_box.cpp
gui/widgets/toggle_button.cpp
gui/widgets/tooltip.cpp
gui/widgets/vertical_scrollbar.cpp
gui/widgets/widget.cpp
gui/widgets/window.cpp
gui/widgets/window_builder.cpp
""")
libwesnoth = env.Library("wesnoth", libwesnoth_sources)
libwesnothd_sources = Split("""
loadscreen_empty.cpp
tools/dummy_video.cpp
""")
libwesnothd = env.Library("wesnothd", libwesnothd_sources)
libcampaignd_sources = Split("""
addon_checks.cpp
""")
libcampaignd = env.Library("campaignd", libcampaignd_sources)
libwesnoth_sdl_sources = Split("""
sdl_utils.cpp
""")
libwesnoth_sdl = env.Library("wesnoth_sdl", libwesnoth_sdl_sources)
libcutter_sources = Split("""
tools/exploder_utils.cpp
tools/exploder_cutter.cpp
""")
libcutter = env.Library("cutter", libcutter_sources)
# Used by both 'wesnoth' and 'test' targets
wesnoth_sources = Split("""
about.cpp
actions.cpp
addon_checks.cpp
addon_management.cpp
ai.cpp
ai_dfool.cpp
ai_attack.cpp
ai_move.cpp
ai_python.cpp
ai_village.cpp
animated_game.cpp
attack_prediction.cpp
callable_objects.cpp
config_adapter.cpp
dialogs.cpp
floating_textbox.cpp
formula.cpp
formula_ai.cpp
formula_function.cpp
formula_tokenizer.cpp
game_display.cpp
game_events.cpp
game_preferences.cpp
game_preferences_display.cpp
gamestatus.cpp
generate_report.cpp
halo.cpp
help.cpp
intro.cpp
leader_list.cpp
menu_events.cpp
mouse_events.cpp
multiplayer.cpp
multiplayer_ui.cpp
multiplayer_wait.cpp
multiplayer_connect.cpp
multiplayer_create.cpp
multiplayer_lobby.cpp
pathfind.cpp
playcampaign.cpp
play_controller.cpp
playmp_controller.cpp
playsingle_controller.cpp
playturn.cpp
replay.cpp
replay_controller.cpp
sha1.cpp
settings.cpp
statistics.cpp
team.cpp
terrain_filter.cpp
titlescreen.cpp
unit.cpp
unit_abilities.cpp
unit_animation.cpp
unit_display.cpp
unit_frame.cpp
unit_map.cpp
unit_types.cpp
upload_log.cpp
variable.cpp
variant.cpp
widgets/combo.cpp
widgets/scrollpane.cpp
""")
# used with editor2 option in the wesnoth target
wesnoth_editor2_sources = Split("""
editor2/editor_main.cpp
editor/editor.cpp
editor/editor_layout.cpp
editor/map_manip.cpp
editor/editor_display.cpp
editor/editor_palettes.cpp
editor/editor_dialogs.cpp
editor/editor_undo.cpp
""")
if env['editor2']:
wesnoth_sources += wesnoth_editor2_sources
#
# Target declarations
#
if have_client_prereqs:
wesnoth = env.Program("wesnoth", ["game.cpp"] + wesnoth_sources + [libwesnoth_core, libwesnoth_sdl, libwesnoth, libcampaignd] + wesnoth_res)
else:
wesnoth = None
Export("wesnoth")
wesnoth_editor_sources = Split("""
editor/editor.cpp
editor/editor_layout.cpp
editor/map_manip.cpp
editor/editor_display.cpp
editor/editor_palettes.cpp
editor/editor_main.cpp
editor/editor_dialogs.cpp
editor/editor_undo.cpp
animated_editor.cpp
""")
if have_client_prereqs:
wesnoth_editor = env.Program("wesnoth_editor", wesnoth_editor_sources + [libwesnoth_core, libwesnoth_sdl, libwesnoth] + wesnoth_editor_res)
else:
wesnoth_editor = None
Export("wesnoth_editor")
campaignd_sources = Split("""
campaign_server/campaign_server.cpp
server/input_stream.cpp
""")
if have_server_prereqs:
campaignd = env.Program("campaignd", campaignd_sources + [libwesnoth_core, libwesnothd, libcampaignd])
else:
campaignd = None
Export("campaignd")
wesnothd_sources = Split("""
server/ban.cpp
server/game.cpp
server/input_stream.cpp
server/metrics.cpp
server/player.cpp
server/proxy.cpp
server/server.cpp
server/simple_wml.cpp
time.cpp
""")
if have_server_prereqs:
wesnothd = env.Program("wesnothd", wesnothd_sources + [libwesnoth_core, libwesnothd])
else:
wesnothd = None
Export("wesnothd")
cutter_sources = Split("""
tools/cutter.cpp
""")
if have_client_prereqs:
cutter = env.Program("cutter", cutter_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnothd, libwesnoth],
LIBS = env["LIBS"] + ["png"])
else:
cutter = None
Export("cutter")
exploder_sources = Split("""
tools/exploder.cpp
tools/exploder_composer.cpp
""")
if have_client_prereqs:
exploder = env.Program("exploder", exploder_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnothd, libwesnoth],
LIBS = env["LIBS"] + ["png"])
else:
exploder = None
Export("exploder")
test_sources = Split("""
tests/main.cpp
tests/test_util.cpp
""")
test = test_env.Program("test", test_sources + [libwesnoth_core, libwesnoth])
Export("test")
if env["svnrev"] != "" and env["svnrev"] != "exported":
revision_define = "#define REVISION \"%s\"\n" % env["svnrev"]
env.Command("revision.hpp", Value(env["svnrev"]), Action(
lambda target, source, env: open(str(target[0]), "w").write(revision_define),
"Generating revision.hpp..."
))
env.Append(CPPDEFINES = 'HAVE_REVISION')
sources = []
if "TAGS" in COMMAND_LINE_TARGETS:
EnsureSConsVersion(0, 98)
sources = [ Glob(os.path.join(dir, pattern)) for dir in ["", "*", "*/*"] for pattern in ["*.cpp", "*.hpp"] ]
Export("sources")
# Local variables:
# mode: python
# end: