Skip to content

Commit

Permalink
Fix ABI compatibility tool on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Feb 11, 2025
1 parent d7c14b6 commit 39a64fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ test/test.xcodeproj/*/xcuser*
test/*.o
test/*.pem
test/*.srl
test/_build_*
work/
benchmark/server*

Expand Down
2 changes: 1 addition & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ cert.pem:
./gen-certs.sh

clean:
rm -f test test_split test_proxy server_fuzzer *.pem *.0 *.o *.1 *.srl httplib.h httplib.cc
rm -rf test test_split test_proxy server_fuzzer *.pem *.0 *.o *.1 *.srl httplib.h httplib.cc _build*

28 changes: 14 additions & 14 deletions test/check-shared-library-abi-compatibility.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
CURRENT_COMMIT=$(git rev-parse HEAD)
PREVIOUS_VERSION=$(git describe --tags --abbrev=0 $CURRENT_COMMIT)

BUILD_DIR=_build_for_is_abi_compatible
PREVIOUS_VERSION=$(git describe --tags --abbrev=0 master)
BUILD_DIR=_build_for_abi_compatibility_check

# Make the build directory
rm -rf $BUILD_DIR
Expand All @@ -29,6 +27,7 @@ cd ..

# Build the nearest vesion
cd old

cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-g -Og" \
Expand All @@ -44,15 +43,16 @@ cmake --build . --target clean > /dev/null
cd ..

# Checkout the original commit
if [ "$CURRENT_COMMIT" = "$(git rev-parse master)" ]; then
git checkout -q master
else
git checkout -q "${CURRENT_COMMIT}"
fi
git checkout -q master

# ABI compatibility check
../check-abi-compatibility.sh ./old/out/lib/libcpp-httplib.so ./new/out/lib/libcpp-httplib.so

# Clean the build directory
cd ..
rm -rf $BUILD_DIR
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
../check-abi-compatibility.sh ./old/out/lib/libcpp-httplib.so ./new/out/lib/libcpp-httplib.so
exit $?
elif [[ "$OSTYPE" == "darwin"* ]]; then
../check-abi-compatibility.sh ./old/out/lib/libcpp-httplib.dylib ./new/out/lib/libcpp-httplib.dylib
exit $?
else
echo "Unknown OS..."
exit 1
fi

0 comments on commit 39a64fb

Please sign in to comment.