From def1a170dcada01bc1068cb8812398a293bc80ae Mon Sep 17 00:00:00 2001 From: omigamedev Date: Tue, 2 Jun 2026 21:27:46 +0200 Subject: [PATCH] Split Windows app shell target --- CMakeLists.txt | 23 ++++++++++++++++++++--- cmake/PanoPainterSources.cmake | 6 ++++-- docs/modernization/build-inventory.md | 2 +- docs/modernization/roadmap.md | 9 ++++++--- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5cbe9f..87d721e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,14 +258,32 @@ if(PP_BUILD_APP) set_source_files_properties(src/version.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + add_library(panopainter_app INTERFACE) + target_link_libraries(panopainter_app + INTERFACE + pp_legacy_app) + + add_library(pp_platform_windows OBJECT + ${PP_WINDOWS_PLATFORM_SOURCES}) + target_link_libraries(pp_platform_windows + PUBLIC + panopainter_app + PRIVATE + pp_project_options + pp_project_warnings) + target_precompile_headers(pp_platform_windows REUSE_FROM pp_legacy_app) + set_target_properties(pp_platform_windows PROPERTIES + VS_GLOBAL_CharacterSet "Unicode") + add_executable(PanoPainter WIN32 - ${PP_WINDOWS_APP_SOURCES}) + ${PP_WINDOWS_APP_SOURCES} + $) target_link_libraries(PanoPainter PRIVATE pp_project_options pp_project_warnings - pp_legacy_app + pp_platform_windows "${CMAKE_CURRENT_SOURCE_DIR}/libs/bugtrap-client/lib/BugTrapU-x64.lib" "$<$:${CMAKE_CURRENT_SOURCE_DIR}/libs/curl-win/lib/dll-debug-x64/libcurl_debug.lib>" "$<$>:${CMAKE_CURRENT_SOURCE_DIR}/libs/curl-win/lib/dll-release-x64/libcurl.lib>" @@ -282,7 +300,6 @@ if(PP_BUILD_APP) user32 wbemuuid) - target_precompile_headers(PanoPainter REUSE_FROM pp_legacy_app) set_target_properties(PanoPainter PROPERTIES VS_GLOBAL_CharacterSet "Unicode") diff --git a/cmake/PanoPainterSources.cmake b/cmake/PanoPainterSources.cmake index 026f46b..15486a2 100644 --- a/cmake/PanoPainterSources.cmake +++ b/cmake/PanoPainterSources.cmake @@ -81,8 +81,11 @@ set(PP_LEGACY_APP_SOURCES src/wacom.cpp ) -set(PP_WINDOWS_APP_SOURCES +set(PP_WINDOWS_PLATFORM_SOURCES src/main.cpp +) + +set(PP_WINDOWS_APP_SOURCES PanoPainter.rc ) @@ -140,4 +143,3 @@ set(PP_LEGACY_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/libs/wacom" "${CMAKE_CURRENT_SOURCE_DIR}/libs/yoga" ) - diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index 2753d6f..270570e 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -10,7 +10,7 @@ Keep it updated as platform paths move to shared CMake targets. | Platform/Target | Current Entrypoint | Notes | | --- | --- | --- | -| Windows desktop | Root `CMakeLists.txt`, preset `windows-msvc-default`; target preset `windows-vs2026-x64` retained for VS 2026 | Raw `.sln/.vcxproj` files removed on 2026-05-31; local machine currently uses Visual Studio 17 2022 | +| Windows desktop | Root `CMakeLists.txt`, preset `windows-msvc-default`; target preset `windows-vs2026-x64` retained for VS 2026 | Raw `.sln/.vcxproj` files removed on 2026-05-31; local machine currently uses Visual Studio 17 2022; `PanoPainter` now links through `pp_platform_windows` and `panopainter_app` | | Windows AppX | `PanoPainterPackage/Package.appxmanifest`, `.wapproj` referenced by solution | Distribution packaging | | macOS | `PanoPainter-OSX/` project files and `Info.plist` | Uses `NSOpenGLView` today | | iOS | `PanoPainter/Info.plist`, related Apple sources | Uses OpenGL ES today | diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 3a3732c..db0dc93 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -142,9 +142,12 @@ Goal: make CMake the canonical source list without breaking existing projects. Status: in progress. Root `CMakeLists.txt`, `CMakePresets.json`, and project option targets exist. The Windows desktop app builds through CMake as `PanoPainter`; the raw Visual Studio solution/project files were removed on -2026-05-31 by user decision. Android arm64 now configures and builds headless -foundation/tool targets through the root CMake/NDK path. Non-Windows platform -app/package files remain during Phase 6 alignment. +2026-05-31 by user decision. The root CMake Windows app graph now includes a +`panopainter_app` composition target and `pp_platform_windows` shell target so +`PanoPainter` is only the executable/resource wrapper. Android arm64 now +configures and builds headless foundation/tool targets through the root +CMake/NDK path. Non-Windows platform app/package files remain during Phase 6 +alignment. Implementation tasks: