From 4d59e1a30eb149dd04f29edb196d6bfc6357169c Mon Sep 17 00:00:00 2001 From: Vollstrecker Date: Fri, 27 Dec 2024 10:58:44 +0100 Subject: [PATCH] cmake is designed for out-of-tree builds --- .github/workflows/cmake.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3ee931876..40aae6083 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -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 @@ -85,21 +76,20 @@ 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 @@ -107,6 +97,6 @@ jobs: with: name: ${{ matrix.name }} (cmake) path: | - **/CMakeFiles/CMakeOutput.log - **/CMakeFiles/CMakeError.log + ../build/CMakeFiles/CMakeOutput.log + ../build/CMakeFiles/CMakeError.log retention-days: 7