This commit is contained in:
@@ -10,6 +10,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container: archlinux:latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -22,6 +23,7 @@ jobs:
|
|||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||||
git fetch --tags --force
|
git fetch --tags --force
|
||||||
|
|
||||||
if LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null); then
|
if LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null); then
|
||||||
@@ -48,13 +50,6 @@ jobs:
|
|||||||
echo "EOF"
|
echo "EOF"
|
||||||
} >> $GITHUB_OUTPUT
|
} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Cache CMake Binary
|
|
||||||
id: cmake-cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: cmake-4.3.4-linux-x86_64
|
|
||||||
key: ${{ runner.os }}-cmake-4.3.4
|
|
||||||
|
|
||||||
- name: Cache FetchContent & ccache
|
- name: Cache FetchContent & ccache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
@@ -68,23 +63,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Install tools
|
- name: Install tools
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
pacman -Syu --noconfirm
|
||||||
sudo apt-get install -y mingw-w64 zstd ccache zip
|
pacman -S --noconfirm mingw-w64-gcc cmake ninja ccache zip git base-devel
|
||||||
mkdir -p ccache
|
mkdir -p ccache
|
||||||
echo "CCACHE_DIR=$GITHUB_WORKSPACE/ccache" >> $GITHUB_ENV
|
echo "CCACHE_DIR=$GITHUB_WORKSPACE/ccache" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install CMake 4.3.4
|
|
||||||
if: steps.tools-cache.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
wget -q https://github.com/Kitware/CMake/releases/download/v4.3.4/cmake-4.3.4-linux-x86_64.tar.gz
|
|
||||||
tar xzf cmake-4.3.4-linux-x86_64.tar.gz
|
|
||||||
|
|
||||||
- name: Add CMake to path
|
|
||||||
run: echo "$GITHUB_WORKSPACE/cmake-4.3.4-linux-x86_64/bin" >> $GITHUB_PATH
|
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -S . \
|
cmake -B build -S . -G Ninja \
|
||||||
-DCMAKE_SYSTEM_NAME=Windows \
|
-DCMAKE_SYSTEM_NAME=Windows \
|
||||||
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
||||||
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
|
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
|
||||||
|
|||||||
+2
-2
@@ -14,7 +14,7 @@ if(MSVC)
|
|||||||
add_compile_definitions(_AMD64_)
|
add_compile_definitions(_AMD64_)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_compile_options(-m64 -fabi-version=0 -frtti)
|
add_compile_options(-m64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(hex-unlocked LANGUAGES CXX)
|
project(hex-unlocked LANGUAGES CXX)
|
||||||
@@ -147,7 +147,7 @@ set_target_properties(hex-unlocked PROPERTIES OUTPUT_NAME "${RANDOM_EXE_NAME}")
|
|||||||
|
|
||||||
# compiler / IDE config
|
# compiler / IDE config
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
target_link_options(hex-unlocked PRIVATE -static -static-libgcc -static-libstdc++ "-Wl,--allow-multiple-definition")
|
target_link_options(hex-unlocked PRIVATE -static -static-libgcc -static-libstdc++)
|
||||||
else()
|
else()
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT hex-unlocked)
|
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT hex-unlocked)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user