Browse Source

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.
pull/5315/head
Gleb Mazovetskiy 4 years ago committed by Anders Jenbo
parent
commit
6c5b5612c2
  1. 12
      .github/workflows/Windows_MinGW_x64.yml
  2. 2
      .github/workflows/Windows_MinGW_x86.yml
  3. 2
      CMake/platforms/mingwcc.toolchain.cmake
  4. 2
      CMake/platforms/mingwcc64.toolchain.cmake

12
.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
target-branch: master

2
.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

2
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")

2
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")

Loading…
Cancel
Save