summaryrefslogtreecommitdiff
path: root/tests/SConscript
blob: 3d900bc9052e3bafeff84c241e58d890e362dd7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# vi: syntax=python:et:ts=4

import commands, os
from subprocess import Popen, PIPE
from glob import glob

Import("*")

for env in [test_env, client_env, env]:
    env.Append(CPPDEFINES = "$EXTRA_DEFINE")

#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
    gettext.cpp
    hash.cpp
    log.cpp
    map.cpp
    map_location.cpp
    md5.cpp
    thread.cpp
    tstring.cpp
    util.cpp
    version.cpp
    serialization/binary_or_text.cpp
    serialization/parser.cpp
    serialization/preprocessor.cpp
    serialization/schema_validator.cpp
    serialization/string_utils.cpp
    serialization/tokenizer.cpp
    serialization/validator.cpp
    tools/schema/tag.cpp
    """)

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")
    libwesnoth_core_sources.append("network_manager_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":
    game_config_env.Append(CPPDEFINES = "WESNOTH_PATH='\"$datadir\"'")
    if env['localedirname']:
        filesystem_env.Append(CPPDEFINES = "LOCALEDIR='\"$localedirname\"'")
        if not os.path.isabs(env['localedirname']):
            filesystem_env.Append(CPPDEFINES = "HAS_RELATIVE_LOCALEDIR")
    if env['version_suffix'] and not env['prefsdir']:
        filesystem_env['prefsdir'] = ".wesnoth$version_suffix"
    if filesystem_env['prefsdir']:
        filesystem_env.Append(CPPDEFINES = "PREFERENCES_DIR='\"$prefsdir\"'")

if env['default_prefs_file']:
    client_env.Append(CPPDEFINES = "DEFAULT_PREFS_PATH='\"$default_prefs_file\"'")

    game_config_env['default_prefs_file'] = env['default_prefs_file']
    game_config_env.Append(CPPDEFINES = "DEFAULT_PREFS_PATH='\"$default_prefs_file\"'")
    if not os.path.isabs(env['default_prefs_file']):
        filesystem_env.Append(CPPDEFINES = "HAS_RELATIVE_DEFPREF")

libwesnoth_core_sources.extend([
    game_config_env.Object("game_config.cpp"),
    filesystem_env.Object("filesystem.cpp")
    ])

libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources), ana]

libwesnoth_sources = Split("""
    arrow.cpp
    pathfind/astarsearch.cpp
    builder.cpp
    cavegen.cpp
    clipboard.cpp
    construct_dialog.cpp
    cursor.cpp
    display.cpp
    events.cpp
    generic_event.cpp
    hotkeys.cpp
    image.cpp
    image_modifications.cpp
    joystick.cpp
    game_end_exceptions.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
    sound_music_track.cpp
    terrain.cpp
    terrain_translation.cpp
    text.cpp
    time_of_day.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
    """)
libwesnoth_sources.extend([
    client_env.Object("font.cpp", EXTRA_DEFINE = client_env['fribidi'] and "HAVE_FRIBIDI" or None),
    ])

libwesnoth = client_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/validation.cpp
    """)
libcampaignd = env.Library("campaignd", libcampaignd_sources, OBJPREFIX = "campaignd_")

libwesnoth_sdl_sources = Split("""
    sdl_utils.cpp
    tracer.cpp
    """)
libwesnoth_sdl = client_env.Library("wesnoth_sdl", libwesnoth_sdl_sources)

libcutter_sources = Split("""
    tools/exploder_utils.cpp
    tools/exploder_cutter.cpp
    """)
libcutter = client_env.Library("cutter", libcutter_sources)

