mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-06 16:18:35 +01:00
Merge the track layout editor into cpp20-modules, ported to modules
The editor branch was written against headers and the PCH, both of which this
branch has done away with, so its own files were ported rather than merged: the
five headers it added are now interface units and their .cpp files module
implementation units.
- editor/{puwg1992,polandmap,turnouts,orthophoto} become eu07.editor.* modules,
application/planpanel becomes eu07.application.planpanel. The plan tool keeps
to its own module rather than joining the eu07.simcore partitions: it stands on
the editor's libraries and eu07.application.uilayer, not on the simulation core,
so :editoruilayer can export import it without a cycle.
- glm arrives by import eu07.glm, never by include, as the rest of the tree does.
maj0sted is header-only and glm-free, so its headers stay includes in the global
module fragment - every unit that names those types includes them itself, since
a global fragment is not visible across units.
- the one textual conflict was :editoruilayer's include block against this
branch's imports; resolved this branch's way plus the planpanel import.
Builds with clang 22 (-DWITH_BETTER_RENDERER=OFF) and starts into the editor on
empty ground with -editor alone.
This commit is contained in:
@@ -195,12 +195,17 @@ set(SOURCES
|
||||
"application/driveruipanels.cpp"
|
||||
"input/editorkeyboardinput.cpp"
|
||||
"editor/editorSettings.cpp"
|
||||
"editor/puwg1992.cpp"
|
||||
"editor/polandmap.cpp"
|
||||
"editor/turnouts.cpp"
|
||||
"editor/orthophoto.cpp"
|
||||
"editor/editorTerrain.cpp"
|
||||
"editor/editorTerrainStreamer.cpp"
|
||||
"application/editormode.cpp"
|
||||
"input/editormouseinput.cpp"
|
||||
"application/editoruilayer.cpp"
|
||||
"application/editoruipanels.cpp"
|
||||
"application/planpanel.cpp"
|
||||
"application/scenarioloadermode.cpp"
|
||||
"application/scenarioloaderuilayer.cpp"
|
||||
"scene/scenenodegroups.cpp"
|
||||
@@ -612,6 +617,13 @@ endif()
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} Threads::Threads)
|
||||
|
||||
# the editor's map imagery talks to a WMS over https. windows has WinHttp in the platform sdk;
|
||||
# everywhere else libcurl is the transport (see editor/orthophoto.cpp)
|
||||
if (NOT WIN32)
|
||||
find_package(CURL REQUIRED)
|
||||
target_link_libraries(${PROJECT_NAME} CURL::libcurl)
|
||||
endif()
|
||||
|
||||
find_package(GLM REQUIRED)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE ${GLM_INCLUDE_DIR})
|
||||
|
||||
@@ -620,6 +632,11 @@ add_subdirectory(ref/json)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
if (WITH_DISCORD_RPC)
|
||||
|
||||
Reference in New Issue
Block a user