Skip to content

Commit

Permalink
Added 64 bit Windows XP build
Browse files Browse the repository at this point in the history
  • Loading branch information
klei1984 committed Jul 18, 2024
1 parent f8e89e2 commit c275844
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 10 deletions.
65 changes: 59 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,59 @@ jobs:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts

WindowsXP-x64:
name: Windows XP x64
runs-on: ubuntu-latest
container: ubuntu:23.10

steps:
- name: Set build configuration
id: build_configuration
run: |
BUILD_TYPE=${{github.event.inputs.build_type}}
echo "build_type=${BUILD_TYPE:-"Debug"}" >> $GITHUB_OUTPUT
- name: Setup Dependencies
run: |
apt update -y && apt install -y sudo
sudo apt-get install -y ca-certificates gpg wget
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update -y
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
sudo apt-get install kitware-archive-keyring
sudo apt-get install -y file build-essential binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 ninja-build cmake nsis gettext p7zip-full libsdl2-dev
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-cross-mingw-w64-x86_64.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="c:/Program Files/M.A.X. Port" ..
cmake --build . --parallel
- name: Package
run: |
cd ${{steps.build_configuration.outputs.build_type}}
cpack --config CPackConfig.cmake
cpack --config CPackSourceConfig.cmake
mkdir -p Artifacts/WindowsXP-x64
cp *-win64.exe Artifacts/WindowsXP-x64/
cp *-win64.7z Artifacts/WindowsXP-x64/
cp *-Source.7z Artifacts/WindowsXP-x64/
7z a -mx9 -bd max-port-win64-symbols.7z max.debug
cp max-port-win64-symbols.7z Artifacts/WindowsXP-x64/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{github.job}}
path: ${{steps.build_configuration.outputs.build_type}}/Artifacts

WindowsXP-x86:
name: Windows XP x86
runs-on: ubuntu-latest
Expand All @@ -158,7 +211,7 @@ jobs:
test -f /usr/share/doc/kitware-archive-keyring/copyright ||
sudo rm /usr/share/keyrings/kitware-archive-keyring.gpg
sudo apt-get install kitware-archive-keyring
sudo apt-get install -y file build-essential binutils-mingw-w64-i686 g++-mingw-w64-i686 gcc-mingw-w64-i686 ninja-build:i386 cmake nsis gettext p7zip-full
sudo apt-get install -y file build-essential binutils-mingw-w64-i686 g++-mingw-w64-i686 gcc-mingw-w64-i686 ninja-build:i386 cmake nsis gettext p7zip-full libsdl2-dev:i386
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -167,7 +220,7 @@ jobs:
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-cross-mingw-w64-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-cross-mingw-w64-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="c:/Program Files/M.A.X. Port" ..
cmake --build . --parallel
- name: Package
Expand Down Expand Up @@ -210,7 +263,7 @@ jobs:
- name: Setup Dependencies
run: |
pacman -S --noconfirm git mingw-w64-x86_64-toolchain p7zip mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-nsis mingw-w64-x86_64-gettext make
pacman -S --noconfirm git mingw-w64-x86_64-toolchain p7zip mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-nsis mingw-w64-x86_64-gettext make mingw-w64-x86_64-SDL2
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -219,7 +272,7 @@ jobs:
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw-w64-x86_64.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw-w64-x86_64.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="c:/Program Files/M.A.X. Port" ..
cmake --build . --parallel
- name: Test
Expand Down Expand Up @@ -267,7 +320,7 @@ jobs:
- name: Setup Dependencies
run: |
pacman -S --noconfirm git mingw-w64-i686-toolchain p7zip mingw-w64-i686-cmake mingw-w64-i686-ninja mingw-w64-i686-nsis mingw-w64-i686-gettext make
pacman -S --noconfirm git mingw-w64-i686-toolchain p7zip mingw-w64-i686-cmake mingw-w64-i686-ninja mingw-w64-i686-nsis mingw-w64-i686-gettext make mingw-w64-i686-SDL2
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -276,7 +329,7 @@ jobs:
run: |-
mkdir ${{steps.build_configuration.outputs.build_type}}
cd ${{steps.build_configuration.outputs.build_type}}
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw-w64-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-mingw-w64-i686.cmake -DCMAKE_BUILD_TYPE=${{steps.build_configuration.outputs.build_type}} -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="c:/Program Files (x86)/M.A.X. Port" ..
cmake --build . --parallel
- name: Test
Expand Down
8 changes: 4 additions & 4 deletions cmake/toolchain-cross-mingw-w64-i686.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_EXTENSIONS OFF)

set(PREFIX /usr/local/win32)
set(PREFIX /usr)
set(TOOLSET "i686-w64-mingw32")

set(MAX_BUILD_TESTS OFF)
Expand All @@ -16,9 +16,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

find_program(CMAKE_RC_COMPILER NAMES ${TOOLSET}-windres)
find_program(CMAKE_C_COMPILER NAMES ${TOOLSET}-gcc)
find_program(CMAKE_CXX_COMPILER NAMES ${TOOLSET}-g++)
find_program(CMAKE_RC_COMPILER NAMES ${TOOLSET}-windres REQUIRED)
find_program(CMAKE_C_COMPILER NAMES ${TOOLSET}-gcc REQUIRED)
find_program(CMAKE_CXX_COMPILER NAMES ${TOOLSET}-g++ REQUIRED)

set(CONFIGURE_EXTRA_ARGS
--target=${TOOLSET}
Expand Down
43 changes: 43 additions & 0 deletions cmake/toolchain-cross-mingw-w64-x86_64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
set(CMAKE_SYSTEM_NAME Windows)

set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_EXTENSIONS OFF)

set(PREFIX /usr)
set(TOOLSET "x86_64-w64-mingw32")

set(MAX_BUILD_TESTS OFF)

set(CMAKE_FIND_ROOT_PATH ${PREFIX}/${TOOLSET})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

find_program(CMAKE_RC_COMPILER NAMES ${TOOLSET}-windres REQUIRED)
find_program(CMAKE_C_COMPILER NAMES ${TOOLSET}-gcc REQUIRED)
find_program(CMAKE_CXX_COMPILER NAMES ${TOOLSET}-g++ REQUIRED)

set(CONFIGURE_EXTRA_ARGS
--target=${TOOLSET}
--host=${TOOLSET}
--build=x86_64-linux
CC=${CMAKE_C_COMPILER}
CXX=${CMAKE_CXX_COMPILER}
)

add_compile_options(
-DCROSS
$<$<COMPILE_LANGUAGE:CXX>:-Wno-reorder>
-Wall
-Wno-switch
-Wno-unused-function
-Wno-unused-variable
-Wignored-qualifiers
-Wshadow=local
-Wtype-limits
-Wlogical-op
-fno-eliminate-unused-debug-types
)

0 comments on commit c275844

Please sign in to comment.