Replaced the slow shell script with a faster Python equivalent

This commit is contained in:
Carl Woffenden
2022-01-19 17:01:35 +01:00
parent 928a0caa3e
commit df66ddd794
3 changed files with 247 additions and 8 deletions

View File

@@ -4,7 +4,12 @@
OUT_FILE="tempbin"
echo "Amalgamating files... this can take a while"
./combine.sh -r ../../transcoder -o basisu_transcoder.cpp basisu_transcoder-in.cpp
# Use the faster Python script if we have 3.8 or higher
if python3 -c 'import sys; assert sys.version_info >= (3,8)' 2>/dev/null; then
./combine.py -r ../../transcoder -o basisu_transcoder.cpp basisu_transcoder-in.cpp
else
./combine.sh -r ../../transcoder -o basisu_transcoder.cpp basisu_transcoder-in.cpp
fi
# Did combining work?
if [ $? -ne 0 ]; then
echo "Combine script: FAILED"