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 + + +