mirror of
https://github.com/mhx/dwarfs.git
synced 2025-08-04 02:06:22 -04:00
build: also build static binaries with -O2
This commit is contained in:
parent
e0bcadd02c
commit
340c96fd56
@ -77,6 +77,10 @@ case "-$BUILD_TYPE-" in
|
|||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [[ "-$BUILD_TYPE-" == *-O2-* ]]; then
|
||||||
|
CMAKE_ARGS="${CMAKE_ARGS} -DDWARFS_OPTIMIZE=2"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "-$BUILD_TYPE-" == *-nojemalloc-* ]]; then
|
if [[ "-$BUILD_TYPE-" == *-nojemalloc-* ]]; then
|
||||||
CMAKE_ARGS="${CMAKE_ARGS} -DUSE_JEMALLOC=0"
|
CMAKE_ARGS="${CMAKE_ARGS} -DUSE_JEMALLOC=0"
|
||||||
fi
|
fi
|
||||||
@ -117,40 +121,42 @@ if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
if [[ "-$BUILD_TYPE-" == *-static-* ]]; then
|
||||||
# in the clang-release-static case, we also try to build from the source tarball
|
if [[ "-$BUILD_TYPE-" == *-release-* ]]; then
|
||||||
if [[ "-$BUILD_TYPE-" == *-release-* ]] && [[ "-$BUILD_TYPE-" == *-clang-* ]]; then
|
# in the clang-release-static case, we also try to build from the source tarball
|
||||||
$BUILD_TOOL package_source
|
if [[ "-$BUILD_TYPE-" == *-clang-* ]] && [[ "-$BUILD_TYPE-" != *-O2-* ]]; then
|
||||||
|
$BUILD_TOOL package_source
|
||||||
|
|
||||||
if [[ "$BUILD_ARCH" == "amd64" ]]; then
|
if [[ "$BUILD_ARCH" == "amd64" ]]; then
|
||||||
$BUILD_TOOL copy_source_artifacts
|
$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
|
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
|
$BUILD_TOOL strip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -106,7 +106,9 @@ jobs:
|
|||||||
- oldgcc-debug-make
|
- oldgcc-debug-make
|
||||||
- clang-release-ninja
|
- clang-release-ninja
|
||||||
- gcc-release-ninja-static
|
- gcc-release-ninja-static
|
||||||
|
- gcc-release-ninja-O2-static
|
||||||
- clang-release-ninja-static
|
- clang-release-ninja-static
|
||||||
|
- clang-release-ninja-O2-static
|
||||||
- clang-reldbg-ninja-static
|
- clang-reldbg-ninja-static
|
||||||
- clang-debug-ninja-static
|
- clang-debug-ninja-static
|
||||||
include:
|
include:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user