Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Jul 31, 2023
1 parent 1faf156 commit 0b2877a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
default: false
stonesense:
type: boolean
default: true
default: false
extras:
type: boolean
default: false
Expand All @@ -32,7 +32,7 @@ on:

jobs:
build-linux64:
name: Linux package
name: Build linux64
runs-on: ubuntu-22.04
steps:
- name: Install basic build dependencies
Expand Down Expand Up @@ -78,6 +78,8 @@ jobs:
-G Ninja \
-DCMAKE_INSTALL_PREFIX=build/image \
-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_PLUGINS:BOOL=${{ inputs.platform-files }} \
-DBUILD_STONESENSE:BOOL=${{ inputs.platform-files }} \
Expand All @@ -90,6 +92,7 @@ jobs:
- name: Build DFHack
run: ninja -C build install
- name: Run cpp tests
if: inputs.platform-files
run: ninja -C build test
- name: Trim cache
if: inputs.platform-files
Expand All @@ -98,13 +101,13 @@ jobs:
ccache --cleanup
ccache --show-stats
- name: Format artifact name
if: ${{ inputs.append-date-and-hash }}
if: inputs.append-date-and-hash
id: artifactname
run: |
echo name=${{ inputs.artifact-name }}-$(date +%Y%m%d)-$(git rev-parse --short HEAD) >> $GITHUB_OUTPUT
- name: Upload artifact
if: inputs.artifact-name
uses: actions/upload-artifact@v3
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/*
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
name: Build (Linux ${{ matrix.type }}, GCC ${{ matrix.gcc }})
uses: ./.github/workflows/build-linux.yml
with:
artifact-name: ${{ matrix.artifact-name != 0 && matrix.artifact-name || format('{0}-gcc-{1}', matrix.type, matrix.gcc) }}
append-date-and-hash: ${{ matrix.append-date-and-hash }}
artifact-name: ${{ matrix.artifact-name || format('{0}-gcc-{1}', matrix.type, matrix.gcc) }}
append-date-and-hash: ${{ matrix.append-date-and-hash && true || false }}
cache-id: ${{ matrix.type }}
stonesense: ${{ matrix.stonesense }}
docs: ${{ matrix.type == 'release' }}
Expand Down
30 changes: 16 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,22 @@ endif()
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})

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

if(APPLE)
# libstdc++ (GCC 4.8.5 for OS X 10.6)
Expand Down

0 comments on commit 0b2877a

Please sign in to comment.