From cd10e02862702dfa54c613ccd2676a4295fcee08 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 4 Jul 2021 19:30:06 +1000 Subject: [PATCH] Revert "[host] avoid manual windres command" This reverts commit d82f2e510d4910be7455e1497a7917a6d2d64f97. While the proposed change is more correct, it breaks the generation of the file due to failure to locate the resource files, such as `resources/icon.ico`. --- host/platform/Windows/CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/host/platform/Windows/CMakeLists.txt b/host/platform/Windows/CMakeLists.txt index fb0b2710..71bcfa3d 100644 --- a/host/platform/Windows/CMakeLists.txt +++ b/host/platform/Windows/CMakeLists.txt @@ -10,7 +10,6 @@ add_library(platform_Windows STATIC src/service.c src/mousehook.c src/force_compose.c - resource.rc ) # allow use of functions for Windows Vista or later @@ -18,7 +17,15 @@ add_definitions(-D _WIN32_WINNT=0x6000) add_subdirectory("capture") +FIND_PROGRAM(WINDRES_EXECUTABLE NAMES "x86_64-w64-mingw32-windres" "windres.exe" DOC "windres executable") +ADD_CUSTOM_COMMAND(TARGET platform_Windows POST_BUILD + WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" + COMMAND ${WINDRES_EXECUTABLE} -i resource.rc -o "${PROJECT_BINARY_DIR}/resource.o" + VERBATIM +) + target_link_libraries(platform_Windows + "${PROJECT_BINARY_DIR}/resource.o" lg_common capture