From 4c89f37fd86f522312221228bdbaafe10a249baf Mon Sep 17 00:00:00 2001 From: ispyisail Date: Fri, 2 Oct 2026 22:25:46 +1300 Subject: [PATCH] Windows: embed a manifest that declares longPathAware With LongPathsEnabled set in the registry, Windows lets a program open paths of 260 characters or more only if its manifest says longPathAware. QElectroTech.exe so far carried the toolchain's default manifest. This one repeats what the default declares (supported Windows versions, asInvoker) and adds longPathAware. MSVC takes the .manifest as a source; MinGW gets it through a small resource file. Follow-up to #1178 (symbols in deep folders). Co-Authored-By: Claude Opus 5.5 --- CMakeLists.txt | 12 +++++++ build-aux/windows/qelectrotech-manifest.rc.in | 4 +++ build-aux/windows/qelectrotech.exe.manifest | 35 +++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 build-aux/windows/qelectrotech-manifest.rc.in create mode 100644 build-aux/windows/qelectrotech.exe.manifest diff --git a/CMakeLists.txt b/CMakeLists.txt index 120f53a40..4e736c6a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,6 +159,18 @@ if(WIN32) ${QET_DIR}/qelectrotech.qrc ${QET_DIR}/ico/icon-themes.qrc ) + # Our own manifest (it declares longPathAware). MSVC merges a .manifest + # listed as a source; MinGW needs it embedded through a resource file, + # and ld then keeps it ahead of the toolchain's default manifest. + set(QET_MANIFEST_FILE ${QET_DIR}/build-aux/windows/qelectrotech.exe.manifest) + if(MSVC) + target_sources(${PROJECT_NAME} PRIVATE ${QET_MANIFEST_FILE}) + else() + configure_file(${QET_DIR}/build-aux/windows/qelectrotech-manifest.rc.in + ${CMAKE_CURRENT_BINARY_DIR}/qelectrotech-manifest.rc @ONLY) + target_sources(${PROJECT_NAME} PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/qelectrotech-manifest.rc) + endif() else() add_executable( ${PROJECT_NAME} diff --git a/build-aux/windows/qelectrotech-manifest.rc.in b/build-aux/windows/qelectrotech-manifest.rc.in new file mode 100644 index 000000000..54304e875 --- /dev/null +++ b/build-aux/windows/qelectrotech-manifest.rc.in @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// Embeds qelectrotech.exe.manifest as the program's manifest +// (resource id 1 = CREATEPROCESS_MANIFEST_RESOURCE_ID, type 24 = RT_MANIFEST). +1 24 "@QET_MANIFEST_FILE@" diff --git a/build-aux/windows/qelectrotech.exe.manifest b/build-aux/windows/qelectrotech.exe.manifest new file mode 100644 index 000000000..1aa9ef544 --- /dev/null +++ b/build-aux/windows/qelectrotech.exe.manifest @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + true + + +