build: also build static binaries with -O2

This commit is contained in:
Marcus Holland-Moritz 2024-01-21 11:49:23 +01:00
parent e0bcadd02c
commit 340c96fd56
2 changed files with 39 additions and 31 deletions

View File

@ -77,6 +77,10 @@ case "-$BUILD_TYPE-" in
exit 1
esac
if [[ "-$BUILD_TYPE-" == *-O2-* ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DDWARFS_OPTIMIZE=2"
fi
if [[ "-$BUILD_TYPE-" == *-nojemalloc-* ]]; then
CMAKE_ARGS="${CMAKE_ARGS} -DUSE_JEMALLOC=0"
fi
@ -117,40 +121,42 @@ if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then
fi
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
# in the clang-release-static case, we also try to build from the source tarball
if [[ "-$BUILD_TYPE-" == *-release-* ]] && [[ "-$BUILD_TYPE-" == *-clang-* ]]; then
$BUILD_TOOL package_source
if [[ "-$BUILD_TYPE-" == *-release-* ]]; then
# in the clang-release-static case, we also try to build from the source tarball
if [[ "-$BUILD_TYPE-" == *-clang-* ]] && [[ "-$BUILD_TYPE-" != *-O2-* ]]; then
$BUILD_TOOL package_source
if [[ "$BUILD_ARCH" == "amd64" ]]; then
$BUILD_TOOL copy_source_artifacts
if [[ "$BUILD_ARCH" == "amd64" ]]; then
$BUILD_TOOL copy_source_artifacts
fi
$BUILD_TOOL realclean
cd "$HOME"
VERSION=$(git -C /workspace describe --tags --match "v*" --dirty --abbrev=10)
VERSION=${VERSION:1}
rm -rf dwarfs-*
rm -f dwarfs
mv "build/dwarfs-${VERSION}.tar.zst" .
rm -rf build
tar xvf "dwarfs-${VERSION}.tar.zst"
mv "dwarfs-${VERSION}" dwarfs
mkdir build
cd build
# shellcheck disable=SC2086
cmake ../dwarfs/ $CMAKE_ARGS
$BUILD_TOOL
ctest --output-on-failure -j$(nproc)
fi
$BUILD_TOOL realclean
cd "$HOME"
VERSION=$(git -C /workspace describe --tags --match "v*" --dirty --abbrev=10)
VERSION=${VERSION:1}
rm -rf dwarfs-*
rm -f dwarfs
mv "build/dwarfs-${VERSION}.tar.zst" .
rm -rf build
tar xvf "dwarfs-${VERSION}.tar.zst"
mv "dwarfs-${VERSION}" dwarfs
mkdir build
cd build
# shellcheck disable=SC2086
cmake ../dwarfs/ $CMAKE_ARGS
$BUILD_TOOL
ctest --output-on-failure -j$(nproc)
$BUILD_TOOL strip
fi

View File

@ -106,7 +106,9 @@ jobs:
- oldgcc-debug-make
- clang-release-ninja
- gcc-release-ninja-static
- gcc-release-ninja-O2-static
- clang-release-ninja-static
- clang-release-ninja-O2-static
- clang-reldbg-ninja-static
- clang-debug-ninja-static
include: