From 7cb8112984172d1886d6bd7b12f0afffd1fa7229 Mon Sep 17 00:00:00 2001 From: Zapeth Date: Sun, 25 Aug 2019 18:28:54 +0200 Subject: [PATCH 1/2] Fix MinGW resource file compilation issues --- src/libui_sdl/CMakeLists.txt | 4 ++++ src/libui_sdl/libui/windows/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index 63e9f484..b5d29d8d 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -14,6 +14,10 @@ SET(SOURCES_LIBUI OSD.cpp ) +if (WIN32) + set(CMAKE_RC_COMPILE_OBJECT " -i -o ") +endif() + option(BUILD_SHARED_LIBS "Whether to build libui as a shared library or a static library" ON) set(BUILD_SHARED_LIBS OFF) add_subdirectory(libui) diff --git a/src/libui_sdl/libui/windows/CMakeLists.txt b/src/libui_sdl/libui/windows/CMakeLists.txt index 9d5313ae..24d4ad96 100644 --- a/src/libui_sdl/libui/windows/CMakeLists.txt +++ b/src/libui_sdl/libui/windows/CMakeLists.txt @@ -73,7 +73,7 @@ macro(_handle_static) add_custom_command( TARGET libui POST_BUILD COMMAND - ${CMAKE_COMMAND} -E copy $/CMakeFiles/libui.dir/windows/resources.rc.* ${_LIBUI_STATIC_RES} + ${CMAKE_COMMAND} -E copy $/CMakeFiles/libui.dir/windows/resources.rc.obj ${_LIBUI_STATIC_RES} COMMENT "Copying libui.res") endmacro() From 96d5d3f4c8ebdb887da49998522e37c329f1115f Mon Sep 17 00:00:00 2001 From: Zapeth Date: Wed, 28 Aug 2019 22:24:54 +0200 Subject: [PATCH 2/2] Fix glib-compile-resources path issues Apparently double quotes are not stripped away for assigned arguments when parsing, which causes isses for paths that include spaces. --- src/libui_sdl/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libui_sdl/CMakeLists.txt b/src/libui_sdl/CMakeLists.txt index b5d29d8d..64206bf2 100644 --- a/src/libui_sdl/CMakeLists.txt +++ b/src/libui_sdl/CMakeLists.txt @@ -43,11 +43,11 @@ if (UNIX) ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER}) add_custom_command(OUTPUT melon_grc.c - COMMAND glib-compile-resources --sourcedir="${CMAKE_SOURCE_DIR}" - --target="${CMAKE_CURRENT_BINARY_DIR}/melon_grc.c" + COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR} + --target=${CMAKE_CURRENT_BINARY_DIR}/melon_grc.c --generate-source "${CMAKE_SOURCE_DIR}/melon_grc.xml" - COMMAND glib-compile-resources --sourcedir="${CMAKE_SOURCE_DIR}" - --target="${CMAKE_CURRENT_BINARY_DIR}/melon_grc.h" + COMMAND glib-compile-resources --sourcedir=${CMAKE_SOURCE_DIR} + --target=${CMAKE_CURRENT_BINARY_DIR}/melon_grc.h --generate-header "${CMAKE_SOURCE_DIR}/melon_grc.xml") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")