From ef0e725564167b4751853df2a2676e2f33f65882 Mon Sep 17 00:00:00 2001 From: Yaraslau Tamashevich Date: Tue, 18 Aug 2026 11:19:19 +0300 Subject: [PATCH] cmake: fix windows-everything configure failures Three gaps surfaced when actually configuring windows-everything on a real Windows machine (no CI leg has ever exercised this option combination): - MORPH_BUILD_HMAC_EXAMPLE_LIBSODIUM (defaults ON under MORPH_BUILD_HMAC_EXAMPLES) needs PkgConfig + a libsodium pkg-config file, neither available via this toolchain. Turn it off explicitly; the OpenSSL adapter stays on. - MORPH_BUILD_HMAC_EXAMPLE_OPENSSL and MORPH_BUILD_OFFLINE_SQLITE need OpenSSL and SQLite3 respectively, neither listed in vcpkg.json. Add both as vcpkg dependencies. - examples/bank/CMakeLists.txt's own Lightweight FetchContent fetch was missing the CMAKE_SKIP_INSTALL_RULES guard that examples/common/CMakeLists.txt already carries for the same problem: Lightweight's install() rules reference $, which CMake rejects for a static build (LIGHTWEIGHT_BUILD_SHARED=OFF) at generate time. This was never hit before because no existing preset turned on MORPH_BUILD_BANK_EXAMPLE and MORPH_BUILD_LADDER together on Windows. Verified: windows-everything now configures cleanly end to end (cmake --preset windows-everything). Co-Authored-By: Claude Sonnet 5 --- CMakePresets.json | 1 + examples/bank/CMakeLists.txt | 15 +++++++++++++++ vcpkg.json | 4 +++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 132046bd..7fb70c77 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -104,6 +104,7 @@ "MORPH_BUILD_BANK_EXAMPLE": "ON", "MORPH_BUILD_BANK_GUI": "ON", "MORPH_BUILD_HMAC_EXAMPLES": "ON", + "MORPH_BUILD_HMAC_EXAMPLE_LIBSODIUM": "OFF", "MORPH_BUILD_FORMS_QML": "ON", "MORPH_BUILD_QT": "ON", "MORPH_BUILD_LADDER": "ON", diff --git a/examples/bank/CMakeLists.txt b/examples/bank/CMakeLists.txt index 8bd6798e..b90c8fe5 100644 --- a/examples/bank/CMakeLists.txt +++ b/examples/bank/CMakeLists.txt @@ -43,7 +43,22 @@ FetchContent_Declare(Lightweight GIT_TAG v0.20260625.0 GIT_SHALLOW TRUE ) +# Lightweight's own install() rules unconditionally reference +# $ on WIN32 (its CMakeLists.txt), which CMake +# only allows for linker-created artifacts (DLL/EXE) -- invalid whenever +# Lightweight resolves to a static build (LIGHTWEIGHT_BUILD_SHARED=OFF, +# forced by examples/common/CMakeLists.txt when it fetches Lightweight +# first in the same configure), and it fails at generate time even though +# nothing in this tree ever runs `cmake --install`. Skipping install-rule +# generation for just this FetchContent_MakeAvailable call sidesteps the +# bad generator expression without touching Lightweight's vendored +# CMakeLists.txt -- same fix as examples/common/CMakeLists.txt's own +# Lightweight fetch. +set(_morph_saved_skip_install_rules ${CMAKE_SKIP_INSTALL_RULES}) +set(CMAKE_SKIP_INSTALL_RULES ON) FetchContent_MakeAvailable(Lightweight) +set(CMAKE_SKIP_INSTALL_RULES ${_morph_saved_skip_install_rules}) +unset(_morph_saved_skip_install_rules) # ── Bank domain library ────────────────────────────────────────────────────── add_library(bank_lib STATIC diff --git a/vcpkg.json b/vcpkg.json index bf08b156..ff6c3730 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -6,7 +6,9 @@ "glaze", "catch2", "yaml-cpp", - "libzip" + "libzip", + "openssl", + "sqlite3" ], "builtin-baseline": "c3867e714dd3a51c272826eea77267876517ed99" }