# Used by both 'wesnoth' and 'test' targets
wesnoth_sources = Split("""
    about.cpp
    actions/attack.cpp
    actions/create.cpp
    actions/heal.cpp
    actions/move.cpp
    actions/undo.cpp
    actions/vision.cpp
    addon/client.cpp
    addon/info.cpp
    addon/manager.cpp
    addon/manager_ui.cpp
    addon/state.cpp
    addon/validation.cpp
    ai/actions.cpp
    ai/akihara/recruitment.cpp
    ai/composite/ai.cpp
    ai/composite/aspect.cpp
    ai/composite/component.cpp
    ai/composite/contexts.cpp
    ai/composite/engine.cpp
    ai/composite/engine_default.cpp
    ai/composite/engine_fai.cpp
    ai/composite/engine_lua.cpp
    ai/composite/goal.cpp
    ai/composite/rca.cpp
    ai/composite/stage.cpp
    ai/configuration.cpp
    ai/contexts.cpp
    ai/default/ai.cpp
    ai/default/attack.cpp
    ai/default/contexts.cpp
    ai/formula/ai.cpp
    ai/formula/callable_objects.cpp
    ai/formula/candidates.cpp
    ai/formula/function_table.cpp
    ai/formula/stage_side_formulas.cpp
    ai/formula/stage_unit_formulas.cpp
    ai/game_info.cpp
    ai/gamestate_observer.cpp
    ai/interface.cpp
    ai/lua/core.cpp
    ai/lua/lua_object.cpp
    ai/lua/unit_advancements_aspect.cpp
    ai/manager.cpp
    ai/registry.cpp
    ai/testing.cpp
    ai/testing/aspect_attacks.cpp
    ai/testing/ca.cpp
    ai/testing/ca_global_fallback.cpp
    ai/testing/ca_testing_move_to_targets.cpp
    ai/testing/ca_testing_recruitment.cpp
    ai/testing/stage_fallback.cpp
    ai/testing/stage_rca.cpp
    animated_game.cpp
    attack_prediction.cpp
    attack_prediction_display.cpp
    callable_objects.cpp
    commandline_options.cpp
    config_cache.cpp
    controller_base.cpp
    dialogs.cpp
    editor/action/action.cpp
    editor/action/action_unit.cpp
    editor/action/action_label.cpp
    editor/action/action_village.cpp
    editor/action/action_item.cpp
    editor/action/mouse/mouse_action.cpp
    editor/action/mouse/mouse_action_map_label.cpp
    editor/action/mouse/mouse_action_unit.cpp
    editor/action/mouse/mouse_action_village.cpp
    editor/action/mouse/mouse_action_item.cpp
    editor/map/editor_map.cpp
    editor/map/map_context.cpp
    editor/map/map_fragment.cpp
    editor/map/context_manager.cpp
    editor/palette/editor_palettes.cpp
    editor/palette/terrain_palettes.cpp
    editor/palette/tristate_button.cpp
    editor/palette/unit_palette.cpp
    editor/palette/item_palette.cpp
    editor/palette/palette_manager.cpp
    editor/editor_controller.cpp
    editor/editor_display.cpp
    editor/editor_main.cpp
    editor/editor_preferences.cpp
    editor/toolkit/brush.cpp
    editor/toolkit/editor_toolkit.cpp
    filechooser.cpp
    floating_textbox.cpp
    formula.cpp
    formula_debugger.cpp
    formula_debugger_fwd.cpp
    formula_function.cpp
    formula_string_utils.cpp
    formula_tokenizer.cpp
    game_controller.cpp
    game_controller_abstract.cpp
    game_controller_new.cpp
    game_display.cpp
    game_errors.cpp
    game_events.cpp
    game_instance.cpp
    game_preferences.cpp
    gamestatus.cpp
    gui/auxiliary/canvas.cpp
    gui/auxiliary/event/dispatcher.cpp
    gui/auxiliary/event/distributor.cpp
    gui/auxiliary/event/handler.cpp
    gui/auxiliary/iterator/iterator.cpp
    gui/auxiliary/iterator/walker_grid.cpp
    gui/auxiliary/iterator/walker_widget.cpp
    gui/auxiliary/log.cpp
    gui/auxiliary/placer.cpp
    gui/auxiliary/placer/horizontal_list.cpp
    gui/auxiliary/placer/vertical_list.cpp
    gui/auxiliary/old_markup.cpp
    gui/auxiliary/timer.cpp
    gui/auxiliary/tips.cpp
    gui/auxiliary/widget_definition.cpp
    gui/auxiliary/widget_definition/button.cpp
    gui/auxiliary/widget_definition/drawing.cpp
    gui/auxiliary/widget_definition/horizontal_scrollbar.cpp
    gui/auxiliary/widget_definition/image.cpp
    gui/auxiliary/widget_definition/label.cpp
    gui/auxiliary/widget_definition/listbox.cpp
    gui/auxiliary/widget_definition/matrix.cpp
    gui/auxiliary/widget_definition/minimap.cpp
    gui/auxiliary/widget_definition/multi_page.cpp
    gui/auxiliary/widget_definition/panel.cpp
    gui/auxiliary/widget_definition/progress_bar.cpp
    gui/auxiliary/widget_definition/repeating_button.cpp
    gui/auxiliary/widget_definition/scroll_label.cpp
    gui/auxiliary/widget_definition/scrollbar_panel.cpp
    gui/auxiliary/widget_definition/slider.cpp
    gui/auxiliary/widget_definition/spacer.cpp
    gui/auxiliary/widget_definition/stacked_widget.cpp
    gui/auxiliary/widget_definition/text_box.cpp
    gui/auxiliary/widget_definition/toggle_button.cpp
    gui/auxiliary/widget_definition/toggle_panel.cpp
    gui/auxiliary/widget_definition/tree_view.cpp
    gui/auxiliary/widget_definition/vertical_scrollbar.cpp
    gui/auxiliary/widget_definition/window.cpp
    gui/auxiliary/window_builder.cpp
    gui/auxiliary/window_builder/button.cpp
    gui/auxiliary/window_builder/control.cpp
    gui/auxiliary/window_builder/drawing.cpp
    gui/auxiliary/window_builder/helper.cpp
    gui/auxiliary/window_builder/horizontal_listbox.cpp
    gui/auxiliary/window_builder/horizontal_scrollbar.cpp
    gui/auxiliary/window_builder/instance.cpp
    gui/auxiliary/window_builder/image.cpp
    gui/auxiliary/window_builder/label.cpp
    gui/auxiliary/window_builder/listbox.cpp
    gui/auxiliary/window_builder/matrix.cpp
    gui/auxiliary/window_builder/minimap.cpp
    gui/auxiliary/window_builder/multi_page.cpp
    gui/auxiliary/window_builder/pane.cpp
    gui/auxiliary/window_builder/panel.cpp
    gui/auxiliary/window_builder/password_box.cpp
    gui/auxiliary/window_builder/progress_bar.cpp
    gui/auxiliary/window_builder/repeating_button.cpp
    gui/auxiliary/window_builder/scroll_label.cpp
    gui/auxiliary/window_builder/scrollbar_panel.cpp
    gui/auxiliary/window_builder/slider.cpp
    gui/auxiliary/window_builder/spacer.cpp
    gui/auxiliary/window_builder/stacked_widget.cpp
    gui/auxiliary/window_builder/text_box.cpp
    gui/auxiliary/window_builder/toggle_button.cpp
    gui/auxiliary/window_builder/toggle_panel.cpp
    gui/auxiliary/window_builder/tree_view.cpp
    gui/auxiliary/window_builder/vertical_scrollbar.cpp
    gui/auxiliary/window_builder/viewport.cpp
    gui/dialogs/addon/description.cpp
    gui/dialogs/addon/filter_options.cpp
    gui/dialogs/addon/uninstall_list.cpp
    gui/dialogs/addon_connect.cpp
    gui/dialogs/addon_list.cpp
    gui/dialogs/campaign_difficulty.cpp
    gui/dialogs/campaign_selection.cpp
    gui/dialogs/chat_log.cpp
    gui/dialogs/data_manage.cpp
    gui/dialogs/debug_clock.cpp
    gui/dialogs/dialog.cpp
    gui/dialogs/edit_label.cpp
    gui/dialogs/editor/editor_edit_label.cpp
    gui/dialogs/editor/custom_tod.cpp
    gui/dialogs/editor_generate_map.cpp
    gui/dialogs/editor_new_map.cpp
    gui/dialogs/editor_resize_map.cpp
    gui/dialogs/editor_set_starting_position.cpp
    gui/dialogs/folder_create.cpp
    gui/dialogs/formula_debugger.cpp
    gui/dialogs/game_delete.cpp
    gui/dialogs/game_load.cpp
    gui/dialogs/game_save.cpp
    gui/dialogs/gamestate_inspector.cpp
    gui/dialogs/language_selection.cpp
    gui/dialogs/lobby/lobby_data.cpp
    gui/dialogs/lobby/lobby_info.cpp
    gui/dialogs/lobby_main.cpp
    gui/dialogs/lobby_player_info.cpp
    gui/dialogs/message.cpp
    gui/dialogs/mp_cmd_wrapper.cpp
    gui/dialogs/mp_change_control.cpp
    gui/dialogs/mp_connect.cpp
    gui/dialogs/mp_create_game.cpp
    gui/dialogs/mp_create_game_choose_mods.cpp
    gui/dialogs/mp_create_game_set_password.cpp
    gui/dialogs/mp_depcheck_confirm_change.cpp
    gui/dialogs/mp_depcheck_select_new.cpp
    gui/dialogs/mp_host_game_prompt.cpp
    gui/dialogs/mp_login.cpp
    gui/dialogs/mp_method_selection.cpp
    gui/dialogs/network_transmission.cpp
    gui/dialogs/popup.cpp
    gui/dialogs/edit_text.cpp
    gui/dialogs/simple_item_selector.cpp
    gui/dialogs/tip.cpp
    gui/dialogs/title_screen.cpp
    gui/dialogs/transient_message.cpp
    gui/dialogs/unit_attack.cpp
    gui/dialogs/unit_create.cpp
    gui/dialogs/wml_message.cpp
    gui/lib/types/point.cpp
    gui/widgets/button.cpp
    gui/widgets/container.cpp
    gui/widgets/control.cpp
    gui/widgets/drawing.cpp
    gui/widgets/generator.cpp
    gui/widgets/grid.cpp
    gui/widgets/helper.cpp
    gui/widgets/horizontal_scrollbar.cpp
    gui/widgets/image.cpp
    gui/widgets/label.cpp
    gui/widgets/list.cpp
    gui/widgets/listbox.cpp
    gui/widgets/matrix.cpp
    gui/widgets/minimap.cpp
    gui/widgets/multi_page.cpp
    gui/widgets/pane.cpp
    gui/widgets/panel.cpp
    gui/widgets/password_box.cpp
    gui/widgets/progress_bar.cpp
    gui/widgets/repeating_button.cpp
    gui/widgets/scroll_label.cpp
    gui/widgets/scrollbar.cpp
    gui/widgets/scrollbar_container.cpp
    gui/widgets/scrollbar_panel.cpp
    gui/widgets/settings.cpp
    gui/widgets/slider.cpp
    gui/widgets/spacer.cpp
    gui/widgets/stacked_widget.cpp
    gui/widgets/text.cpp
    gui/widgets/text_box.cpp
    gui/widgets/toggle_button.cpp
    gui/widgets/toggle_panel.cpp
    gui/widgets/tree_view.cpp
    gui/widgets/tree_view_node.cpp
    gui/widgets/vertical_scrollbar.cpp
    gui/widgets/viewport.cpp
    gui/widgets/widget.cpp
    gui/widgets/window.cpp
    halo.cpp
    help.cpp
    intro.cpp
    leader_list.cpp
    leader_scroll_dialog.cpp
    lobby_preferences.cpp
    menu_events.cpp
    mouse_events.cpp
    mouse_handler_base.cpp
    movetype.cpp
    mp_depcheck.cpp
    mp_game_settings.cpp
    mp_options.cpp
    multiplayer.cpp
    multiplayer_connect.cpp
    multiplayer_create.cpp
    multiplayer_lobby.cpp
    multiplayer_ui.cpp
    multiplayer_wait.cpp
    network_asio.cpp
    pathfind/pathfind.cpp
    pathfind/teleport.cpp
    persist_context.cpp
    persist_manager.cpp
    persist_var.cpp
    play_controller.cpp
    playcampaign.cpp
    playmp_controller.cpp
    playsingle_controller.cpp
    playturn.cpp
    portrait.cpp
    replay.cpp
    replay_controller.cpp
    resources.cpp
    save_blocker.cpp
    savegame.cpp
    savegame_config.cpp
    scripting/debug_lua.cpp
    scripting/lua.cpp
    settings.cpp
    sha1.cpp
    side_filter.cpp
    statistics.cpp
    statistics_dialog.cpp
    storyscreen/controller.cpp
    storyscreen/interface.cpp
    storyscreen/part.cpp
    storyscreen/render.cpp
    team.cpp
    terrain_filter.cpp
    tod_manager.cpp
    unit.cpp
    unit_abilities.cpp
    unit_animation.cpp
    unit_display.cpp
    unit_frame.cpp
    unit_helper.cpp
    unit_id.cpp
    unit_map.cpp
    unit_types.cpp
    variable.cpp
    variant.cpp
    whiteboard/action.cpp
    whiteboard/attack.cpp
    whiteboard/highlighter.cpp
    whiteboard/manager.cpp
    whiteboard/mapbuilder.cpp
    whiteboard/move.cpp
    whiteboard/recall.cpp
    whiteboard/recruit.cpp
    whiteboard/side_actions.cpp
    whiteboard/suppose_dead.cpp
    whiteboard/utility.cpp
    widgets/combo.cpp
    widgets/combo_drag.cpp
    widgets/drop_target.cpp
    widgets/scrollpane.cpp
    """)

