From 5e68b4632229aecfe188c79bbab3f86751f09aa0 Mon Sep 17 00:00:00 2001 From: Dalton Messmer Date: Thu, 23 May 2024 13:21:57 -0400 Subject: [PATCH] Update MinGW CI to Ubuntu 20.04 (#7259) Update MinGW CI to Ubuntu 20.04 * Use ghcr.io/lmms/linux.mingw:20.04 * Fix deprecation in ClipView.cpp * Fix ccache and simplify git configuration * Apply patch by @DomClark for MinGW's SDL2 target * Update excludelist-win --- .github/workflows/build.yml | 12 ++++-------- cmake/install/excludelist-win | 4 ++++ cmake/modules/FindSDL2.cmake | 12 ++++++++++++ src/gui/clips/ClipView.cpp | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3697f8cf26..3ec25cd2bef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,7 +153,7 @@ jobs: arch: ['32', '64'] name: mingw${{ matrix.arch }} runs-on: ubuntu-latest - container: lmmsci/linux.mingw${{ matrix.arch }}:18.04 + container: ghcr.io/lmms/linux.mingw:20.04 env: CMAKE_OPTS: >- -DUSE_WERROR=ON @@ -163,12 +163,8 @@ jobs: CCACHE_NOCOMPRESS: 1 MAKEFLAGS: -j2 steps: - - name: Update and configure Git - run: | - add-apt-repository ppa:git-core/ppa - apt-get update - apt-get --yes install git - git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Configure git + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Check out uses: actions/checkout@v3 with: @@ -201,7 +197,7 @@ jobs: run: | ccache --cleanup echo "[ccache config]" - ccache --print-config + ccache --show-config echo "[ccache stats]" ccache --show-stats env: diff --git a/cmake/install/excludelist-win b/cmake/install/excludelist-win index 17793a113d9..ac3c479019e 100644 --- a/cmake/install/excludelist-win +++ b/cmake/install/excludelist-win @@ -3,17 +3,21 @@ ADVAPI32.dll COMCTL32.dll comdlg32.dll +d3d11.dll dwmapi.dll +dxgi.dll GDI32.dll IMM32.dll KERNEL32.dll MPR.DLL msvcrt.dll +netapi32.dll ole32.dll OLEAUT32.dll OPENGL32.DLL SHELL32.dll USER32.dll +userenv.dll UxTheme.dll VERSION.dll WINMM.DLL diff --git a/cmake/modules/FindSDL2.cmake b/cmake/modules/FindSDL2.cmake index 3bad1002ead..6e07f7affc2 100644 --- a/cmake/modules/FindSDL2.cmake +++ b/cmake/modules/FindSDL2.cmake @@ -33,6 +33,18 @@ find_package(SDL2 CONFIG QUIET) if(TARGET SDL2::SDL2) + # SDL2::SDL2 under MinGW is an interface target for reasons, so we can't get + # the library location from it. Print minimal information and return early. + get_target_property(sdl2_target_type SDL2::SDL2 TYPE) + if(sdl2_target_type STREQUAL "INTERFACE_LIBRARY") + unset(sdl2_target_type) + if(NOT SDL2_FIND_QUIETLY) + message(STATUS "Found SDL2 (found version \"${SDL2_VERSION}\")") + endif() + return() + endif() + unset(sdl2_target_type) + # Extract details for find_package_handle_standard_args get_target_property(SDL2_LIBRARY SDL2::SDL2 LOCATION) get_target_property(SDL2_INCLUDE_DIR SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 5c8a12b91e3..a0f7f7c53c6 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -356,7 +356,7 @@ void ClipView::selectColor() // Get a color from the user const auto newColor = ColorChooser{this} .withPalette(ColorChooser::Palette::Track) - ->getColor(m_clip->color().value_or(palette().background().color())); + ->getColor(m_clip->color().value_or(palette().window().color())); if (newColor.isValid()) { setColor(newColor); } }