Skip to content

Commit 39a64fb

Browse files
committed
Fix ABI compatibility tool on macOS
1 parent d7c14b6 commit 39a64fb

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ test/test.xcodeproj/*/xcuser*
2323
test/*.o
2424
test/*.pem
2525
test/*.srl
26+
test/_build_*
2627
work/
2728
benchmark/server*
2829

test/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ cert.pem:
6969
./gen-certs.sh
7070

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

test/check-shared-library-abi-compatibility.sh

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env bash
2-
CURRENT_COMMIT=$(git rev-parse HEAD)
3-
PREVIOUS_VERSION=$(git describe --tags --abbrev=0 $CURRENT_COMMIT)
4-
5-
BUILD_DIR=_build_for_is_abi_compatible
2+
PREVIOUS_VERSION=$(git describe --tags --abbrev=0 master)
3+
BUILD_DIR=_build_for_abi_compatibility_check
64

75
# Make the build directory
86
rm -rf $BUILD_DIR
@@ -29,6 +27,7 @@ cd ..
2927

3028
# Build the nearest vesion
3129
cd old
30+
3231
cmake \
3332
-DCMAKE_BUILD_TYPE=Debug \
3433
-DCMAKE_CXX_FLAGS="-g -Og" \
@@ -44,15 +43,16 @@ cmake --build . --target clean > /dev/null
4443
cd ..
4544

4645
# Checkout the original commit
47-
if [ "$CURRENT_COMMIT" = "$(git rev-parse master)" ]; then
48-
git checkout -q master
49-
else
50-
git checkout -q "${CURRENT_COMMIT}"
51-
fi
46+
git checkout -q master
5247

5348
# ABI compatibility check
54-
../check-abi-compatibility.sh ./old/out/lib/libcpp-httplib.so ./new/out/lib/libcpp-httplib.so
55-
56-
# Clean the build directory
57-
cd ..
58-
rm -rf $BUILD_DIR
49+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
50+
../check-abi-compatibility.sh ./old/out/lib/libcpp-httplib.so ./new/out/lib/libcpp-httplib.so
51+
exit $?
52+
elif [[ "$OSTYPE" == "darwin"* ]]; then
53+
../check-abi-compatibility.sh ./old/out/lib/libcpp-httplib.dylib ./new/out/lib/libcpp-httplib.dylib
54+
exit $?
55+
else
56+
echo "Unknown OS..."
57+
exit 1
58+
fi

0 commit comments

Comments
 (0)