develop
Myk Taylor 2023-07-30 19:53:46 -07:00
parent 1faf156bfc
commit 0b2877a538
No known key found for this signature in database
3 changed files with 25 additions and 20 deletions

@ -22,7 +22,7 @@ on:
default: false default: false
stonesense: stonesense:
type: boolean type: boolean
default: true default: false
extras: extras:
type: boolean type: boolean
default: false default: false
@ -32,7 +32,7 @@ on:
jobs: jobs:
build-linux64: build-linux64:
name: Linux package name: Build linux64
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Install basic build dependencies - name: Install basic build dependencies
@ -78,6 +78,8 @@ jobs:
-G Ninja \ -G Ninja \
-DCMAKE_INSTALL_PREFIX=build/image \ -DCMAKE_INSTALL_PREFIX=build/image \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
${{ inputs.platform-files && '-DCMAKE_C_COMPILER_LAUNCHER=ccache' || '' }} \
${{ inputs.platform-files && '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache' || '' }} \
-DBUILD_LIBRARY:BOOL=${{ inputs.platform-files }} \ -DBUILD_LIBRARY:BOOL=${{ inputs.platform-files }} \
-DBUILD_PLUGINS:BOOL=${{ inputs.platform-files }} \ -DBUILD_PLUGINS:BOOL=${{ inputs.platform-files }} \
-DBUILD_STONESENSE:BOOL=${{ inputs.platform-files }} \ -DBUILD_STONESENSE:BOOL=${{ inputs.platform-files }} \
@ -90,6 +92,7 @@ jobs:
- name: Build DFHack - name: Build DFHack
run: ninja -C build install run: ninja -C build install
- name: Run cpp tests - name: Run cpp tests
if: inputs.platform-files
run: ninja -C build test run: ninja -C build test
- name: Trim cache - name: Trim cache
if: inputs.platform-files if: inputs.platform-files
@ -98,7 +101,7 @@ jobs:
ccache --cleanup ccache --cleanup
ccache --show-stats ccache --show-stats
- name: Format artifact name - name: Format artifact name
if: ${{ inputs.append-date-and-hash }} if: inputs.append-date-and-hash
id: artifactname id: artifactname
run: | run: |
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
@ -106,5 +109,5 @@ jobs:
if: inputs.artifact-name if: inputs.artifact-name
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ${{ inputs.append-date-and-hash && inputs.artifact-name || steps.artifactname.outputs.name}} name: ${{ inputs.append-date-and-hash && steps.artifactname.outputs.name || inputs.artifact-name }}
path: build/image/* path: build/image/*

@ -7,8 +7,8 @@ jobs:
name: Build (Linux ${{ matrix.type }}, GCC ${{ matrix.gcc }}) name: Build (Linux ${{ matrix.type }}, GCC ${{ matrix.gcc }})
uses: ./.github/workflows/build-linux.yml uses: ./.github/workflows/build-linux.yml
with: with:
artifact-name: ${{ matrix.artifact-name != 0 && matrix.artifact-name || format('{0}-gcc-{1}', matrix.type, matrix.gcc) }} artifact-name: ${{ matrix.artifact-name || format('{0}-gcc-{1}', matrix.type, matrix.gcc) }}
append-date-and-hash: ${{ matrix.append-date-and-hash }} append-date-and-hash: ${{ matrix.append-date-and-hash && true || false }}
cache-id: ${{ matrix.type }} cache-id: ${{ matrix.type }}
stonesense: ${{ matrix.stonesense }} stonesense: ${{ matrix.stonesense }}
docs: ${{ matrix.type == 'release' }} docs: ${{ matrix.type == 'release' }}

@ -289,20 +289,22 @@ endif()
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS}) include_directories(${ZLIB_INCLUDE_DIRS})
# Download SDL release and extract into depends in the build dir if(BUILD_LIBRARY)
# all we need are the header files (including generated headers), so the same release package # Download SDL release and extract into depends in the build dir
# will work for all platforms # all we need are the header files (including generated headers), so the same release package
# (the above statement is untested for OSX) # will work for all platforms
set(SDL_VERSION 2.26.2) # (the above statement is untested for OSX)
set(SDL_ZIP_MD5 574daf26d48de753d0b1e19823c9d8bb) set(SDL_VERSION 2.26.2)
set(SDL_ZIP_FILE SDL2-devel-${SDL_VERSION}-VC.zip) set(SDL_ZIP_MD5 574daf26d48de753d0b1e19823c9d8bb)
set(SDL_ZIP_PATH ${dfhack_SOURCE_DIR}/depends/SDL2/) set(SDL_ZIP_FILE SDL2-devel-${SDL_VERSION}-VC.zip)
download_file("https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/${SDL_ZIP_FILE}" set(SDL_ZIP_PATH ${dfhack_SOURCE_DIR}/depends/SDL2/)
${SDL_ZIP_PATH}${SDL_ZIP_FILE} download_file("https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/${SDL_ZIP_FILE}"
${SDL_ZIP_MD5}) ${SDL_ZIP_PATH}${SDL_ZIP_FILE}
file(ARCHIVE_EXTRACT INPUT ${SDL_ZIP_PATH}${SDL_ZIP_FILE} ${SDL_ZIP_MD5})
DESTINATION ${SDL_ZIP_PATH}) file(ARCHIVE_EXTRACT INPUT ${SDL_ZIP_PATH}${SDL_ZIP_FILE}
include_directories(${SDL_ZIP_PATH}/SDL2-${SDL_VERSION}/include) DESTINATION ${SDL_ZIP_PATH})
include_directories(${SDL_ZIP_PATH}/SDL2-${SDL_VERSION}/include)
endif()
if(APPLE) if(APPLE)
# libstdc++ (GCC 4.8.5 for OS X 10.6) # libstdc++ (GCC 4.8.5 for OS X 10.6)