Skip to content

Commit

Permalink
cmake is designed for out-of-tree builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Vollstrecker committed Dec 27, 2024
1 parent 6b0224a commit 4d59e1a
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ jobs:
cflags: -Wall -Wextra
pkgtgt: package package_source

# Test out of source builds
- name: Ubuntu GCC OSB
os: ubuntu-latest
compiler: gcc
cflags: -Wall -Wextra
build-dir: ../build
src-dir: ../zlib
pkgtgt: package package_source

- name: Ubuntu GCC -O3
os: ubuntu-latest
compiler: gcc
Expand Down Expand Up @@ -85,28 +76,27 @@ jobs:
choco install --no-progress ninja ${{ matrix.packages }}
- name: Generate project files
run: cmake -S ${{ matrix.src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DZLIB_BUILD_MINIZIP=ON
run: cmake -S . -B ../build ${{ matrix.cmake-args }} -D CMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} -DZLIB_BUILD_MINIZIP=ON
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}

- name: Compile source code
run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }}
run: cmake --build ../build --config ${{ matrix.build-config || 'Release' }}

- name: Run test cases
run: ctest -C Release --output-on-failure --max-width 120
working-directory: ${{ matrix.build-dir || '.' }}
working-directory: ../build

- name: create packages
run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }} -t ${{ matrix.pkgtgt }}
working-directory: ${{ matrix.build-dir || '.' }}
run: cmake --build ../build --config ${{ matrix.build-config || 'Release' }} -t ${{ matrix.pkgtgt }}

- name: Upload build errors
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.name }} (cmake)
path: |
**/CMakeFiles/CMakeOutput.log
**/CMakeFiles/CMakeError.log
../build/CMakeFiles/CMakeOutput.log
../build/CMakeFiles/CMakeError.log
retention-days: 7

0 comments on commit 4d59e1a

Please sign in to comment.