17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-07 00:22:56 +01:00

Editor: fold the plan library into the tree as modules, drop its own name

The track layout library came in as a subproject of its own -- its own
CMakeLists, its own install and export rules, its own include tree -- which only
made the build harder to follow now that everything else is a module. It is part
of the editor, so it lives where the editor lives.

- editor/plan_*.cppm / plan_*.cpp: the fifteen interface units and twelve
  implementation units, flat in editor/ beside editorTerrain and orthophoto, with
  the plan_ prefix keeping them clear of what was already there (editor/turnouts
  is the preset catalogue, so the geometry is plan_turnout_geometry).
- modules are named eu07.editor.plan_*, like every other module in the tree.
- namespaces move under the editor's own: editor::plan, editor::plan::geometry,
  ::io, ::render. The library's old name is gone from the sources and the docs.
- every moved file carries the MPL header the rest of the tree carries; it had
  none. version.hpp went with the subproject: macros only, and unused.
- the umbrella header is dropped -- nothing imported it.
- the unit tests survive the fold: editor/tests, behind EU07_EDITOR_PLAN_TESTS
  (off by default), compiles the interfaces a second time into a small library of
  its own, because a test can only import modules from a target it links and
  linking the game would drag the whole simulator in. The code under test needs
  nothing but a compiler. 7/7 pass.
- a switch may now be written with two dashes as well: --editor beside -editor.

Builds with clang 22 (-DWITH_BETTER_RENDERER=OFF); -editor and --editor both come
up in the editor on empty ground.
This commit is contained in:
maj00r
2026-09-13 13:31:01 +02:00
parent c15e200e37
commit 321c9dd7ab
56 changed files with 931 additions and 952 deletions

View File

@@ -199,6 +199,18 @@ set(SOURCES
"editor/polandmap.cpp"
"editor/turnouts.cpp"
"editor/orthophoto.cpp"
"editor/plan_chain.cpp"
"editor/plan_document_io.cpp"
"editor/plan_join.cpp"
"editor/plan_layout.cpp"
"editor/plan_model.cpp"
"editor/plan_rail_renderer.cpp"
"editor/plan_render.cpp"
"editor/plan_scn_export.cpp"
"editor/plan_sketch.cpp"
"editor/plan_solution.cpp"
"editor/plan_tilecache.cpp"
"editor/plan_turnout_geometry.cpp"
"editor/editorTerrain.cpp"
"editor/editorTerrainStreamer.cpp"
"application/editormode.cpp"
@@ -633,9 +645,6 @@ target_link_libraries(${PROJECT_NAME} nlohmann_json::nlohmann_json)
target_include_directories(${PROJECT_NAME} PRIVATE ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR})
# track layout domain model used by the editor; plain C++20, no dependencies of its own
add_subdirectory(maj0sted)
set_target_properties(maj0sted PROPERTIES FOLDER "libraries")
target_link_libraries(${PROJECT_NAME} maj0sted::maj0sted)
@@ -716,6 +725,8 @@ endif()
# copied off it rather than restated; this has to happen after all the
# third-party wiring above and before betterRenderer is added, or the mirrored
# link list would point back at betterRenderer and make the dependency circular.
add_subdirectory(editor/tests)
add_library(eu07_modules STATIC)
get_target_property(EU07_INCLUDES ${PROJECT_NAME} INCLUDE_DIRECTORIES)