forked from ebiggers/libdeflate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
By popular request, use CMake instead of a plain Makefile. Some parts of this commit are based on the pull request ebiggers#101, which was written by Benjamin Sergeant <[email protected]> and SpaceIm <[email protected]>.
- Loading branch information
Showing
32 changed files
with
620 additions
and
982 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
name: CI | ||
on: [pull_request] | ||
env: | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
|
||
jobs: | ||
x86_64-build-and-test: | ||
|
@@ -13,6 +11,7 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
env: | ||
CC: ${{ matrix.compiler }} | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
|
@@ -28,6 +27,8 @@ jobs: | |
arch: [armv6, armv7, aarch64, s390x, ppc64le] | ||
compiler: [gcc, clang] | ||
runs-on: ubuntu-latest | ||
env: | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: uraimo/[email protected] | ||
|
@@ -37,7 +38,7 @@ jobs: | |
githubToken: ${{ github.token }} | ||
install: | | ||
apt-get update | ||
apt-get install -y build-essential clang llvm libz-dev valgrind | ||
apt-get install -y build-essential cmake clang llvm libz-dev valgrind | ||
run: | | ||
# Valgrind and ASAN crash on at least s390x, ppc64le, and aarch64 | ||
# here. (It's probably something related to the QEMU user-mode | ||
|
@@ -52,9 +53,11 @@ jobs: | |
export SKIP_FREESTANDING=1 | ||
;; | ||
aarch64) | ||
# "ldd: exited with unknown exit code (139)" | ||
if [ ${{ matrix.compiler }} = clang ]; then | ||
# "ldd: exited with unknown exit code (139)" | ||
export SKIP_SHARED_LIB=1 | ||
# "archive has no index; run ranlib to add one" | ||
export SKIP_CFI=1 | ||
fi | ||
;; | ||
esac | ||
|
@@ -65,9 +68,13 @@ jobs: | |
macos-build-and-test: | ||
name: Build and test (macOS) | ||
runs-on: macos-latest | ||
env: | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: make all check | ||
- run: cmake -B build -DLIBDEFLATE_BUILD_TESTS=1 | ||
- run: cmake --build build --verbose | ||
- run: ctest --test-dir build | ||
|
||
windows-msys2-build-and-test: | ||
name: Build and test (Windows, MSYS2, ${{matrix.sys}}) | ||
|
@@ -80,22 +87,32 @@ jobs: | |
defaults: | ||
run: | ||
shell: msys2 {0} | ||
env: | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ${{matrix.sys}} | ||
update: true | ||
install: make mingw-w64-${{matrix.env}}-cc mingw-w64-${{matrix.env}}-zlib | ||
- run: make all check | ||
install: > | ||
make | ||
mingw-w64-${{matrix.env}}-cc | ||
mingw-w64-${{matrix.env}}-cmake | ||
mingw-w64-${{matrix.env}}-ninja | ||
mingw-w64-${{matrix.env}}-zlib | ||
- run: cmake -B build -G Ninja -DLIBDEFLATE_BUILD_TESTS=1 | ||
- run: cmake --build build --verbose | ||
- run: ctest --test-dir build | ||
|
||
windows-msvc-build: | ||
name: Build (Windows, Visual Studio) | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
- run: nmake /f Makefile.msc | ||
- uses: microsoft/[email protected] | ||
- run: cmake -B build -G "Visual Studio 17 2022" | ||
- run: cmake --build build --verbose | ||
|
||
run-clang-static-analyzer: | ||
name: Run clang static analyzer | ||
|
@@ -106,8 +123,8 @@ jobs: | |
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y clang-tools | ||
- name: Run clang static analyzer | ||
run: make scan-build | ||
- run: scan-build cmake -B build -DLIBDEFLATE_BUILD_TESTS=1 | ||
- run: scan-build cmake --build build --verbose | ||
|
||
run-shellcheck: | ||
name: Run shellcheck | ||
|
@@ -119,18 +136,47 @@ jobs: | |
sudo apt-get update | ||
sudo apt-get install -y shellcheck | ||
- name: Run shellcheck | ||
run: make shellcheck | ||
run: shellcheck scripts/*.sh | ||
|
||
cross-compile-for-windows: | ||
name: Cross compile for Windows | ||
runs-on: ubuntu-latest | ||
env: | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y gcc-mingw-w64-i686 gcc-mingw-w64-x86-64 libz-mingw-w64-dev | ||
# Unfortunately Ubuntu doesn't have {i686,x86_64}-w64-mingw32-cmake like | ||
# some distros have, so we have to provide our own toolchain files here. | ||
- name: 32-bit build | ||
run: make CC=i686-w64-mingw32-gcc all test_programs | ||
run: | | ||
scripts/cmake-helper.sh -DLIBDEFLATE_BUILD_TESTS=1 \ | ||
-DCMAKE_TOOLCHAIN_FILE=scripts/toolchain-i686-w64-mingw32.cmake | ||
cmake --build build --verbose | ||
- name: 64-bit build | ||
run: make CC=x86_64-w64-mingw32-gcc all test_programs | ||
run: | | ||
scripts/cmake-helper.sh -DLIBDEFLATE_BUILD_TESTS=1 \ | ||
-DCMAKE_TOOLCHAIN_FILE=scripts/toolchain-x86_64-w64-mingw32.cmake | ||
cmake --build build --verbose | ||
cross-compile-for-android: | ||
name: Cross compile for ${{matrix.abi}} Android on ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04, ubuntu-20.04, macos-latest] | ||
abi: [armeabi-v7a, arm64-v8a, x86, x86_64] | ||
runs-on: ${{matrix.os}} | ||
env: | ||
CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: | | ||
scripts/cmake-helper.sh \ | ||
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_LATEST_HOME"/build/cmake/android.toolchain.cmake \ | ||
-DANDROID_ABI=${{matrix.abi}} \ | ||
-DANDROID_PLATFORM=28 \ | ||
-DLIBDEFLATE_BUILD_TESTS=1 | ||
cmake --build build --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,3 @@ | ||
*.a | ||
*.def | ||
*.dll | ||
*.dllobj | ||
*.dylib | ||
*.exe | ||
*.exp | ||
*.lib | ||
*.o | ||
*.obj | ||
*.so | ||
*.so.* | ||
/.build-config | ||
/programs/config.h | ||
/benchmark | ||
/checksum | ||
/gzip | ||
/gunzip | ||
/test_* | ||
tags | ||
/build* | ||
cscope* | ||
tags |
Oops, something went wrong.