From 5b29805554178e66fcdc97693cfcb110cffc27ac Mon Sep 17 00:00:00 2001 From: Pentarctagon Date: Thu, 15 Dec 2016 14:51:29 -0600 Subject: [PATCH] Have cmake and scons use same lists of source files (#882) * Use separate files to build scons and to build lua for cmake Move lists of source files into their own directory Make scons use the lists of source files Move lua build step to src/SConscript and delete src/lua/SConscript Make cmake use the separate file with the list of lua sources to build * Finish changing over to source lists scons move source files from libraries that don't appear in cmake over to existing source lists - libcampaignd, libcutter, libdummy_video, libtest_utils add the defines FIFODIR and WESNOTH_PATH to all compiled source files, as cmake does, and move the single files those defines had previously been defined on into the source lists remove WESNOTH_PREFIX, as not used added schema_validator sources from cmake added OBJPREFIX to - cutter, exploder, campaignd, schema_generator, schema_validator cmake change over to using the source lists move source files from libraries that don't appear in scons over to existing source lists - wesnoth-gui_types, wesnoth-gui_event, wesnoth-gui_iterator, wesnoth-gui_placer, wesnoth-gui_tooltip, wesnoth-gui_widget, wesnoth-gui_widget_definition, wesnoth-gui1_widgets, wesnoth-schema_validator --- source_lists/campaignd | 6 + source_lists/create_images | 5 + source_lists/cutter | 5 + source_lists/exploder | 6 + source_lists/libwesnoth | 63 ++ source_lists/libwesnoth_core | 27 + source_lists/libwesnoth_sdl | 7 + source_lists/lua | 33 ++ source_lists/schema_generator | 6 + source_lists/schema_validator | 8 + source_lists/test | 32 ++ source_lists/wesmage | 8 + source_lists/wesnoth | 403 +++++++++++++ source_lists/wesnothd | 12 + src/CMakeLists.txt | 1017 ++++----------------------------- src/SConscript | 725 +++-------------------- src/lua/SConscript | 61 -- 17 files changed, 821 insertions(+), 1603 deletions(-) create mode 100644 source_lists/campaignd create mode 100644 source_lists/create_images create mode 100644 source_lists/cutter create mode 100644 source_lists/exploder create mode 100644 source_lists/libwesnoth create mode 100644 source_lists/libwesnoth_core create mode 100644 source_lists/libwesnoth_sdl create mode 100644 source_lists/lua create mode 100644 source_lists/schema_generator create mode 100644 source_lists/schema_validator create mode 100644 source_lists/test create mode 100644 source_lists/wesmage create mode 100644 source_lists/wesnoth create mode 100644 source_lists/wesnothd delete mode 100644 src/lua/SConscript diff --git a/source_lists/campaignd b/source_lists/campaignd new file mode 100644 index 000000000000..ea732aece8c6 --- /dev/null +++ b/source_lists/campaignd @@ -0,0 +1,6 @@ +addon/validation.cpp +campaign_server/addon_utils.cpp +campaign_server/blacklist.cpp +campaign_server/campaign_server.cpp +server/server_base.cpp +server/simple_wml.cpp diff --git a/source_lists/create_images b/source_lists/create_images new file mode 100644 index 000000000000..9aa236be796f --- /dev/null +++ b/source_lists/create_images @@ -0,0 +1,5 @@ +sdl/utils.cpp +sdl/window.cpp +tests/create_images.cpp +tools/exploder_utils.cpp +tracer.cpp diff --git a/source_lists/cutter b/source_lists/cutter new file mode 100644 index 000000000000..fc8b188f0cce --- /dev/null +++ b/source_lists/cutter @@ -0,0 +1,5 @@ +sdl/utils.cpp +tools/cutter.cpp +tools/exploder_cutter.cpp +tools/exploder_utils.cpp +tracer.cpp diff --git a/source_lists/exploder b/source_lists/exploder new file mode 100644 index 000000000000..8775ae65615d --- /dev/null +++ b/source_lists/exploder @@ -0,0 +1,6 @@ +sdl/utils.cpp +tools/exploder.cpp +tools/exploder_composer.cpp +tools/exploder_cutter.cpp +tools/exploder_utils.cpp +tracer.cpp diff --git a/source_lists/libwesnoth b/source_lists/libwesnoth new file mode 100644 index 000000000000..747b0088857c --- /dev/null +++ b/source_lists/libwesnoth @@ -0,0 +1,63 @@ +arrow.cpp +construct_dialog.cpp +cursor.cpp +desktop/clipboard.cpp +display.cpp +display_context.cpp +events.cpp +floating_label.cpp +font/font_config.cpp +font/marked-up_text.cpp +font/sdl_ttf.cpp +font/standard_colors.cpp +font/text.cpp +font/text_cache.cpp +font/text_formatting.cpp +font/text_surface.cpp +format_time_summary.cpp +game_end_exceptions.cpp +generators/cave_map_generator.cpp +generators/default_map_generator.cpp +generators/default_map_generator_job.cpp +generators/lua_map_generator.cpp +generators/map_create.cpp +generators/map_generator.cpp +generic_event.cpp +hotkey/command_executor.cpp +hotkey/hotkey_command.cpp +hotkey/hotkey_item.cpp +hotkey/hotkey_manager.cpp +image.cpp +image_modifications.cpp +joystick.cpp +key.cpp +language.cpp +map/label.cpp +minimap.cpp +pathfind/astarsearch.cpp +pathutils.cpp +preferences.cpp +quit_confirmation.cpp +reports.cpp +show_dialog.cpp +sound.cpp +sound_music_track.cpp +soundsource.cpp +terrain/builder.cpp +terrain/terrain.cpp +terrain/translation.cpp +theme.cpp +time_of_day.cpp +tooltips.cpp +utils/make_enum.cpp +video.cpp +widgets/button.cpp +widgets/label.cpp +widgets/menu.cpp +widgets/menu_style.cpp +widgets/scrollarea.cpp +widgets/scrollbar.cpp +widgets/slider.cpp +widgets/textbox.cpp +widgets/widget.cpp +wml_exception.cpp diff --git a/source_lists/libwesnoth_core b/source_lists/libwesnoth_core new file mode 100644 index 000000000000..887d2eea632b --- /dev/null +++ b/source_lists/libwesnoth_core @@ -0,0 +1,27 @@ +color.cpp +color_range.cpp +config.cpp +filesystem_boost.cpp +filesystem_common.cpp +font/constants.cpp +game_config.cpp +gettext_boost.cpp +hash.cpp +log.cpp +map/location.cpp +map/map.cpp +md5.cpp +mt_rng.cpp +seed_rng.cpp +serialization/binary_or_text.cpp +serialization/parser.cpp +serialization/preprocessor.cpp +serialization/schema_validator.cpp +serialization/string_utils.cpp +serialization/tokenizer.cpp +serialization/unicode.cpp +serialization/validator.cpp +terrain/type_data.cpp +tools/schema/tag.cpp +tstring.cpp +version.cpp diff --git a/source_lists/libwesnoth_sdl b/source_lists/libwesnoth_sdl new file mode 100644 index 000000000000..708d0607d329 --- /dev/null +++ b/source_lists/libwesnoth_sdl @@ -0,0 +1,7 @@ +sdl/exception.cpp +sdl/rect.cpp +sdl/surface.cpp +sdl/utils.cpp +sdl/window.cpp +tracer.cpp +xBRZ/xbrz.cpp diff --git a/source_lists/lua b/source_lists/lua new file mode 100644 index 000000000000..77f4f2f54ddd --- /dev/null +++ b/source_lists/lua @@ -0,0 +1,33 @@ +lua_jailbreak_exception.cpp +lua/lapi.cpp +lua/lauxlib.cpp +lua/lbaselib.cpp +lua/lbitlib.cpp +lua/lcode.cpp +lua/lcorolib.cpp +lua/lctype.cpp +lua/ldblib.cpp +lua/ldebug.cpp +lua/ldo.cpp +lua/ldump.cpp +lua/lfunc.cpp +lua/lgc.cpp +lua/liolib.cpp +lua/llex.cpp +lua/lmathlib.cpp +lua/lmem.cpp +lua/loadlib.cpp +lua/lobject.cpp +lua/lopcodes.cpp +lua/loslib.cpp +lua/lparser.cpp +lua/lstate.cpp +lua/lstring.cpp +lua/lstrlib.cpp +lua/ltable.cpp +lua/ltablib.cpp +lua/ltm.cpp +lua/lundump.cpp +lua/lutf8lib.cpp +lua/lvm.cpp +lua/lzio.cpp diff --git a/source_lists/schema_generator b/source_lists/schema_generator new file mode 100644 index 000000000000..64404c6e5a67 --- /dev/null +++ b/source_lists/schema_generator @@ -0,0 +1,6 @@ +filesystem_boost.cpp +filesystem_common.cpp +tools/schema/error_container.cpp +tools/schema/schema_generator.cpp +tools/schema/sourceparser.cpp +tools/schema/tag.cpp diff --git a/source_lists/schema_validator b/source_lists/schema_validator new file mode 100644 index 000000000000..f8f771d321c9 --- /dev/null +++ b/source_lists/schema_validator @@ -0,0 +1,8 @@ +config_cache.cpp +filesystem_boost.cpp +filesystem_common.cpp +serialization/schema_validator.cpp +serialization/validator.cpp +tools/schema/tag.cpp +tools/validator/validator_tool.cpp +utils/sha1.cpp diff --git a/source_lists/test b/source_lists/test new file mode 100644 index 000000000000..72be0bd3597f --- /dev/null +++ b/source_lists/test @@ -0,0 +1,32 @@ +tests/gui/fire_event.cpp +tests/gui/iterator.cpp +tests/gui/test_gui2.cpp +tests/gui/test_save_dialog.cpp +tests/gui/visitor.cpp +tests/main.cpp +tests/test_addons.cpp +tests/test_commandline_options.cpp +tests/test_config.cpp +tests/test_config_cache.cpp +tests/test_filesystem.cpp +tests/test_formula_ai.cpp +tests/test_formula_core.cpp +tests/test_formula_function.cpp +tests/test_image_modifications.cpp +tests/test_lexical_cast.cpp +tests/test_make_enum.cpp +tests/test_map_location.cpp +tests/test_mp_connect.cpp +tests/test_recall_list.cpp +tests/test_rng.cpp +tests/test_sdl_utils.cpp +tests/test_serialization.cpp +tests/test_team.cpp +tests/test_unit_map.cpp +tests/test_util.cpp +tests/test_version.cpp +tests/test_whiteboard_side_actions.cpp +tests/utils/fake_display.cpp +tests/utils/fake_event_source.cpp +tests/utils/game_config_manager.cpp +tests/utils/play_scenario.cpp diff --git a/source_lists/wesmage b/source_lists/wesmage new file mode 100644 index 000000000000..ae4a57cc94cf --- /dev/null +++ b/source_lists/wesmage @@ -0,0 +1,8 @@ +sdl/utils.cpp +sdl/window.cpp +tools/exploder_utils.cpp +tracer.cpp +wesmage/exit.cpp +wesmage/filter.cpp +wesmage/options.cpp +wesmage/wesmage.cpp diff --git a/source_lists/wesnoth b/source_lists/wesnoth new file mode 100644 index 000000000000..868a4ad67c80 --- /dev/null +++ b/source_lists/wesnoth @@ -0,0 +1,403 @@ +about.cpp +actions/advancement.cpp +actions/attack.cpp +actions/create.cpp +actions/heal.cpp +actions/move.cpp +actions/shroud_clearing_action.cpp +actions/undo.cpp +actions/undo_action.cpp +actions/undo_dismiss_action.cpp +actions/undo_move_action.cpp +actions/undo_recall_action.cpp +actions/undo_recruit_action.cpp +actions/undo_update_shroud_action.cpp +actions/unit_creator.cpp +actions/vision.cpp +addon/client.cpp +addon/info.cpp +addon/manager_old.cpp +addon/manager_ui.cpp +addon/state.cpp +addon/validation.cpp +ai/actions.cpp +ai/composite/ai.cpp +ai/composite/aspect.cpp +ai/composite/component.cpp +ai/composite/contexts.cpp +ai/composite/engine.cpp +ai/composite/goal.cpp +ai/composite/rca.cpp +ai/composite/stage.cpp +ai/configuration.cpp +ai/contexts.cpp +ai/default/aspect_attacks.cpp +ai/default/attack.cpp +ai/default/ca.cpp +ai/default/ca_move_to_targets.cpp +ai/default/contexts.cpp +ai/default/engine_cpp.cpp +ai/default/recruitment.cpp +ai/default/stage_rca.cpp +ai/formula/ai.cpp +ai/formula/callable_objects.cpp +ai/formula/candidates.cpp +ai/formula/engine_fai.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/lua/aspect_advancements.cpp +ai/lua/core.cpp +ai/lua/engine_lua.cpp +ai/lua/lua_object.cpp +ai/manager.cpp +ai/registry.cpp +ai/simulated_actions.cpp +ai/testing.cpp +animated_game.cpp +attack_prediction.cpp +attack_prediction_display.cpp +build_info.cpp +carryover.cpp +chat_command_handler.cpp +chat_events.cpp +commandline_options.cpp +config_cache.cpp +controller_base.cpp +countdown_clock.cpp +desktop/notifications.cpp +desktop/open.cpp +desktop/paths.cpp +desktop/version.cpp +display_chat_manager.cpp +editor/action/action.cpp +editor/action/action_item.cpp +editor/action/action_label.cpp +editor/action/action_select.cpp +editor/action/action_unit.cpp +editor/action/action_village.cpp +editor/action/mouse/mouse_action.cpp +editor/action/mouse/mouse_action_item.cpp +editor/action/mouse/mouse_action_map_label.cpp +editor/action/mouse/mouse_action_select.cpp +editor/action/mouse/mouse_action_unit.cpp +editor/action/mouse/mouse_action_village.cpp +editor/controller/editor_controller.cpp +editor/editor_display.cpp +editor/editor_main.cpp +editor/editor_preferences.cpp +editor/map/context_manager.cpp +editor/map/editor_map.cpp +editor/map/map_context.cpp +editor/map/map_fragment.cpp +editor/palette/editor_palettes.cpp +editor/palette/item_palette.cpp +editor/palette/location_palette.cpp +editor/palette/palette_manager.cpp +editor/palette/terrain_palettes.cpp +editor/palette/tristate_button.cpp +editor/palette/unit_palette.cpp +editor/toolkit/brush.cpp +editor/toolkit/editor_toolkit.cpp +fake_unit_manager.cpp +fake_unit_ptr.cpp +filesystem_sdl.cpp +floating_textbox.cpp +formula/callable_objects.cpp +formula/debugger.cpp +formula/debugger_fwd.cpp +formula/formula.cpp +formula/function.cpp +formula/string_utils.cpp +formula/tokenizer.cpp +formula/variant.cpp +game_board.cpp +game_classification.cpp +game_config_manager.cpp +game_data.cpp +game_display.cpp +game_events/action_wml.cpp +game_events/conditional_wml.cpp +game_events/entity_location.cpp +game_events/handlers.cpp +game_events/manager.cpp +game_events/manager_impl.cpp +game_events/menu_item.cpp +game_events/pump.cpp +game_events/wmi_container.cpp +game_initialization/configure_engine.cpp +game_initialization/connect_engine.cpp +game_initialization/create_engine.cpp +game_initialization/depcheck.cpp +game_initialization/flg_manager.cpp +game_initialization/lobby_data.cpp +game_initialization/lobby_info.cpp +game_initialization/mp_game_utils.cpp +game_initialization/multiplayer.cpp +game_initialization/playcampaign.cpp +game_initialization/singleplayer.cpp +game_launcher.cpp +game_preferences.cpp +game_state.cpp +gui/auxiliary/iterator/iterator.cpp +gui/auxiliary/iterator/walker_grid.cpp +gui/auxiliary/iterator/walker_tree_node.cpp +gui/auxiliary/iterator/walker_widget.cpp +gui/auxiliary/old_markup.cpp +gui/auxiliary/tips.cpp +gui/core/canvas.cpp +gui/core/event/dispatcher.cpp +gui/core/event/distributor.cpp +gui/core/event/handler.cpp +gui/core/log.cpp +gui/core/placer.cpp +gui/core/placer/horizontal_list.cpp +gui/core/placer/vertical_list.cpp +gui/core/point.cpp +gui/core/timer.cpp +gui/core/widget_definition.cpp +gui/core/window_builder.cpp +gui/core/window_builder/helper.cpp +gui/core/window_builder/instance.cpp +gui/dialogs/addon/connect.cpp +gui/dialogs/addon/description.cpp +gui/dialogs/addon/filter_options.cpp +gui/dialogs/addon/manager.cpp +gui/dialogs/addon/uninstall_list.cpp +gui/dialogs/advanced_graphics_options.cpp +gui/dialogs/campaign_difficulty.cpp +gui/dialogs/campaign_selection.cpp +gui/dialogs/campaign_settings.cpp +gui/dialogs/chat_log.cpp +gui/dialogs/core_selection.cpp +gui/dialogs/debug_clock.cpp +gui/dialogs/depcheck_confirm_change.cpp +gui/dialogs/depcheck_select_new.cpp +gui/dialogs/drop_down_menu.cpp +gui/dialogs/edit_label.cpp +gui/dialogs/edit_text.cpp +gui/dialogs/editor/custom_tod.cpp +gui/dialogs/editor/edit_label.cpp +gui/dialogs/editor/edit_scenario.cpp +gui/dialogs/editor/edit_side.cpp +gui/dialogs/editor/generate_map.cpp +gui/dialogs/editor/generator_settings.cpp +gui/dialogs/editor/new_map.cpp +gui/dialogs/editor/resize_map.cpp +gui/dialogs/editor/set_starting_position.cpp +gui/dialogs/end_credits.cpp +gui/dialogs/file_dialog.cpp +gui/dialogs/folder_create.cpp +gui/dialogs/formula_debugger.cpp +gui/dialogs/game_cache_options.cpp +gui/dialogs/game_delete.cpp +gui/dialogs/game_load.cpp +gui/dialogs/game_save.cpp +gui/dialogs/game_stats.cpp +gui/dialogs/game_version.cpp +gui/dialogs/gamestate_inspector.cpp +gui/dialogs/label_settings.cpp +gui/dialogs/language_selection.cpp +gui/dialogs/loading_screen.cpp +gui/dialogs/lobby/lobby.cpp +gui/dialogs/lobby/player_info.cpp +gui/dialogs/log_settings.cpp +gui/dialogs/lua_interpreter.cpp +gui/dialogs/message.cpp +gui/dialogs/modal_dialog.cpp +gui/dialogs/modeless_dialog.cpp +gui/dialogs/multiplayer/faction_select.cpp +gui/dialogs/multiplayer/mp_alerts_options.cpp +gui/dialogs/multiplayer/mp_change_control.cpp +gui/dialogs/multiplayer/mp_cmd_wrapper.cpp +gui/dialogs/multiplayer/mp_connect.cpp +gui/dialogs/multiplayer/mp_create_game.cpp +gui/dialogs/multiplayer/mp_host_game_prompt.cpp +gui/dialogs/multiplayer/mp_join_game.cpp +gui/dialogs/multiplayer/mp_join_game_password_prompt.cpp +gui/dialogs/multiplayer/mp_login.cpp +gui/dialogs/multiplayer/mp_method_selection.cpp +gui/dialogs/multiplayer/mp_options_helper.cpp +gui/dialogs/multiplayer/mp_staging.cpp +gui/dialogs/multiplayer/synced_choice_wait.cpp +gui/dialogs/network_transmission.cpp +gui/dialogs/preferences_dialog.cpp +gui/dialogs/screenshot_notification.cpp +gui/dialogs/select_orb_colors.cpp +gui/dialogs/simple_item_selector.cpp +gui/dialogs/sp_options_configure.cpp +gui/dialogs/statistics_dialog.cpp +gui/dialogs/terrain_layers.cpp +gui/dialogs/theme_list.cpp +gui/dialogs/title_screen.cpp +gui/dialogs/tooltip.cpp +gui/dialogs/transient_message.cpp +gui/dialogs/unit_advance.cpp +gui/dialogs/unit_attack.cpp +gui/dialogs/unit_create.cpp +gui/dialogs/unit_list.cpp +gui/dialogs/unit_recall.cpp +gui/dialogs/unit_recruit.cpp +gui/dialogs/wml_error.cpp +gui/dialogs/wml_message.cpp +gui/widgets/button.cpp +gui/widgets/chatbox.cpp +gui/widgets/container_base.cpp +gui/widgets/debug.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/menu_button.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/size_lock.cpp +gui/widgets/slider.cpp +gui/widgets/spacer.cpp +gui/widgets/stacked_widget.cpp +gui/widgets/styled_widget.cpp +gui/widgets/text_box.cpp +gui/widgets/text_box_base.cpp +gui/widgets/toggle_button.cpp +gui/widgets/toggle_panel.cpp +gui/widgets/tree_view.cpp +gui/widgets/tree_view_node.cpp +gui/widgets/unit_preview_pane.cpp +gui/widgets/vertical_scrollbar.cpp +gui/widgets/viewport.cpp +gui/widgets/widget.cpp +gui/widgets/window.cpp +halo.cpp +help/help.cpp +help/help_browser.cpp +help/help_button.cpp +help/help_impl.cpp +help/help_menu.cpp +help/help_text_area.cpp +help/help_topic_generators.cpp +hotkey/hotkey_handler.cpp +hotkey/hotkey_handler_mp.cpp +hotkey/hotkey_handler_sp.cpp +hotkey/hotkey_preferences_display.cpp +intro.cpp +lobby_preferences.cpp +menu_events.cpp +mouse_events.cpp +mouse_handler_base.cpp +movetype.cpp +mp_game_settings.cpp +mp_ui_alerts.cpp +network_asio.cpp +pathfind/pathfind.cpp +pathfind/teleport.cpp +persist_context.cpp +persist_manager.cpp +persist_var.cpp +play_controller.cpp +playmp_controller.cpp +playsingle_controller.cpp +playturn.cpp +playturn_network_adapter.cpp +preferences_display.cpp +random_new.cpp +random_new_deterministic.cpp +random_new_synced.cpp +recall_list_manager.cpp +replay.cpp +replay_controller.cpp +replay_helper.cpp +replay_recorder_base.cpp +resources.cpp +save_blocker.cpp +save_index.cpp +saved_game.cpp +savegame.cpp +scripting/application_lua_kernel.cpp +scripting/debug_lua.cpp +scripting/game_lua_kernel.cpp +scripting/lua_common.cpp +scripting/lua_cpp_function.cpp +scripting/lua_fileops.cpp +scripting/lua_formula_bridge.cpp +scripting/lua_gui2.cpp +scripting/lua_kernel_base.cpp +scripting/lua_map_location_ops.cpp +scripting/lua_preferences.cpp +scripting/lua_race.cpp +scripting/lua_rng.cpp +scripting/lua_team.cpp +scripting/lua_unit.cpp +scripting/lua_unit_attacks.cpp +scripting/lua_unit_type.cpp +scripting/mapgen_lua_kernel.cpp +scripting/plugins/context.cpp +scripting/plugins/manager.cpp +settings.cpp +side_filter.cpp +statistics.cpp +storyscreen/controller.cpp +storyscreen/interface.cpp +storyscreen/part.cpp +storyscreen/render.cpp +strftime.cpp +synced_checkup.cpp +synced_commands.cpp +synced_context.cpp +synced_user_choice.cpp +syncmp_handler.cpp +team.cpp +teambuilder.cpp +terrain/filter.cpp +tod_manager.cpp +units/abilities.cpp +units/animation.cpp +units/animation_component.cpp +units/attack_type.cpp +units/drawer.cpp +units/filter.cpp +units/formula_manager.cpp +units/frame.cpp +units/helper.cpp +units/id.cpp +units/map.cpp +units/race.cpp +units/types.cpp +units/udisplay.cpp +units/unit.cpp +utils/context_free_grammar_generator.cpp +utils/markov_generator.cpp +utils/name_generator_factory.cpp +utils/sha1.cpp +variable.cpp +variable_info.cpp +wesnothd_connection.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/scrollpane.cpp diff --git a/source_lists/wesnothd b/source_lists/wesnothd new file mode 100644 index 000000000000..b55c28749703 --- /dev/null +++ b/source_lists/wesnothd @@ -0,0 +1,12 @@ +server/ban.cpp +server/forum_user_handler.cpp +server/game.cpp +server/metrics.cpp +server/player.cpp +server/player_connection.cpp +server/player_network.cpp +server/sample_user_handler.cpp +server/server.cpp +server/server_base.cpp +server/simple_wml.cpp +server/user_handler.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index de934a2d9609..d04d1d5b4cdf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,9 @@ +# store the specified sources list in the specified variable +function(GetSources source_list store_in_var) + file(STRINGS "../source_lists/${source_list}" sources) + set(${store_in_var} ${sources} PARENT_SCOPE) +endfunction() + ## some includes ## if(MSVC) # This seems to break on some Linux systems in combination with strict @@ -207,30 +213,7 @@ endif(ENABLE_SHARED_LIBRARIES) ########### libwesnoth-core ############### -set(libwesnoth-core_STAT_SRC - color_range.cpp - color.cpp - config.cpp - filesystem_boost.cpp - filesystem_common.cpp - font/constants.cpp - game_config.cpp - gettext_boost.cpp - hash.cpp - log.cpp - md5.cpp - mt_rng.cpp - seed_rng.cpp - tstring.cpp - version.cpp - serialization/binary_or_text.cpp - serialization/parser.cpp - serialization/preprocessor.cpp - serialization/string_utils.cpp - serialization/tokenizer.cpp - serialization/unicode.cpp - serialization/validator.cpp -) +GetSources("libwesnoth_core" libwesnoth-core_STAT_SRC) if(WIN32) set(libwesnoth-core_STAT_SRC @@ -279,41 +262,8 @@ endif() ########### libwesnoth-lua ############### -set(libwesnoth-lua_STAT_SRC - lua_jailbreak_exception.cpp - lua/lapi.cpp - lua/lbitlib.cpp - lua/lcode.cpp - lua/lcorolib.cpp - lua/lctype.cpp - lua/ldebug.cpp - lua/ldo.cpp - lua/ldump.cpp - lua/lfunc.cpp - lua/lgc.cpp - lua/llex.cpp - lua/lmem.cpp - lua/lobject.cpp - lua/lopcodes.cpp - lua/lparser.cpp - lua/lstate.cpp - lua/lstring.cpp - lua/ltable.cpp - lua/ltm.cpp - lua/lundump.cpp - lua/lvm.cpp - lua/lzio.cpp - lua/lauxlib.cpp - lua/lbaselib.cpp - lua/ldblib.cpp - lua/liolib.cpp - lua/lmathlib.cpp - lua/loslib.cpp - lua/ltablib.cpp - lua/lstrlib.cpp - lua/loadlib.cpp - lua/lutf8lib.cpp -) +GetSources("lua" libwesnoth-lua_STAT_SRC) + # We explicitly want lua compiled as C++ version, so this line is required: set_source_files_properties(${libwesnoth-lua_STAT_SRC} PROPERTIES LANGUAGE CXX) @@ -362,14 +312,7 @@ set_target_properties(wesnoth-lua ########### Helper libraries ############### -set(wesnoth-sdl_SRC - sdl/exception.cpp - sdl/rect.cpp - sdl/surface.cpp - sdl/window.cpp - sdl/utils.cpp - xBRZ/xbrz.cpp -) +GetSources("libwesnoth_sdl" wesnoth-sdl_SRC) # If requested, compile and link this file also to be able to save png files if(ENABLE_LIBPNG AND PNG_FOUND) @@ -391,210 +334,6 @@ target_link_libraries(wesnoth-sdl ${sdl_image-lib} ) -# The main library is rather huge especially in debug mode, causing quite a bit -# of overhead packing objects that haven't been changed for quite a while. -# Attempting to solve the issue with several smaller libraries when adding new -# files. - -##### Gui types - -# This library contains the basic types for the gui library. -# - Public Enumerates -# - Small structs -set(wesnoth-gui_types_SRC - gui/core/point.cpp -) - -add_library(wesnoth-gui_types - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_types_SRC} -) - -##### Gui event - -# This library contains the basic event handling for the gui library. It -# converts the SDL events to internal events and allows other code to -# connect to the events based on slots. -set(wesnoth-gui_event_SRC - gui/core/event/dispatcher.cpp - gui/core/event/distributor.cpp - gui/core/event/handler.cpp -) - -add_library(wesnoth-gui_event - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_event_SRC} -) - - -##### Gui iterator - -# This library contains the basic iterator for the gui library. -# It is used to create visitors for the GUI widget tree in a window. -set(wesnoth-gui_iterator_SRC - gui/auxiliary/iterator/iterator.cpp - gui/auxiliary/iterator/walker_grid.cpp - gui/auxiliary/iterator/walker_widget.cpp - gui/auxiliary/iterator/walker_tree_node.cpp -) - -add_library(wesnoth-gui_iterator - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_iterator_SRC} -) - - -##### Gui placer - -# This library contains the basic placer for the gui library. -# The placer is used is some widgets to determine how to place its content. -set(wesnoth-gui_placer_SRC - gui/core/placer.cpp - gui/core/placer/horizontal_list.cpp - gui/core/placer/vertical_list.cpp -) - -add_library(wesnoth-gui_placer - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_placer_SRC} -) - - -##### GUI tooltip - -# This library contains the tooltip handling code. -set(wesnoth-gui_tooltip_SRC - gui/auxiliary/tips.cpp - gui/dialogs/tooltip.cpp -) - -add_library(wesnoth-gui_tooltip - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_tooltip_SRC} -) - - -##### GUI widget - -# This library contains the widget code. -# It contains the core code of the wigets which determines the -# behavior of the widgets. It also contains the builder code -# for the widgets since the code has inter dependencies. -set(wesnoth-gui_widget_SRC - gui/dialogs/drop_down_menu.cpp - gui/widgets/button.cpp - gui/widgets/chatbox.cpp - gui/widgets/container_base.cpp - gui/widgets/debug.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/menu_button.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/size_lock.cpp - gui/widgets/slider.cpp - gui/widgets/spacer.cpp - gui/widgets/stacked_widget.cpp - gui/widgets/styled_widget.cpp - gui/widgets/text_box_base.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/unit_preview_pane.cpp - gui/widgets/vertical_scrollbar.cpp - gui/widgets/viewport.cpp - gui/widgets/widget.cpp - gui/widgets/window.cpp - gui/core/window_builder.cpp - gui/core/window_builder/helper.cpp - gui/core/window_builder/instance.cpp -) - -add_library(wesnoth-gui_widget - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_widget_SRC} -) - -target_link_libraries(wesnoth-gui_widget - wesnoth-gui_event - wesnoth-gui_iterator - wesnoth-gui_placer - wesnoth-gui_tooltip - wesnoth-gui_types -) - - -##### Gui widget definition - -# This library contains the widget definitions for the gui library. -# The widget definitions serialise the widget definition WML code into -# its own structures. The definitions define the looks of the widgets. -set(wesnoth-gui_widget_definition_SRC - gui/core/widget_definition.cpp -) - -add_library(wesnoth-gui_widget_definition - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui_widget_definition_SRC} -) - - -##### GUI1 widgets - -# This library contains the widgets from gui1. -set(wesnoth-gui1_widgets_SRC - widgets/scrollpane.cpp -) - -add_library(wesnoth-gui1_widgets - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-gui1_widgets_SRC} -) - - -##### GUI1 widgets - -# This library contains the schema validator. -set(wesnoth-schema_validator_SRC - serialization/schema_validator.cpp - tools/schema/tag.cpp -) - -add_library(wesnoth-schema_validator - ${LIBRARY_TYPE} - EXCLUDE_FROM_ALL - ${wesnoth-schema_validator_SRC} -) - - ########### Wesnoth main source files ############### # Depending on whether the game or the game and the tests are build the main @@ -603,422 +342,12 @@ add_library(wesnoth-schema_validator # the library is faster (especially if the user doesn't use ccache (or # something similar)). -set(wesnoth-main_SRC - about.cpp - actions/advancement.cpp - actions/attack.cpp - actions/create.cpp - actions/heal.cpp - actions/move.cpp - actions/shroud_clearing_action.cpp - actions/undo.cpp - actions/undo_action.cpp - actions/undo_dismiss_action.cpp - actions/undo_move_action.cpp - actions/undo_recall_action.cpp - actions/undo_recruit_action.cpp - actions/undo_update_shroud_action.cpp - actions/unit_creator.cpp - actions/vision.cpp - addon/client.cpp - addon/info.cpp - addon/manager_old.cpp - addon/manager_ui.cpp - addon/state.cpp - addon/validation.cpp - ai/actions.cpp - ai/composite/ai.cpp - ai/composite/aspect.cpp - ai/composite/component.cpp - ai/composite/contexts.cpp - ai/composite/engine.cpp - ai/composite/goal.cpp - ai/composite/rca.cpp - ai/composite/stage.cpp - ai/configuration.cpp - ai/contexts.cpp - ai/default/aspect_attacks.cpp - ai/default/attack.cpp - ai/default/ca.cpp - ai/default/ca_move_to_targets.cpp - ai/default/contexts.cpp - ai/default/engine_cpp.cpp - ai/default/recruitment.cpp - ai/default/stage_rca.cpp - ai/formula/ai.cpp - ai/formula/callable_objects.cpp - ai/formula/candidates.cpp - ai/formula/engine_fai.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/lua/core.cpp - ai/lua/engine_lua.cpp - ai/lua/lua_object.cpp - ai/lua/aspect_advancements.cpp - ai/manager.cpp - ai/registry.cpp - ai/simulated_actions.cpp - ai/testing.cpp - animated_game.cpp - attack_prediction.cpp - attack_prediction_display.cpp - build_info.cpp - carryover.cpp - chat_command_handler.cpp - chat_events.cpp - commandline_options.cpp - config_cache.cpp - game_initialization/configure_engine.cpp - game_initialization/connect_engine.cpp - game_initialization/lobby_data.cpp - game_initialization/lobby_info.cpp - controller_base.cpp - countdown_clock.cpp - game_initialization/create_engine.cpp - game_initialization/depcheck.cpp - desktop/notifications.cpp - desktop/open.cpp - desktop/paths.cpp - desktop/version.cpp - display_chat_manager.cpp - editor/action/action.cpp - editor/action/action_item.cpp - editor/action/action_label.cpp - editor/action/action_unit.cpp - editor/action/action_village.cpp - editor/action/action_select.cpp - editor/action/mouse/mouse_action.cpp - editor/action/mouse/mouse_action_item.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_select.cpp - editor/controller/editor_controller.cpp - editor/map/editor_map.cpp - editor/map/map_context.cpp - editor/map/map_fragment.cpp - editor/palette/palette_manager.cpp - editor/palette/tristate_button.cpp - editor/toolkit/brush.cpp - editor/palette/editor_palettes.cpp - editor/palette/item_palette.cpp - editor/palette/location_palette.cpp - editor/palette/terrain_palettes.cpp - editor/palette/unit_palette.cpp - editor/editor_display.cpp - editor/editor_main.cpp - editor/editor_preferences.cpp - editor/toolkit/editor_toolkit.cpp - editor/map/context_manager.cpp - fake_unit_manager.cpp - fake_unit_ptr.cpp - filesystem_sdl.cpp - game_initialization/flg_manager.cpp - floating_textbox.cpp - formula/callable_objects.cpp - formula/formula.cpp - formula/debugger.cpp - formula/debugger_fwd.cpp - formula/function.cpp - formula/string_utils.cpp - formula/tokenizer.cpp - formula/variant.cpp - game_board.cpp - game_classification.cpp - game_config_manager.cpp - game_data.cpp - game_display.cpp - game_events/action_wml.cpp - game_events/conditional_wml.cpp - game_events/entity_location.cpp - game_events/handlers.cpp - game_events/manager.cpp - game_events/manager_impl.cpp - game_events/menu_item.cpp - game_events/pump.cpp - game_events/wmi_container.cpp - game_launcher.cpp - game_preferences.cpp - game_state.cpp - generic_event.cpp - gui/core/canvas.cpp - gui/core/log.cpp - gui/auxiliary/old_markup.cpp - gui/core/timer.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/manager.cpp - gui/dialogs/advanced_graphics_options.cpp - gui/dialogs/campaign_difficulty.cpp - gui/dialogs/campaign_selection.cpp - gui/dialogs/campaign_settings.cpp - gui/dialogs/core_selection.cpp - gui/dialogs/chat_log.cpp - gui/dialogs/debug_clock.cpp - gui/dialogs/depcheck_confirm_change.cpp - gui/dialogs/depcheck_select_new.cpp - gui/dialogs/edit_label.cpp - gui/dialogs/editor/custom_tod.cpp - gui/dialogs/editor/edit_label.cpp - gui/dialogs/editor/edit_side.cpp - gui/dialogs/editor/edit_scenario.cpp - gui/dialogs/editor/generate_map.cpp - gui/dialogs/editor/generator_settings.cpp - gui/dialogs/editor/new_map.cpp - gui/dialogs/editor/resize_map.cpp - gui/dialogs/editor/set_starting_position.cpp - gui/dialogs/end_credits.cpp - gui/dialogs/file_dialog.cpp - gui/dialogs/folder_create.cpp - gui/dialogs/formula_debugger.cpp - gui/dialogs/game_cache_options.cpp - gui/dialogs/game_delete.cpp - gui/dialogs/game_load.cpp - gui/dialogs/game_save.cpp - gui/dialogs/game_stats.cpp - gui/dialogs/game_version.cpp - gui/dialogs/gamestate_inspector.cpp - gui/dialogs/label_settings.cpp - gui/dialogs/language_selection.cpp - gui/dialogs/loading_screen.cpp - gui/dialogs/lobby/lobby.cpp - gui/dialogs/lobby/player_info.cpp - gui/dialogs/log_settings.cpp - gui/dialogs/lua_interpreter.cpp - gui/dialogs/message.cpp - gui/dialogs/modal_dialog.cpp - gui/dialogs/modeless_dialog.cpp - gui/dialogs/multiplayer/faction_select.cpp - gui/dialogs/multiplayer/mp_alerts_options.cpp - gui/dialogs/multiplayer/mp_change_control.cpp - gui/dialogs/multiplayer/mp_cmd_wrapper.cpp - gui/dialogs/multiplayer/mp_connect.cpp - gui/dialogs/multiplayer/mp_create_game.cpp - gui/dialogs/multiplayer/mp_host_game_prompt.cpp - gui/dialogs/multiplayer/mp_join_game.cpp - gui/dialogs/multiplayer/mp_join_game_password_prompt.cpp - gui/dialogs/multiplayer/mp_login.cpp - gui/dialogs/multiplayer/mp_method_selection.cpp - gui/dialogs/multiplayer/mp_options_helper.cpp - gui/dialogs/multiplayer/mp_staging.cpp - gui/dialogs/network_transmission.cpp - gui/dialogs/preferences_dialog.cpp - gui/dialogs/edit_text.cpp - gui/dialogs/screenshot_notification.cpp - gui/dialogs/select_orb_colors.cpp - gui/dialogs/simple_item_selector.cpp - gui/dialogs/sp_options_configure.cpp - gui/dialogs/statistics_dialog.cpp - gui/dialogs/multiplayer/synced_choice_wait.cpp - gui/dialogs/theme_list.cpp - gui/dialogs/terrain_layers.cpp - gui/dialogs/title_screen.cpp - gui/dialogs/transient_message.cpp - gui/dialogs/unit_advance.cpp - gui/dialogs/unit_attack.cpp - gui/dialogs/unit_create.cpp - gui/dialogs/unit_list.cpp - gui/dialogs/unit_recall.cpp - gui/dialogs/unit_recruit.cpp - gui/dialogs/wml_error.cpp - gui/dialogs/wml_message.cpp - halo.cpp - help/help.cpp - help/help_browser.cpp - help/help_button.cpp - help/help_impl.cpp - help/help_menu.cpp - help/help_text_area.cpp - help/help_topic_generators.cpp - hotkey/hotkey_preferences_display.cpp - hotkey/hotkey_handler.cpp - hotkey/hotkey_handler_sp.cpp - hotkey/hotkey_handler_mp.cpp - intro.cpp - map/map.cpp - map/location.cpp - menu_events.cpp - mouse_events.cpp - mouse_handler_base.cpp - movetype.cpp - mp_game_settings.cpp - game_initialization/mp_game_utils.cpp - mp_ui_alerts.cpp - game_initialization/multiplayer.cpp - network_asio.cpp - pathfind/pathfind.cpp - pathfind/teleport.cpp - persist_context.cpp - persist_manager.cpp - persist_var.cpp - play_controller.cpp - game_initialization/playcampaign.cpp - playmp_controller.cpp - playsingle_controller.cpp - playturn.cpp - playturn_network_adapter.cpp - random_new.cpp - random_new_deterministic.cpp - random_new_synced.cpp - recall_list_manager.cpp - replay.cpp - replay_helper.cpp - replay_controller.cpp - replay_recorder_base.cpp - resources.cpp - save_blocker.cpp - save_index.cpp - saved_game.cpp - savegame.cpp - scripting/application_lua_kernel.cpp - scripting/debug_lua.cpp - scripting/game_lua_kernel.cpp - scripting/lua_common.cpp - scripting/lua_cpp_function.cpp - scripting/lua_fileops.cpp - scripting/lua_formula_bridge.cpp - scripting/lua_gui2.cpp - scripting/lua_kernel_base.cpp - scripting/lua_map_location_ops.cpp - scripting/lua_preferences.cpp - scripting/lua_race.cpp - scripting/lua_rng.cpp - scripting/lua_team.cpp - scripting/lua_unit.cpp - scripting/lua_unit_attacks.cpp - scripting/lua_unit_type.cpp - scripting/mapgen_lua_kernel.cpp - scripting/plugins/context.cpp - scripting/plugins/manager.cpp - settings.cpp - side_filter.cpp - game_initialization/singleplayer.cpp - statistics.cpp - storyscreen/controller.cpp - storyscreen/interface.cpp - storyscreen/part.cpp - storyscreen/render.cpp - strftime.cpp - synced_checkup.cpp - synced_context.cpp - synced_commands.cpp - synced_user_choice.cpp - syncmp_handler.cpp - team.cpp - teambuilder.cpp - terrain/type_data.cpp - terrain/filter.cpp - tod_manager.cpp - tooltips.cpp - units/unit.cpp - units/abilities.cpp - units/animation.cpp - units/animation_component.cpp - units/attack_type.cpp - units/udisplay.cpp - units/drawer.cpp - units/filter.cpp - units/formula_manager.cpp - units/frame.cpp - units/helper.cpp - units/id.cpp - units/map.cpp - units/race.cpp - units/types.cpp - utils/sha1.cpp - utils/context_free_grammar_generator.cpp - utils/markov_generator.cpp - utils/name_generator_factory.cpp - variable.cpp - variable_info.cpp - wesnothd_connection.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 -) +GetSources("wesnoth" wesnoth-main_SRC) ########### libwesnoth-game ############### # rename libwesnoth.a to libwesnoth-game.a to have clearer targets -set(libwesnoth-game_STAT_SRC - arrow.cpp - desktop/clipboard.cpp - construct_dialog.cpp - cursor.cpp - display.cpp - display_context.cpp - events.cpp - floating_label.cpp - font/font_config.cpp - font/marked-up_text.cpp - font/sdl_ttf.cpp - font/standard_colors.cpp - font/text.cpp - font/text_cache.cpp - font/text_formatting.cpp - font/text_surface.cpp - format_time_summary.cpp - generators/cave_map_generator.cpp - generators/map_create.cpp - generators/map_generator.cpp - generators/default_map_generator.cpp - generators/default_map_generator_job.cpp - generators/lua_map_generator.cpp - hotkey/command_executor.cpp - hotkey/hotkey_item.cpp - hotkey/hotkey_command.cpp - hotkey/hotkey_manager.cpp - image.cpp - image_modifications.cpp - joystick.cpp - game_end_exceptions.cpp - key.cpp - language.cpp - lobby_preferences.cpp - utils/make_enum.cpp - map/label.cpp - minimap.cpp - pathfind/astarsearch.cpp - pathutils.cpp - preferences.cpp - preferences_display.cpp - quit_confirmation.cpp - reports.cpp - show_dialog.cpp - sound.cpp - soundsource.cpp - sound_music_track.cpp - terrain/terrain.cpp - terrain/builder.cpp - terrain/translation.cpp - time_of_day.cpp - tracer.cpp - video.cpp - theme.cpp - widgets/button.cpp - widgets/label.cpp - widgets/menu.cpp - widgets/menu_style.cpp - widgets/scrollarea.cpp - widgets/scrollbar.cpp - widgets/slider.cpp - widgets/textbox.cpp - widgets/widget.cpp - wml_exception.cpp -) +GetSources("libwesnoth" libwesnoth-game_STAT_SRC) # On windows only, this file needs to be linked, as its header is included #ifdef win32. if(WIN32) @@ -1062,16 +391,6 @@ if(ENABLE_GAME) wesnoth.cpp ) set(wesnoth_LIB - wesnoth-game - wesnoth-gui_types - wesnoth-gui_event - wesnoth-gui_iterator - wesnoth-gui_placer - wesnoth-gui_tooltip - wesnoth-gui_widget - wesnoth-gui_widget_definition - wesnoth-gui1_widgets - wesnoth-schema_validator wesnoth-core wesnoth-lua wesnoth-game @@ -1080,15 +399,6 @@ if(ENABLE_GAME) else(ENABLE_TESTS) set(wesnoth_SRC wesnoth.cpp - ${wesnoth-gui_types_SRC} - ${wesnoth-gui_event_SRC} - ${wesnoth-gui_iterator_SRC} - ${wesnoth-gui_placer_SRC} - ${wesnoth-gui_tooltip_SRC} - ${wesnoth-gui_widget_SRC} - ${wesnoth-gui_widget_definition_SRC} - ${wesnoth-gui1_widgets_SRC} - ${wesnoth-schema_validator_SRC} ${wesnoth-main_SRC} ) set(wesnoth_LIB @@ -1118,170 +428,118 @@ endif(ENABLE_GAME) if(ENABLE_SERVER) -set(wesnothd_SRC - server/ban.cpp - server/game.cpp - server/metrics.cpp - server/player.cpp - server/player_connection.cpp - server/player_network.cpp - server/server.cpp - server/server_base.cpp - server/simple_wml.cpp - server/user_handler.cpp - server/forum_user_handler.cpp - server/sample_user_handler.cpp -) + GetSources("wesnothd" wesnothd_SRC) -add_executable(wesnothd WIN32 - ${wesnothd_SRC} -) + add_executable(wesnothd WIN32 + ${wesnothd_SRC} + ) -target_link_libraries(wesnothd wesnoth-core ${server-external-libs} ${Boost_RANDOM_LIBRARY}) -set_target_properties(wesnothd PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}wesnothd${BINARY_SUFFIX}) + target_link_libraries(wesnothd wesnoth-core ${server-external-libs} ${Boost_RANDOM_LIBRARY}) + set_target_properties(wesnothd PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}wesnothd${BINARY_SUFFIX}) -install(TARGETS wesnothd DESTINATION ${BINDIR}) + install(TARGETS wesnothd DESTINATION ${BINDIR}) endif(ENABLE_SERVER) ########### Campaign Server ############### if(ENABLE_CAMPAIGN_SERVER) + + GetSources("campaignd" campaignd_SRC) -set(campaignd_SRC - addon/validation.cpp - campaign_server/addon_utils.cpp - campaign_server/blacklist.cpp - campaign_server/campaign_server.cpp - server/server_base.cpp - server/simple_wml.cpp -) + check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) + if(HAVE_CLOCK_GETTIME_RT) + set(LIBRT rt) + endif() -check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) -if(HAVE_CLOCK_GETTIME_RT) - set(LIBRT rt) -endif() - -add_executable(campaignd ${campaignd_SRC}) -target_link_libraries(campaignd - wesnoth-core - ${server-external-libs} - ${Boost_RANDOM_LIBRARY} - ${LIBRT} - ) -set_target_properties(campaignd PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}campaignd${BINARY_SUFFIX}) + add_executable(campaignd ${campaignd_SRC}) + target_link_libraries(campaignd + wesnoth-core + ${server-external-libs} + ${Boost_RANDOM_LIBRARY} + ${LIBRT} + ) + set_target_properties(campaignd PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}campaignd${BINARY_SUFFIX}) -install(TARGETS campaignd DESTINATION ${BINDIR}) + install(TARGETS campaignd DESTINATION ${BINDIR}) endif(ENABLE_CAMPAIGN_SERVER) ########### Castle building helpers ############### if(ENABLE_TOOLS) - -set(exploder_SRC - tools/exploder.cpp - tools/exploder_utils.cpp - tools/exploder_cutter.cpp - tools/exploder_composer.cpp - sdl/utils.cpp - tracer.cpp -) - -add_executable(exploder ${exploder_SRC}) -target_link_libraries(exploder - wesnoth-core - wesnoth-sdl - png - ${tools-external-libs} -) -set_target_properties(exploder PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}exploder${BINARY_SUFFIX}) - -install(TARGETS exploder DESTINATION ${BINDIR}) - -set(cutter_SRC - tools/cutter.cpp - tools/exploder_utils.cpp - tools/exploder_cutter.cpp - sdl/utils.cpp - tracer.cpp -) - -add_executable(cutter ${cutter_SRC}) -target_link_libraries(cutter - wesnoth-core - wesnoth-sdl - png - ${tools-external-libs} -) -set_target_properties(cutter PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}cutter${BINARY_SUFFIX}) - -install(TARGETS cutter DESTINATION ${BINDIR}) - -set(schema_generator_SRC - tools/schema/schema_generator.cpp - tools/schema/sourceparser.cpp - tools/schema/error_container.cpp - tools/schema/tag.cpp - filesystem_boost.cpp - filesystem_common.cpp -) - -add_executable(schema_generator ${schema_generator_SRC}) -target_link_libraries(schema_generator - wesnoth-core - wesnoth-sdl - ${tools-external-libs} - ${Boost_REGEX_LIBRARY} -) -set_target_properties(schema_generator PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}schema_generator${BINARY_SUFFIX}) - -install(TARGETS schema_generator DESTINATION ${BINDIR}) - -set(schema_validator_SRC - tools/validator/validator_tool.cpp - serialization/schema_validator.cpp - serialization/validator.cpp - tools/schema/tag.cpp - filesystem_boost.cpp - filesystem_common.cpp - config_cache.cpp - utils/sha1.cpp -) - -add_executable(schema_validator ${schema_validator_SRC}) -target_link_libraries(schema_validator - wesnoth-core - wesnoth-sdl - ${common-external-libs} - ${Boost_SYSTEM_LIBRARIES} - ${Boost_RANDOM_LIBRARY} -) -set_target_properties(schema_validator PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}schema_validator${BINARY_SUFFIX} - COMPILE_DEFINITIONS VALIDATION_ERRORS_LOG) - -install(TARGETS schema_validator DESTINATION ${BINDIR}) - -set(wesmage_SRC - wesmage/wesmage.cpp - wesmage/exit.cpp - wesmage/filter.cpp - wesmage/options.cpp - tools/exploder_utils.cpp - sdl/utils.cpp - tracer.cpp -) - -add_executable(wesmage ${wesmage_SRC}) -target_link_libraries(wesmage - wesnoth-core - wesnoth-sdl - png - ${tools-external-libs} -) -set_target_properties(wesmage PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}wesmage${BINARY_SUFFIX}) - -install(TARGETS wesmage DESTINATION ${BINDIR}) + +# exploder + GetSources("exploder" exploder_SRC) + + add_executable(exploder ${exploder_SRC}) + target_link_libraries(exploder + wesnoth-core + wesnoth-sdl + png + ${tools-external-libs} + ) + set_target_properties(exploder PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}exploder${BINARY_SUFFIX}) + + install(TARGETS exploder DESTINATION ${BINDIR}) + +# cutter + GetSources("cutter" cutter_SRC) + + add_executable(cutter ${cutter_SRC}) + target_link_libraries(cutter + wesnoth-core + wesnoth-sdl + png + ${tools-external-libs} + ) + set_target_properties(cutter PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}cutter${BINARY_SUFFIX}) + + install(TARGETS cutter DESTINATION ${BINDIR}) + +# schema_generator + GetSources("schema_generator" schema_generator_SRC) + + add_executable(schema_generator ${schema_generator_SRC}) + target_link_libraries(schema_generator + wesnoth-core + wesnoth-sdl + ${tools-external-libs} + ${Boost_REGEX_LIBRARY} + ) + set_target_properties(schema_generator PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}schema_generator${BINARY_SUFFIX}) + + install(TARGETS schema_generator DESTINATION ${BINDIR}) + +# schema_validator + GetSources("schema_validator" schema_validator_SRC) + + add_executable(schema_validator ${schema_validator_SRC}) + target_link_libraries(schema_validator + wesnoth-core + wesnoth-sdl + ${common-external-libs} + ${Boost_SYSTEM_LIBRARIES} + ${Boost_RANDOM_LIBRARY} + ) + set_target_properties(schema_validator PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}schema_validator${BINARY_SUFFIX} + COMPILE_DEFINITIONS VALIDATION_ERRORS_LOG) + + install(TARGETS schema_validator DESTINATION ${BINDIR}) + +# wesmage + GetSources("wesmage" wesmage_SRC) + + add_executable(wesmage ${wesmage_SRC}) + target_link_libraries(wesmage + wesnoth-core + wesnoth-sdl + png + ${tools-external-libs} + ) + set_target_properties(wesmage PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}wesmage${BINARY_SUFFIX}) + + install(TARGETS wesmage DESTINATION ${BINDIR}) endif(ENABLE_TOOLS) @@ -1291,69 +549,19 @@ endif(ENABLE_TOOLS) if(ENABLE_TESTS) add_definitions(-DBOOST_TEST_DYN_LINK) - - set(test_SRC - tests/gui/iterator.cpp - tests/gui/fire_event.cpp - tests/gui/test_gui2.cpp - tests/gui/test_save_dialog.cpp - tests/gui/visitor.cpp - tests/main.cpp - tests/test_addons.cpp - tests/test_commandline_options.cpp - tests/test_config.cpp - tests/test_config_cache.cpp - tests/test_filesystem.cpp - tests/test_formula_ai.cpp - tests/test_formula_core.cpp - tests/test_formula_function.cpp - tests/test_image_modifications.cpp - tests/test_lexical_cast.cpp - tests/test_map_location.cpp - tests/test_make_enum.cpp - tests/test_recall_list.cpp - tests/test_rng.cpp - tests/test_mp_connect.cpp - tests/test_sdl_utils.cpp - tests/test_serialization.cpp - tests/test_team.cpp - tests/test_unit_map.cpp - tests/test_util.cpp - tests/test_version.cpp - tests/test_whiteboard_side_actions.cpp - tests/utils/fake_display.cpp - tests/utils/fake_event_source.cpp - tests/utils/game_config_manager.cpp - tests/utils/play_scenario.cpp - ) + + GetSources("test" test_SRC) + if(ENABLE_GAME) set(test_LIB wesnoth-core wesnoth-game - wesnoth-gui_types - wesnoth-gui_event - wesnoth-gui_iterator - wesnoth-gui_placer - wesnoth-gui_tooltip - wesnoth-gui_widget - wesnoth-gui_widget_definition - wesnoth-gui1_widgets - wesnoth-schema_validator wesnoth-sdl wesnoth-lua ) else(ENABLE_GAME) set(test_SRC ${test_SRC} - ${wesnoth-gui_types_SRC} - ${wesnoth-gui_event_SRC} - ${wesnoth-gui_iterator_SRC} - ${wesnoth-gui_placer_SRC} - ${wesnoth-gui_widget_definition_SRC} - ${wesnoth-gui_tooltip_SRC} - ${wesnoth-gui_widget_SRC} - ${wesnoth-gui1_widgets_SRC} - ${wesnoth-schema_validator_SRC} ${wesnoth-main_SRC} ) set(test_LIB @@ -1386,12 +594,7 @@ if(ENABLE_TESTS) if(ENABLE_TOOLS) # This tool is used to create the images for the sdl_utils unit test. # Due to its unique nature the program is never installed. - set(create_images_SRC - tests/create_images.cpp - tools/exploder_utils.cpp - sdl/utils.cpp - tracer.cpp - ) + GetSources("create_images" create_images_SRC) add_executable(create_images ${create_images_SRC}) target_link_libraries(create_images diff --git a/src/SConscript b/src/SConscript index e7e2146d48d1..285c70ddfe12 100644 --- a/src/SConscript +++ b/src/SConscript @@ -6,6 +6,28 @@ from glob import glob Import("*") +# +# load list of sources from the file in source_lists/ +# +def GetSources(filename): + sources = [] + with open(Dir('#').abspath + "/source_lists/" + filename) as file: + for line in file.readlines(): + sources.append(line.strip()) + return sources + +# +# setup the FIFODIR, WESNOTH_PATH +# + +# if not windows, append FIFODIR, WESNOTH_PATH everywhere as cmake does +if env["PLATFORM"] != "win32": + for env in [test_env, client_env, env]: + env.Append(CPPDEFINES = "FIFODIR='\"$fifodir\"'") + env.Append(CPPDEFINES = "WESNOTH_PATH='\"$datadir\"'") +else: + env["fifodir"] = "" + # Inject boost::bind patch everywhere for env in [test_env, client_env, env]: env.Append(CCFLAGS = Split("-include boost-patched/bind/arg.hpp")) @@ -13,35 +35,13 @@ for env in [test_env, client_env, env]: for env in [test_env, client_env, env]: env.Append(CPPDEFINES = "$EXTRA_DEFINE") +#---libwesnoth_core--- + #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 - color.cpp - config.cpp - font/constants.cpp - hash.cpp - log.cpp - map/location.cpp - map/map.cpp - md5.cpp - mt_rng.cpp - seed_rng.cpp - serialization/binary_or_text.cpp - serialization/parser.cpp - serialization/preprocessor.cpp - serialization/schema_validator.cpp - serialization/string_utils.cpp - serialization/tokenizer.cpp - serialization/unicode.cpp - serialization/validator.cpp - terrain/type_data.cpp - tools/schema/tag.cpp - tstring.cpp - version.cpp - """) +libwesnoth_core_sources = GetSources("libwesnoth_core") game_config_env = env.Clone() filesystem_env = env.Clone() @@ -64,521 +64,27 @@ if env['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_common.cpp"), - filesystem_env.Object("filesystem_boost.cpp") -]) - if env["PLATFORM"] == "win32": - libwesnoth_core_sources.extend([ - filesystem_env.Object("log_windows.cpp") - ]) - -libwesnoth_core_sources.extend([ - filesystem_env.Object("gettext_boost.cpp") -]) + libwesnoth_core_sources.append("log_windows.cpp") libwesnoth_core = [env.Library("wesnoth_core", libwesnoth_core_sources)] -libwesnoth_sources = Split(""" - arrow.cpp - construct_dialog.cpp - cursor.cpp - desktop/clipboard.cpp - display_context.cpp - display.cpp - events.cpp - floating_label.cpp - font/font_config.cpp - font/marked-up_text.cpp - font/sdl_ttf.cpp - font/standard_colors.cpp - font/text.cpp - font/text_cache.cpp - font/text_formatting.cpp - font/text_surface.cpp - format_time_summary.cpp - game_end_exceptions.cpp - generators/cave_map_generator.cpp - generators/default_map_generator_job.cpp - generators/default_map_generator.cpp - generators/lua_map_generator.cpp - generators/map_create.cpp - generators/map_generator.cpp - generic_event.cpp - hotkey/command_executor.cpp - hotkey/hotkey_command.cpp - hotkey/hotkey_item.cpp - hotkey/hotkey_manager.cpp - image_modifications.cpp - image.cpp - joystick.cpp - key.cpp - language.cpp - map/label.cpp - minimap.cpp - pathfind/astarsearch.cpp - pathutils.cpp - preferences.cpp - quit_confirmation.cpp - reports.cpp - show_dialog.cpp - sound_music_track.cpp - sound.cpp - soundsource.cpp - terrain/builder.cpp - terrain/terrain.cpp - terrain/translation.cpp - theme.cpp - time_of_day.cpp - tooltips.cpp - utils/make_enum.cpp - video.cpp - widgets/button.cpp - widgets/label.cpp - widgets/menu_style.cpp - widgets/menu.cpp - widgets/scrollarea.cpp - widgets/scrollbar.cpp - widgets/slider.cpp - widgets/textbox.cpp - widgets/widget.cpp - wml_exception.cpp - """) - +#---libwesnoth--- +libwesnoth_sources = GetSources("libwesnoth") libwesnoth = client_env.Library("wesnoth", libwesnoth_sources) -libcampaignd_sources = Split(""" - addon/validation.cpp - """) -libcampaignd = env.Library("campaignd", libcampaignd_sources, OBJPREFIX = "campaignd_") - -libwesnoth_sdl_sources = Split(""" - sdl/exception.cpp - sdl/rect.cpp - sdl/surface.cpp - sdl/utils.cpp - sdl/window.cpp - tracer.cpp - xBRZ/xbrz.cpp - """) +#---libwesnoth_sdl--- +libwesnoth_sdl_sources = GetSources("libwesnoth_sdl") if env["png"]: libwesnoth_sdl_sources.append("SDL_SavePNG/savepng.c") 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) - +#---wesnoth--- # Used by both 'wesnoth' and 'test' targets -wesnoth_sources = Split(""" - about.cpp - actions/advancement.cpp - actions/attack.cpp - actions/create.cpp - actions/heal.cpp - actions/move.cpp - actions/shroud_clearing_action.cpp - actions/undo_action.cpp - actions/undo_dismiss_action.cpp - actions/undo_move_action.cpp - actions/undo_recall_action.cpp - actions/undo_recruit_action.cpp - actions/undo_update_shroud_action.cpp - actions/undo.cpp - actions/unit_creator.cpp - actions/vision.cpp - addon/client.cpp - addon/info.cpp - addon/manager_old.cpp - addon/manager_ui.cpp - addon/state.cpp - addon/validation.cpp - ai/actions.cpp - ai/composite/ai.cpp - ai/composite/aspect.cpp - ai/composite/component.cpp - ai/composite/contexts.cpp - ai/composite/engine.cpp - ai/composite/goal.cpp - ai/composite/rca.cpp - ai/composite/stage.cpp - ai/configuration.cpp - ai/contexts.cpp - ai/default/aspect_attacks.cpp - ai/default/attack.cpp - ai/default/ca_move_to_targets.cpp - ai/default/ca.cpp - ai/default/contexts.cpp - ai/default/engine_cpp.cpp - ai/default/recruitment.cpp - ai/default/stage_rca.cpp - ai/formula/ai.cpp - ai/formula/callable_objects.cpp - ai/formula/candidates.cpp - ai/formula/engine_fai.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/lua/aspect_advancements.cpp - ai/lua/core.cpp - ai/lua/engine_lua.cpp - ai/lua/lua_object.cpp - ai/manager.cpp - ai/registry.cpp - ai/simulated_actions.cpp - ai/testing.cpp - animated_game.cpp - attack_prediction_display.cpp - attack_prediction.cpp - build_info.cpp - carryover.cpp - chat_command_handler.cpp - chat_events.cpp - commandline_options.cpp - config_cache.cpp - controller_base.cpp - countdown_clock.cpp - desktop/notifications.cpp - desktop/open.cpp - desktop/paths.cpp - desktop/version.cpp - display_chat_manager.cpp - editor/action/action_item.cpp - editor/action/action_label.cpp - editor/action/action_select.cpp - editor/action/action_unit.cpp - editor/action/action_village.cpp - editor/action/action.cpp - editor/action/mouse/mouse_action_item.cpp - editor/action/mouse/mouse_action_map_label.cpp - editor/action/mouse/mouse_action_select.cpp - editor/action/mouse/mouse_action_unit.cpp - editor/action/mouse/mouse_action_village.cpp - editor/action/mouse/mouse_action.cpp - editor/controller/editor_controller.cpp - editor/editor_display.cpp - editor/editor_main.cpp - editor/editor_preferences.cpp - editor/map/context_manager.cpp - editor/map/editor_map.cpp - editor/map/map_context.cpp - editor/map/map_fragment.cpp - editor/palette/editor_palettes.cpp - editor/palette/item_palette.cpp - editor/palette/location_palette.cpp - editor/palette/palette_manager.cpp - editor/palette/terrain_palettes.cpp - editor/palette/tristate_button.cpp - editor/palette/unit_palette.cpp - editor/toolkit/brush.cpp - editor/toolkit/editor_toolkit.cpp - fake_unit_manager.cpp - fake_unit_ptr.cpp - filesystem_sdl.cpp - floating_textbox.cpp - formula/callable_objects.cpp - formula/debugger_fwd.cpp - formula/debugger.cpp - formula/formula.cpp - formula/function.cpp - formula/string_utils.cpp - formula/tokenizer.cpp - formula/variant.cpp - game_board.cpp - game_classification.cpp - game_config_manager.cpp - game_data.cpp - game_display.cpp - game_events/action_wml.cpp - game_events/conditional_wml.cpp - game_events/entity_location.cpp - game_events/handlers.cpp - game_events/manager_impl.cpp - game_events/manager.cpp - game_events/menu_item.cpp - game_events/pump.cpp - game_events/wmi_container.cpp - game_initialization/configure_engine.cpp - game_initialization/connect_engine.cpp - game_initialization/create_engine.cpp - game_initialization/depcheck.cpp - game_initialization/flg_manager.cpp - game_initialization/lobby_data.cpp - game_initialization/lobby_info.cpp - game_initialization/mp_game_utils.cpp - game_initialization/multiplayer.cpp - game_initialization/playcampaign.cpp - game_initialization/singleplayer.cpp - game_launcher.cpp - game_preferences.cpp - game_state.cpp - gui/auxiliary/iterator/iterator.cpp - gui/auxiliary/iterator/walker_grid.cpp - gui/auxiliary/iterator/walker_widget.cpp - gui/auxiliary/iterator/walker_tree_node.cpp - gui/auxiliary/old_markup.cpp - gui/auxiliary/tips.cpp - gui/core/canvas.cpp - gui/core/event/dispatcher.cpp - gui/core/event/distributor.cpp - gui/core/event/handler.cpp - gui/core/log.cpp - gui/core/placer.cpp - gui/core/placer/horizontal_list.cpp - gui/core/placer/vertical_list.cpp - gui/core/point.cpp - gui/core/timer.cpp - gui/core/widget_definition.cpp - gui/core/window_builder.cpp - gui/core/window_builder/helper.cpp - gui/core/window_builder/instance.cpp - gui/dialogs/addon/connect.cpp - gui/dialogs/addon/description.cpp - gui/dialogs/addon/filter_options.cpp - gui/dialogs/addon/manager.cpp - gui/dialogs/addon/uninstall_list.cpp - gui/dialogs/advanced_graphics_options.cpp - gui/dialogs/campaign_difficulty.cpp - gui/dialogs/campaign_selection.cpp - gui/dialogs/campaign_settings.cpp - gui/dialogs/chat_log.cpp - gui/dialogs/core_selection.cpp - gui/dialogs/debug_clock.cpp - gui/dialogs/depcheck_confirm_change.cpp - gui/dialogs/depcheck_select_new.cpp - gui/dialogs/drop_down_menu.cpp - gui/dialogs/edit_label.cpp - gui/dialogs/edit_text.cpp - gui/dialogs/editor/custom_tod.cpp - gui/dialogs/editor/edit_label.cpp - gui/dialogs/editor/edit_scenario.cpp - gui/dialogs/editor/edit_side.cpp - gui/dialogs/editor/generate_map.cpp - gui/dialogs/editor/generator_settings.cpp - gui/dialogs/editor/new_map.cpp - gui/dialogs/editor/resize_map.cpp - gui/dialogs/editor/set_starting_position.cpp - gui/dialogs/end_credits.cpp - gui/dialogs/file_dialog.cpp - gui/dialogs/folder_create.cpp - gui/dialogs/formula_debugger.cpp - gui/dialogs/game_cache_options.cpp - gui/dialogs/game_delete.cpp - gui/dialogs/game_load.cpp - gui/dialogs/game_save.cpp - gui/dialogs/game_stats.cpp - gui/dialogs/game_version.cpp - gui/dialogs/gamestate_inspector.cpp - gui/dialogs/label_settings.cpp - gui/dialogs/language_selection.cpp - gui/dialogs/loading_screen.cpp - gui/dialogs/lobby/lobby.cpp - gui/dialogs/lobby/player_info.cpp - gui/dialogs/log_settings.cpp - gui/dialogs/lua_interpreter.cpp - gui/dialogs/message.cpp - gui/dialogs/modal_dialog.cpp - gui/dialogs/modeless_dialog.cpp - gui/dialogs/multiplayer/faction_select.cpp - gui/dialogs/multiplayer/mp_alerts_options.cpp - gui/dialogs/multiplayer/mp_change_control.cpp - gui/dialogs/multiplayer/mp_cmd_wrapper.cpp - gui/dialogs/multiplayer/mp_connect.cpp - gui/dialogs/multiplayer/mp_create_game.cpp - gui/dialogs/multiplayer/mp_host_game_prompt.cpp - gui/dialogs/multiplayer/mp_join_game.cpp - gui/dialogs/multiplayer/mp_join_game_password_prompt.cpp - gui/dialogs/multiplayer/mp_login.cpp - gui/dialogs/multiplayer/mp_method_selection.cpp - gui/dialogs/multiplayer/mp_options_helper.cpp - gui/dialogs/multiplayer/mp_staging.cpp - gui/dialogs/multiplayer/synced_choice_wait.cpp - gui/dialogs/network_transmission.cpp - gui/dialogs/preferences_dialog.cpp - gui/dialogs/screenshot_notification.cpp - gui/dialogs/select_orb_colors.cpp - gui/dialogs/simple_item_selector.cpp - gui/dialogs/sp_options_configure.cpp - gui/dialogs/statistics_dialog.cpp - gui/dialogs/theme_list.cpp - gui/dialogs/tooltip.cpp - gui/dialogs/terrain_layers.cpp - gui/dialogs/title_screen.cpp - gui/dialogs/transient_message.cpp - gui/dialogs/unit_advance.cpp - gui/dialogs/unit_attack.cpp - gui/dialogs/unit_create.cpp - gui/dialogs/unit_list.cpp - gui/dialogs/unit_recall.cpp - gui/dialogs/unit_recruit.cpp - gui/dialogs/wml_error.cpp - gui/dialogs/wml_message.cpp - gui/widgets/button.cpp - gui/widgets/chatbox.cpp - gui/widgets/container_base.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/menu_button.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_container.cpp - gui/widgets/scrollbar_panel.cpp - gui/widgets/scrollbar.cpp - gui/widgets/settings.cpp - gui/widgets/size_lock.cpp - gui/widgets/slider.cpp - gui/widgets/spacer.cpp - gui/widgets/stacked_widget.cpp - gui/widgets/styled_widget.cpp - gui/widgets/text_box.cpp - gui/widgets/text_box_base.cpp - gui/widgets/toggle_button.cpp - gui/widgets/toggle_panel.cpp - gui/widgets/tree_view_node.cpp - gui/widgets/tree_view.cpp - gui/widgets/unit_preview_pane.cpp - gui/widgets/vertical_scrollbar.cpp - gui/widgets/viewport.cpp - gui/widgets/widget.cpp - gui/widgets/window.cpp - halo.cpp - help/help_browser.cpp - help/help_button.cpp - help/help_impl.cpp - help/help_menu.cpp - help/help_text_area.cpp - help/help_topic_generators.cpp - help/help.cpp - hotkey/hotkey_handler_mp.cpp - hotkey/hotkey_handler_sp.cpp - hotkey/hotkey_handler.cpp - hotkey/hotkey_preferences_display.cpp - intro.cpp - lobby_preferences.cpp - menu_events.cpp - mouse_events.cpp - mouse_handler_base.cpp - movetype.cpp - mp_game_settings.cpp - mp_ui_alerts.cpp - network_asio.cpp - pathfind/pathfind.cpp - pathfind/teleport.cpp - persist_context.cpp - persist_manager.cpp - persist_var.cpp - play_controller.cpp - playmp_controller.cpp - playsingle_controller.cpp - playturn_network_adapter.cpp - playturn.cpp - random_new_deterministic.cpp - random_new_synced.cpp - random_new.cpp - recall_list_manager.cpp - replay_controller.cpp - replay_helper.cpp - replay_recorder_base.cpp - replay.cpp - resources.cpp - save_blocker.cpp - save_index.cpp - saved_game.cpp - savegame.cpp - scripting/application_lua_kernel.cpp - scripting/debug_lua.cpp - scripting/game_lua_kernel.cpp - scripting/lua_common.cpp - scripting/lua_cpp_function.cpp - scripting/lua_fileops.cpp - scripting/lua_formula_bridge.cpp - scripting/lua_gui2.cpp - scripting/lua_kernel_base.cpp - scripting/lua_map_location_ops.cpp - scripting/lua_preferences.cpp - scripting/lua_race.cpp - scripting/lua_rng.cpp - scripting/lua_team.cpp - scripting/lua_unit.cpp - scripting/lua_unit_attacks.cpp - scripting/lua_unit_type.cpp - scripting/mapgen_lua_kernel.cpp - scripting/plugins/context.cpp - scripting/plugins/manager.cpp - settings.cpp - side_filter.cpp - statistics.cpp - storyscreen/controller.cpp - storyscreen/interface.cpp - storyscreen/part.cpp - storyscreen/render.cpp - strftime.cpp - synced_checkup.cpp - synced_commands.cpp - synced_context.cpp - synced_user_choice.cpp - syncmp_handler.cpp - team.cpp - teambuilder.cpp - terrain/filter.cpp - tod_manager.cpp - units/abilities.cpp - units/animation_component.cpp - units/animation.cpp - units/attack_type.cpp - units/drawer.cpp - units/filter.cpp - units/formula_manager.cpp - units/frame.cpp - units/helper.cpp - units/id.cpp - units/map.cpp - units/race.cpp - units/types.cpp - units/udisplay.cpp - units/unit.cpp - utils/sha1.cpp - utils/context_free_grammar_generator.cpp - utils/markov_generator.cpp - utils/name_generator_factory.cpp - variable_info.cpp - variable.cpp - wesnothd_connection.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/scrollpane.cpp - """) + +wesnoth_sources = GetSources("wesnoth") if env["PLATFORM"] == "win32": wesnoth_sources.append("desktop/windows_tray_notification.cpp") @@ -589,15 +95,35 @@ if env["PLATFORM"] == 'darwin': if env["notifications"]: wesnoth_sources.append("desktop/dbus_notification.cpp") -wesnoth_sources.extend(client_env.Object("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")) +#---lua--- +lua_sources = GetSources("lua") + +env_lua = env.Clone( + # Silence some Clang-specific warnings due to extra parentheses in if statements when comparing. + CCFLAGS = ["$CCFLAGS", "clang" in env["CXX"] and Split("-Wno-parentheses-equality -Wno-pointer-bool-conversion") or [], "strict" in env and Split("-Wno-old-style-cast -Wno-useless-cast") or []], + CCCOM = env["CXXCOM"], + CPPPATH = ["$CPPPATH", Dir(".").srcnode()], + CPPDEFINES = ["$CPPDEFINES", env["PLATFORM"] != "win32" and "LUA_USE_POSIX" or []]) + +if env_lua["build"] == "optimized" and env_lua["enable_lto"] == True: + env_lua["AR"] = 'gcc-ar' + env_lua["RANLIB"] = 'gcc-ranlib' + +env_lua["wesnoth_lua_config"] = File("#/src/wesnoth_lua_config.h").rfile() +env_lua.Append(CCFLAGS = Split("-include $wesnoth_lua_config -Wno-deprecated-declarations")) + +objs_lua = env_lua.Object(lua_sources) +for obj in objs_lua: + env_lua.Depends(obj, env_lua["wesnoth_lua_config"]) + +libwesnoth_extras.extend(env_lua.Library("lua", objs_lua)) # # Target declarations # +#---start valid scons default_targets---# def error_action(target, source, env): from SCons.Errors import UserError @@ -629,116 +155,45 @@ if env["PLATFORM"] == 'darwin': wesnoth_objects.append("macosx/SDLMain.mm") client_env.WesnothProgram("wesnoth", wesnoth_objects, have_client_prereqs) -campaignd_sources = Split(""" - campaign_server/addon_utils.cpp - campaign_server/blacklist.cpp - server/server_base.cpp - server/simple_wml.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, libcampaignd], have_server_prereqs) - -wesnothd_sources = Split(""" - server/ban.cpp - server/forum_user_handler.cpp - server/game.cpp - server/metrics.cpp - server/player.cpp - server/player_connection.cpp - server/player_network.cpp - server/sample_user_handler.cpp - server/server_base.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)) - +#---wesnothd--- +wesnothd_sources = GetSources("wesnothd") env.WesnothProgram("wesnothd", wesnothd_sources + [libwesnoth_core, env["wesnothd_res"]], have_server_prereqs) -cutter_sources = Split(""" - tools/cutter.cpp - """) -client_env.WesnothProgram("cutter", cutter_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnoth], have_client_prereqs, LIBS = ["$LIBS", "png"]) - -exploder_sources = Split(""" - tools/exploder_composer.cpp - tools/exploder.cpp - """) -client_env.WesnothProgram("exploder", exploder_sources + [libcutter, libwesnoth_core, libwesnoth_sdl, libwesnoth], have_client_prereqs, LIBS = ["$LIBS", "png"]) - -schema_generator_sources = Split(""" - tools/schema/error_container.cpp - tools/schema/schema_generator.cpp - tools/schema/sourceparser.cpp - """) -client_env.WesnothProgram("schema_generator", schema_generator_sources + [libwesnoth_core], have_client_prereqs) - -test_utils_sources = Split(""" - tests/utils/fake_display.cpp - tests/utils/fake_event_source.cpp - tests/utils/game_config_manager.cpp - """) - -wesmage_sources = Split(""" - sdl/utils.cpp - sdl/window.cpp - tools/exploder_utils.cpp - tracer.cpp - wesmage/exit.cpp - wesmage/filter.cpp - wesmage/options.cpp - wesmage/wesmage.cpp - """) -client_env.WesnothProgram("wesmage", wesmage_sources + [libwesnoth_core], have_client_prereqs, OBJPREFIX = "wesmage_", LIBS = ["$LIBS", "png"]) +#---campaignd--- +campaignd_sources = GetSources("campaignd") +env.WesnothProgram("campaignd", campaignd_sources + [libwesnoth_core], have_server_prereqs, OBJPREFIX = "campaignd_") -libtest_utils = test_env.Library("test_utils", test_utils_sources) - -test_sources = Split(""" - tests/gui/fire_event.cpp - tests/gui/iterator.cpp - tests/gui/test_gui2.cpp - tests/gui/test_save_dialog.cpp - tests/gui/visitor.cpp - tests/main.cpp - tests/test_addons.cpp - tests/test_commandline_options.cpp - tests/test_config.cpp - tests/test_filesystem.cpp - tests/test_formula_ai.cpp - tests/test_formula_core.cpp - tests/test_formula_function.cpp - tests/test_image_modifications.cpp - tests/test_lexical_cast.cpp - tests/test_make_enum.cpp - tests/test_map_location.cpp - tests/test_mp_connect.cpp - tests/test_recall_list.cpp - tests/test_rng.cpp - tests/test_sdl_utils.cpp - tests/test_serialization.cpp - tests/test_team.cpp - tests/test_unit_map.cpp - tests/test_util.cpp - tests/test_version.cpp - tests/test_whiteboard_side_actions.cpp - tests/utils/play_scenario.cpp - """) -test_sources.extend(test_env.Object("tests/test_config_cache.cpp")) - -test = test_env.WesnothProgram("test", test_sources + [libtest_utils, libwesnoth_extras, libwesnoth_core, libwesnoth, libwesnoth_sdl, libwesnoth_extras], have_test_prereqs) - -create_images_sources = Split(""" - sdl/utils.cpp - sdl/window.cpp - tests/create_images.cpp - tools/exploder_utils.cpp - tracer.cpp -""") +#---cutter--- +cutter_sources = GetSources("cutter") +client_env.WesnothProgram("cutter", cutter_sources + [libwesnoth_core, libwesnoth_sdl, libwesnoth], have_client_prereqs, OBJPREFIX = "cutter_", LIBS = ["$LIBS", "png"]) + +#---exploder--- +exploder_sources = GetSources("exploder") +client_env.WesnothProgram("exploder", exploder_sources + [libwesnoth_core, libwesnoth_sdl, libwesnoth], have_client_prereqs, OBJPREFIX = "exploder_", LIBS = ["$LIBS", "png"]) + +#---test--- +test_sources = GetSources("test") +test = test_env.WesnothProgram("test", test_sources + [libwesnoth_extras, libwesnoth_core, libwesnoth, libwesnoth_sdl, libwesnoth_extras], have_test_prereqs) +#---end valid scons default_targets---# + +#---start invalid scons default_targets---# +#---schema_generator--- +schema_generator_sources = GetSources("schema_generator") +client_env.WesnothProgram("schema_generator", schema_generator_sources + [libwesnoth_core], have_client_prereqs, OBJPREFIX = "schema_generator_") + +#---schema_validator--- +schema_validator_sources = GetSources("schema_validator") +client_env.WesnothProgram("schema_validator", schema_validator_sources + [libwesnoth_core], have_client_prereqs, OBJPREFIX = "schema_validator_") + +#---wesmage--- +wesmage_sources = GetSources("wesmage") +client_env.WesnothProgram("wesmage", wesmage_sources + [libwesnoth_core], have_client_prereqs, OBJPREFIX = "wesmage_", LIBS = ["$LIBS", "png"]) +#---create_images--- +create_images_sources = GetSources("create_images") env.WesnothProgram("create_images", create_images_sources + [libwesnoth_core], have_server_prereqs, OBJPREFIX = "create_images_", LIBS = ["$LIBS", "png"]) +#---end invalid scons default_targets---# +#---end of getting sources--- if env.get("have_autorevision"): game_config_env.Append(CPPDEFINES = 'LOAD_REVISION') diff --git a/src/lua/SConscript b/src/lua/SConscript deleted file mode 100644 index 688e20b6b197..000000000000 --- a/src/lua/SConscript +++ /dev/null @@ -1,61 +0,0 @@ -# vi: syntax=python:et:ts=4 -Import("env") -lua_sources = Split(""" -../lua_jailbreak_exception.cpp -lapi.cpp -lbitlib.cpp -lcode.cpp -lcorolib.cpp -lctype.cpp -ldebug.cpp -ldo.cpp -ldump.cpp -lfunc.cpp -lgc.cpp -llex.cpp -lmem.cpp -lobject.cpp -lopcodes.cpp -lparser.cpp -lstate.cpp -lstring.cpp -ltable.cpp -ltm.cpp -lundump.cpp -lvm.cpp -lzio.cpp -lauxlib.cpp -lbaselib.cpp -ldblib.cpp -liolib.cpp -lmathlib.cpp -loslib.cpp -ltablib.cpp -lstrlib.cpp -loadlib.cpp -lutf8lib.cpp -""") -env_lua = env.Clone( - # Silence some Clang-specific warnings due to extra parentheses in if statements when comparing. - CCFLAGS = ["$CCFLAGS", "clang" in env["CXX"] and Split("-Wno-parentheses-equality -Wno-pointer-bool-conversion") or [], "strict" in env and Split("-Wno-old-style-cast -Wno-useless-cast") or []], - CCCOM = env["CXXCOM"], - CPPPATH = ["$CPPPATH", Dir(".").srcnode()], - CPPDEFINES = ["$CPPDEFINES", env["PLATFORM"] != "win32" and "LUA_USE_POSIX" or []]) - -if env_lua["build"] == "optimized" and env_lua["enable_lto"] == True: - env_lua["AR"] = 'gcc-ar' - env_lua["RANLIB"] = 'gcc-ranlib' - -#if env['strict']: -# env.AppendUnique(CCFLAGS = Split("-Wno-old-style-cast -Wno-useless-cast")) - -env_lua["wesnoth_lua_config"] = File("#/src/wesnoth_lua_config.h").rfile() -env_lua.Append(CCFLAGS = Split("-include $wesnoth_lua_config -Wno-deprecated-declarations")) - -objs_lua = env_lua.Object(lua_sources) -for obj in objs_lua: - env_lua.Depends(obj, env_lua["wesnoth_lua_config"]) - -liblua = env_lua.Library("lua", objs_lua) - -Return("liblua")