#!/bin/bash set -eu # Execute in top-level CGE dir. # Tries to compile $1 with lazbuild. # # In case it fails (as lazbuild fails with access violation sometimes: # An unhandled exception occurred at $0000000000575F5F: # EAccessViolation: Access violation # $0000000000575F5F line 590 of exttools.pas # $000000000057A027 line 1525 of exttools.pas # $000000000057B231 line 1814 of exttools.pas # ) # ... the script will clean CGE dir and just retry. LPI_FILENAME="$1" # For easy testing of "examples-laz" # echo lazbuild "${LPI_FILENAME}" # exit 0 if ! lazbuild "${LPI_FILENAME}"; then echo '1st execution of lazbuild failed, trying again' make clean # Note: Hopefully it doesn't need to recompile all CGE LPK packages here. lazbuild ${CASTLE_LAZBUILD_OPTIONS:-} "${LPI_FILENAME}" fi