if env["PLATFORM"] == "win32":
    wesnoth_sources.append("windows_tray_notification.cpp")

wesnoth_sources.extend(client_env.Object("game_preferences_display.cpp", EXTRA_DEFINE = env["PLATFORM"] != "win32" and "WESNOTH_PREFIX='\"$prefix\"'" or None))
wesnoth_sources.extend(client_env.Object("hotkey_preferences_display.cpp", EXTRA_DEFINE = env["PLATFORM"] != "win32" and "WESNOTH_PREFIX='\"$prefix\"'" or None))

libwesnoth_extras = client_env.Library("wesnoth_extras", wesnoth_sources)

libwesnoth_extras.extend(SConscript("lua/SConscript"))

#
# Target declarations
#

def error_action(target, source, env):
    from SCons.Errors import UserError
    raise UserError, "Target disabled because its prerequisites are not met"

def WesnothProgram(env, target, source, can_build, **kw):
    if can_build:
        if env["build"] == "base":
            bin = env.Program(target, source, **kw)
        else:
            bin = env.Program("#/" + target + build_suffix, source, **kw)
        env.Alias(target, bin)
    else:
        bin = env.Alias(target, [], error_action)
        AlwaysBuild(bin)
    locals()[target] = bin
    Export(target)

for env in [test_env, client_env, env]:
    env.AddMethod(WesnothProgram)

