diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3945bff1ef..c278095256 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,20 +35,40 @@ jobs: perl ./list.pl | cut -d/ -f2 | sort > list.pl.out diff ls.out list.pl.out + dfhack-ref: + runs-on: ubuntu-latest + outputs: + ref: ${{ steps.resolve.outputs.ref }} + steps: + - id: resolve + env: + REPO: ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }} + BRANCH: ${{ github.base_ref || github.ref_name }} + run: | + ref="$BRANCH" + [ "$ref" = master ] && ref=develop + if [ "$ref" != develop ] && ! git ls-remote --exit-code --heads "https://github.com/$REPO" "$ref" >/dev/null 2>&1; then + echo "no '$ref' branch in $REPO; falling back to develop" + ref=develop + fi + echo "ref=$ref" >> "$GITHUB_OUTPUT" + test: + needs: dfhack-ref uses: DFHack/dfhack/.github/workflows/test.yml@develop with: dfhack_repo: ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }} - dfhack_ref: ${{ (((github.base_ref || github.ref_name) == 'master') && 'develop' || (github.base_ref || github.ref_name)) }} + dfhack_ref: ${{ needs.dfhack-ref.outputs.ref }} structures_repo: ${{ github.repository }} structures_ref: ${{ github.ref }} secrets: inherit docs: + needs: dfhack-ref uses: DFHack/dfhack/.github/workflows/build-linux.yml@develop with: dfhack_repo: ${{ format('{0}/dfhack', github.event_name == 'push' && github.repository_owner || github.event.pull_request.base.repo.owner.login) }} - dfhack_ref: ${{ (((github.base_ref || github.ref_name) == 'master') && 'develop' || (github.base_ref || github.ref_name)) }} + dfhack_ref: ${{ needs.dfhack-ref.outputs.ref }} structures_repo: ${{ github.repository }} structures_ref: ${{ github.ref }} artifact-name: docs diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 711bd520e7..bd89b6a721 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -13,7 +13,12 @@ if(BUILD_XMLDUMP) FetchContent_MakeAvailable(fmt) set(FMTLIB fmt) add_definitions("-DUSE_FMTLIB") - add_subdirectory(depends/lua) + if(NOT TARGET lua) + add_subdirectory(${dfhack_SOURCE_DIR}/depends/lua ${CMAKE_BINARY_DIR}/depends/lua) + if (UNIX) + set_target_properties(lua PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations -Wno-deprecated-enum-enum-conversion") + endif() + endif() file(GLOB XML_FILES ../df.*.xml) set(TYPE_DUMP_GENERATOR "${CMAKE_CURRENT_SOURCE_DIR}/generate-type-dump.py")