Skip to content

Commit 7ee6ec1

Browse files
committed
Improve Linux library detection in build.sh
- Added multiple library name checks for Linux (.so files) - Swift Package Manager might generate different filenames on Linux - Added verbose error reporting when library files not found - This should help identify the actual Linux build issue
1 parent 9b35922 commit 7ee6ec1

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

build.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
1616
SOURCE_LIB=".build/release/libLoopAlgorithmToPython.dylib"
1717
DEST_LIB="./loop_to_python_api/dlibs/macos/libLoopAlgorithmToPython.dylib"
1818
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
19-
SOURCE_LIB=".build/release/libLoopAlgorithmToPython.so"
19+
# Linux: Swift might generate different library names/paths
20+
# Check for possible library names
21+
if [ -f ".build/release/libLoopAlgorithmToPython.so" ]; then
22+
SOURCE_LIB=".build/release/libLoopAlgorithmToPython.so"
23+
elif [ -f ".build/release/LoopAlgorithmToPython.so" ]; then
24+
SOURCE_LIB=".build/release/LoopAlgorithmToPython.so"
25+
elif [ -f ".build/release/libLoopAlgorithmToPython" ]; then
26+
SOURCE_LIB=".build/release/libLoopAlgorithmToPython"
27+
else
28+
echo "ERROR: Could not find Linux library file. Available files:"
29+
find .build/release/ -name "*Loop*" -o -name "*.so" 2>/dev/null || echo "No library files found"
30+
exit 1
31+
fi
2032
DEST_LIB="./loop_to_python_api/dlibs/linux/libLoopAlgorithmToPython.so"
2133
elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || "$OSTYPE" == "win32" ]]; then
2234
SOURCE_LIB=".build/release/LoopAlgorithmToPython.dll"

0 commit comments

Comments
 (0)