wesnoth_objects = ["game.cpp", libwesnoth_extras, libwesnoth_core, libwesnoth_sdl,
                   libwesnoth, env["wesnoth_res"]]
if env["host"] in ["x86_64-nacl", "i686-nacl"]:
    wesnoth_objects += [SConscript("nacl/SConscript")]
client_env.WesnothProgram("wesnoth", wesnoth_objects, have_client_prereqs)

campaignd_sources = Split("""
    server/input_stream.cpp
    """)

if env["PLATFORM"] == "win32": env["fifodir"] = ""
campaignd_sources.extend(env.Object("campaign_server/campaign_server.cpp", EXTRA_DEFINE = env['fifodir'] and "FIFODIR='\"$fifodir\"'" or None))

env.WesnothProgram("campaignd", campaignd_sources + [libwesnoth_core, libwesnothd, libcampaignd], have_server_prereqs)

wesnothd_sources = Split("""
    server/ban.cpp
    server/forum_user_handler.cpp
    server/game.cpp
    server/input_stream.cpp
    server/metrics.cpp
    server/player.cpp
    server/player_network.cpp
    server/proxy.cpp
    server/room.cpp
    server/room_manager.cpp
    server/sample_user_handler.cpp
    server/simple_wml.cpp
    server/user_handler.cpp
    """)
