Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 25 additions & 45 deletions .github/workflows/create-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: build
on: [push, pull_request]

jobs:
linux_build:
linux_and_mingw_build:
runs-on: ubuntu-latest
env:
CXX: g++
Expand All @@ -18,6 +18,9 @@ jobs:
- name: Install 32-bit libraries
run: |
sudo apt install -y g++-multilib zlib1g:i386 libsnappy-dev:i386 liblz4-1:i386
- name: Install mingw
run: |
sudo apt install -y gcc-mingw-w64-i686 g++-mingw-w64-i686
- name: Checkout
uses: actions/checkout@v4
- name: Build 64 bit
Expand All @@ -43,9 +46,28 @@ jobs:
with:
name: qpakman-linux32
path: ./build-lin32/qpakman
- name: Build static Win32 executable with MinGW32
run: |
mkdir build-win32 && cd build-win32
cmake -G "Unix Makefiles" \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER=i686-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ \
-DCMAKE_FIND_ROOT_PATH=/usr/i686-w64-mingw32 \
-DCMAKE_EXE_LINKER_FLAGS="-static -static-libgcc -static-libstdc++" \
-DCMAKE_CXX_FLAGS="-static -static-libgcc -static-libstdc++" \
-DCMAKE_BUILD_TYPE=Release \
../
cmake --build .
cd ../
- name: Archive qpakman win32
uses: actions/upload-artifact@v4
with:
name: qpakman-win32
path: ./build-win32/qpakman.exe

macos_build:
runs-on: macos-13
runs-on: macos-15
env:
CXX: clang++
steps:
Expand All @@ -60,46 +82,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: qpakman-macos
path: ./build-macos/qpakman

windows_build:
runs-on: windows-2022
env:
VCPKG_VERSION: 120deac3062162151622ca4860575a33844ba10b
vcpkg_packages: zlib
strategy:
matrix:
config:
- {
arch: x86,
generator: "-G'Visual Studio 17 2022' -A Win32",
vcpkg_triplet: x86-windows-static,
artifact_name: windows32
}
- {
arch: x64,
generator: "-G'Visual Studio 17 2022' -A x64",
vcpkg_triplet: x64-windows-static,
artifact_name: windows64
}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run vcpkg
uses: lukka/run-vcpkg@v7
with:
vcpkgArguments: zlib
vcpkgDirectory: '${{ github.workspace }}\vcpkg'
appendedCacheKey: ${{ matrix.config.vcpkg_triplet }}
vcpkgGitCommitId: ${{ env.VCPKG_VERSION }}
vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }}
- name: Build
run: |
mkdir build-${{ matrix.config.vcpkg_triplet }} && cd build-${{ matrix.config.vcpkg_triplet }}
cmake ${{matrix.config.generator}} -DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET="${{ matrix.config.vcpkg_triplet }}" -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ../
cmake --build . --config Release
- name: Archive qpakman Windows
uses: actions/upload-artifact@v4
with:
name: qpakman-${{ matrix.config.artifact_name }}
path: ./build-${{ matrix.config.vcpkg_triplet }}/Release/qpakman.exe
path: ./build-macos/qpakman
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.5)

project(QPAKMAN CXX)

Expand All @@ -19,7 +19,7 @@ add_executable(qpakman
im_gen.cc im_mip.cc im_format.cc im_tex.cc archive.cc pakfile.cc main.cc)


if(WIN32)
if(WIN32 AND MSVC)
# include setargv.obj for file wildcard expansion
# https://learn.microsoft.com/en-us/cpp/c-language/expanding-wildcard-arguments
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} setargv.obj")
Expand Down
4 changes: 4 additions & 0 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

#define VERSION "0.67"

#ifdef __MINGW32__
// force-enable wildcard expansion for mingw builds
int _dowildcard = -1;
#endif

std::string output_name;

Expand Down