Skip to content

Commit

Permalink
minor cleanup of MinGW-related scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
FyiurAmron committed Jun 27, 2024
1 parent 68ea3f5 commit 7567a80
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 162 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ jobs:
run: |
ccache --zero-stats
source /opt/qt5*/bin/qt5*-env.sh || true
mkdir build && cd build
cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install
cmake -S . \
-B build \
-DCMAKE_INSTALL_PREFIX=./install \
$CMAKE_OPTS
- name: Build
run: cmake --build build
- name: Run tests
Expand Down Expand Up @@ -194,8 +196,11 @@ jobs:
- name: Configure
run: |
ccache --zero-stats
mkdir build && cd build
../cmake/build_win${{ matrix.arch }}.sh
cmake -S . \
-B build \
-DCMAKE_INSTALL_PREFIX=./install \
-DCMAKE_TOOLCHAIN_FILE="./cmake/toolchains/MinGW-W64-${{ matrix.arch }}.cmake" \
$CMAKE_OPTS
- name: Build
run: cmake --build build
- name: Package
Expand Down
40 changes: 0 additions & 40 deletions cmake/build_win32.sh

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/build_win64.sh

This file was deleted.

6 changes: 6 additions & 0 deletions cmake/toolchains/MinGW-W64-32.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

set(WIN64 FALSE)

set(CMAKE_SYSTEM_PROCESSOR i686)

include(${CMAKE_CURRENT_LIST_DIR}/common/MinGW-W64.cmake)
9 changes: 9 additions & 0 deletions cmake/toolchains/MinGW-W64-64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

set(WIN64 TRUE)

set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(CMAKE_SYSTEM_PROCESSOR32 i686)

set(CMAKE_TOOLCHAIN_FILE_32 "${CMAKE_CURRENT_LIST_DIR}/MinGW-W64-32.cmake")

include(${CMAKE_CURRENT_LIST_DIR}/common/MinGW-W64.cmake)
2 changes: 0 additions & 2 deletions cmake/toolchains/Ubuntu-MinGW-W64-32.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions cmake/toolchains/Ubuntu-MinGW-W64-64.cmake

This file was deleted.

3 changes: 0 additions & 3 deletions cmake/toolchains/Ubuntu-MinGW-X-Trusty-32.cmake

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/toolchains/Ubuntu-MinGW-X-Trusty-64.cmake

This file was deleted.

24 changes: 24 additions & 0 deletions cmake/toolchains/common/MinGW-W64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Toolchain for MinGW compiler

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_VERSION 1)

set(TOOLCHAIN_PREFIX ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)

set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
set(ENV{PKG_CONFIG} /usr/bin/${TOOLCHAIN_PREFIX}-pkg-config)

if(WIN64)
set(TOOLCHAIN_PREFIX32 ${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32)
set(CMAKE_C_COMPILER32 ${TOOLCHAIN_PREFIX32}-gcc)
set(CMAKE_CXX_COMPILER32 ${TOOLCHAIN_PREFIX32}-g++)
endif()

# Search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Search for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
17 changes: 0 additions & 17 deletions cmake/toolchains/common/Ubuntu-MinGW-W64.cmake

This file was deleted.

58 changes: 0 additions & 58 deletions cmake/toolchains/common/Ubuntu-MinGW-X-Trusty.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions cmake/toolchains/common/Win32.cmake

This file was deleted.

7 changes: 0 additions & 7 deletions cmake/toolchains/common/Win64.cmake

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/toolchains/common/WinCrossCompile.cmake

This file was deleted.

0 comments on commit 7567a80

Please sign in to comment.