wesnothd_sources.extend(env.Object("server/server.cpp", EXTRA_DEFINE = env['fifodir'] and "FIFODIR='\"$fifodir\"'" or None))

env.WesnothProgram("wesnothd", wesnothd_sources + [libwesnoth_core, libwesnothd], have_server_prereqs)

cutter_sources = Split("""
    tools/cutter.cpp
    """)
client_env.WesnothProgram("cutter", cutter_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnothd, libwesnoth], have_client_prereqs, LIBS = ["$LIBS", "png"])

exploder_sources = Split("""
    tools/exploder.cpp
    tools/exploder_composer.cpp
    """)
client_env.WesnothProgram("exploder", exploder_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnothd, libwesnoth], have_client_prereqs, LIBS = ["$LIBS", "png"])

schema_generator_sources = Split("""
    tools/schema/schema_generator.cpp
    tools/schema/sourceparser.cpp
    tools/schema/error_container.cpp
    """)
client_env.WesnothProgram("schema_generator", schema_generator_sources + [libwesnoth_core, libwesnothd], have_client_prereqs)

test_utils_sources = Split("""
    tests/utils/game_config_manager.cpp
    tests/utils/fake_event_source.cpp
    tests/utils/fake_display.cpp
    """)

wesmage_sources = Split("""
    wesmage/wesmage.cpp
    wesmage/exit.cpp
    wesmage/filter.cpp
    wesmage/options.cpp
    tools/dummy_video.cpp
    tools/exploder_utils.cpp
    sdl_utils.cpp
    tracer.cpp
    loadscreen_empty.cpp
    """)
