From 6c5b5612c2cdebf1306e9918eb3261a98f59a44c Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 30 Aug 2022 09:10:28 +0900 Subject: [PATCH] CMake: Fix MinGW pkgconfig `PKG_CONFIG_EXECUTABLE` must be a cache variable, otherwise only the first call to `find_program(PkgConfig)` succeeds. Also bumps the CI environment to Ubuntu 22.04, because Ubuntu 20.04 version of mingw pkgconfig is bugged. --- .github/workflows/Windows_MinGW_x64.yml | 12 ++++++------ .github/workflows/Windows_MinGW_x86.yml | 2 +- CMake/platforms/mingwcc.toolchain.cmake | 2 +- CMake/platforms/mingwcc64.toolchain.cmake | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/Windows_MinGW_x64.yml b/.github/workflows/Windows_MinGW_x64.yml index 91c4b9d50..29a241150 100644 --- a/.github/workflows/Windows_MinGW_x64.yml +++ b/.github/workflows/Windows_MinGW_x64.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -39,7 +39,7 @@ jobs: with: name: devilutionx_x64.zip path: build/devilutionx.zip - + - name: Move artifacts to new folder and split exe and other data into two folders if: ${{ !env.ACT && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'diasurgical/devilutionX'}} working-directory: ${{github.workspace}} @@ -54,11 +54,11 @@ jobs: with: source-directory: artifacts_dir/exe_dir destination-github-username: 'artifacts-storage' - destination-repository-name: 'devilutionx-artifacts' + destination-repository-name: 'devilutionx-artifacts' target-directory: ${{ github.sha }} commit-message: "[EXE] ${{ github.event.head_commit.message }}" target-branch: master - + - name: Pushes DLLs and devilutionx.mpq to another repository if: ${{ !env.ACT && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'diasurgical/devilutionX' }} uses: cpina/github-action-push-to-another-repository@main @@ -67,7 +67,7 @@ jobs: with: source-directory: artifacts_dir/devilutionx/ destination-github-username: 'artifacts-storage' - destination-repository-name: 'devilutionx-artifacts' + destination-repository-name: 'devilutionx-artifacts' target-directory: data commit-message: "[DATA] ${{ github.event.head_commit.message }}" - target-branch: master \ No newline at end of file + target-branch: master diff --git a/.github/workflows/Windows_MinGW_x86.yml b/.github/workflows/Windows_MinGW_x86.yml index c2e250eda..464a4c844 100644 --- a/.github/workflows/Windows_MinGW_x86.yml +++ b/.github/workflows/Windows_MinGW_x86.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout uses: actions/checkout@v2 diff --git a/CMake/platforms/mingwcc.toolchain.cmake b/CMake/platforms/mingwcc.toolchain.cmake index 535c82c9b..731e0c860 100644 --- a/CMake/platforms/mingwcc.toolchain.cmake +++ b/CMake/platforms/mingwcc.toolchain.cmake @@ -10,7 +10,7 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/i686-w64-min SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") set(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") -set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/i686-w64-mingw32-pkg-config") +set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/i686-w64-mingw32-pkg-config" CACHE STRING "Path to pkg-config") SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/i686-w64-mingw32" "${CROSS_PREFIX}/i686-w64-mingw32/i686-w64-mingw32") diff --git a/CMake/platforms/mingwcc64.toolchain.cmake b/CMake/platforms/mingwcc64.toolchain.cmake index d2e77dda7..3655899ee 100644 --- a/CMake/platforms/mingwcc64.toolchain.cmake +++ b/CMake/platforms/mingwcc64.toolchain.cmake @@ -10,7 +10,7 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/x86_64-w64-m SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") set(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") -set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/x86_64-w64-mingw32-pkg-config") +set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/x86_64-w64-mingw32-pkg-config" CACHE STRING "Path to pkg-config") SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/x86_64-w64-mingw32" "${CROSS_PREFIX}/x86_64-w64-mingw32/x86_64-w64-mingw32")