From 30765094001723ef733ccf4665ad21377445a625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc=20Serf=C5=91z=C5=91?= Date: Fri, 14 Jun 2024 15:57:34 +0200 Subject: [PATCH] fix(CI): Fix Windows CI build --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 12 ++++++++++-- src/main.cpp | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aebc739..a3e70cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: build-windows: runs-on: windows-latest env: - vcpkg-prereqs: nlohmann-json:x64-windows spdlog:x64-windows sdl2:x64-windows freetype[core]:x64-windows zlib:x64-windows + vcpkg-prereqs: nlohmann-json:x64-windows spdlog:x64-windows sdl2:x64-windows freetype[core]:x64-windows zlib:x64-windows gettext:x64-windows steps: - uses: actions/checkout@v4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 55b4d7b..f293b94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,12 @@ if(NOT WIN32 AND MC_CHECK_FOR_UPDATES) find_package(CURL REQUIRED) endif() find_package(Intl REQUIRED) +if (NOT TARGET Intl::Intl) + add_library(Intl UNKNOWN IMPORTED) + target_include_directories(Intl PUBLIC "${Intl_INCLUDE_DIRS}") + target_link_libraries(Intl PUBLIC "${Intl_LIBRARIES}") + add_library(Intl::Intl ALIAS Intl) +endif() set(MC_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALEDIR}") configure_file( @@ -96,7 +102,7 @@ target_include_directories(midiconn PRIVATE external/portable-file-dialogs external/IconFontCppHeaders "${FREETYPE_INCLUDE_DIRS}" - "${Intl_INCLUDE_DIRS}") +) target_link_libraries(midiconn PRIVATE nlohmann_json::nlohmann_json rtmidi @@ -107,7 +113,8 @@ target_link_libraries(midiconn PRIVATE freetype resources midi - "${Intl_LIBRARIES}") + Intl::Intl +) if(NOT WIN32 AND MC_CHECK_FOR_UPDATES) target_link_libraries(midiconn PRIVATE curl) endif() @@ -173,6 +180,7 @@ if (XGETTEXT AND ${GETTEXT_FOUND}) WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" DEPENDS ${sources} ) + add_custom_target(update-pot DEPENDS "${POT_FILE}") file(GLOB PO_FILES "${PROJECT_SOURCE_DIR}/po/*.po") if(PO_FILES) diff --git a/src/main.cpp b/src/main.cpp index dbaaf00..9f2e527 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,8 @@ #include "Utils.hpp" #include "Version.hpp" +#include "libintl.h" + #if !SDL_VERSION_ATLEAST(2, 0, 17) #error This backend requires SDL 2.0.17+ because of SDL_RenderGeometry() function #endif