client_env.WesnothProgram("wesmage", wesmage_sources + [libwesnoth_core], have_client_prereqs, OBJPREFIX = "wesmage_", LIBS = ["$LIBS", "png"])

libtest_utils = test_env.Library("test_utils", test_utils_sources)

test_sources = Split("""
    tests/floating_point_emulation.cpp
    tests/main.cpp
    tests/test_addons.cpp
    tests/test_commandline_options.cpp
    tests/test_formula_ai.cpp
    tests/test_formula_function.cpp
    tests/test_image_modifications.cpp
    tests/test_lexical_cast.cpp
    tests/test_network_worker.cpp
    tests/test_team.cpp
    tests/test_unit_map.cpp
    tests/test_util.cpp
    tests/test_sdl_utils.cpp
    tests/test_serialization.cpp
    tests/test_version.cpp
    tests/test_whiteboard_side_actions.cpp
    tests/gui/fire_event.cpp
    tests/gui/iterator.cpp
    tests/gui/test_drop_target.cpp
    tests/gui/test_gui2.cpp
    tests/gui/test_save_dialog.cpp
    tests/gui/visitor.cpp
    tests/utils/play_scenario.cpp
    """)
test_sources.extend(test_env.Object("tests/test_config_cache.cpp"))

test = test_env.WesnothProgram("test", test_sources +  [libwesnoth_extras, libwesnoth_core, libwesnoth_sdl, libwesnoth, libwesnoth_extras, libtest_utils], have_test_prereqs)

create_images_sources = Split("""
    tests/create_images.cpp
    tools/dummy_video.cpp
    tools/exploder_utils.cpp
    sdl_utils.cpp
    tracer.cpp
    loadscreen_empty.cpp
""")

env.WesnothProgram("create_images", create_images_sources + [libwesnoth_core], have_server_prereqs, OBJPREFIX = "create_images_", LIBS = ["$LIBS", "png"])

if env.get("have_autorevision"):
    game_config_env.Append(CPPDEFINES = 'LOAD_REVISION')

sources = []
if "TAGS" in COMMAND_LINE_TARGETS:
    sources = [ Glob(os.path.join(dir, pattern)) for dir in ["", "*", "*/*"] for pattern in ["*.cpp", "*.hpp"] ]

Export("sources")

# Local variables:
# mode: python
# end: