aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-01-27 12:03:58 +0000
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-08-16 21:19:11 +0100
commit2b43c45b13ad00cfd9928a03da8a480977724cb1 (patch)
treea42fde8b29b622084ab00a1ea8d63fc50ea268c8 /cmake
parent973a3b0c5dcbf6b3fd155b2dda4c2e94a0b0ee5f (diff)
cmake: Add `AddWindowsResources` module
Diffstat (limited to 'cmake')
-rw-r--r--cmake/module/AddWindowsResources.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmake/module/AddWindowsResources.cmake b/cmake/module/AddWindowsResources.cmake
new file mode 100644
index 0000000000..a9b4f51f73
--- /dev/null
+++ b/cmake/module/AddWindowsResources.cmake
@@ -0,0 +1,14 @@
+# 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)
+
+macro(add_windows_resources target rc_file)
+ if(WIN32)
+ target_sources(${target} PRIVATE ${rc_file})
+ set_property(SOURCE ${rc_file}
+ APPEND PROPERTY COMPILE_DEFINITIONS WINDRES_PREPROC
+ )
+ endif()
+endmacro()