Files
bitcoin/cmake/module/AddWindowsResources.cmake
Daniel Pfeifer 654a4cf5e6 cmake: Use builtin support for .manifest files
CMake ignores .rc and .manifest files when not building for WIN32.
2026-08-10 16:16:07 +02:00

29 lines
1.0 KiB
CMake

# Copyright (c) 2024-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
include_guard(GLOBAL)
function(add_windows_resources target rc_file)
if(WIN32)
target_sources(${target} PRIVATE ${rc_file})
endif()
endfunction()
# Add a fusion manifest to Windows executables.
# See: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
function(add_windows_application_manifest target)
configure_file(${PROJECT_SOURCE_DIR}/cmake/windows-app.manifest.in ${target}.manifest USE_SOURCE_PERMISSIONS)
if(MSVC)
target_sources(${target} PRIVATE ${target}.manifest)
else()
# TODO: Remove when upstream issue is fixed:
# https://gitlab.kitware.com/cmake/cmake/-/issues/23244
file(CONFIGURE
OUTPUT ${target}-manifest.rc
CONTENT "1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ \"${target}.manifest\""
)
target_sources(${target} PRIVATE ${target}-manifest.rc)
endif()
endfunction()