| 1 | #!/bin/bash |
| 2 | set -eu |
| 3 | |
| 4 | # Execute in top-level CGE dir. |
| 5 | # Tries to compile $1 with lazbuild. |
| 6 | # |
| 7 | # In case it fails (as lazbuild fails with access violation sometimes: |
| 8 | # An unhandled exception occurred at $0000000000575F5F: |
| 9 | # EAccessViolation: Access violation |
| 10 | # $0000000000575F5F line 590 of exttools.pas |
| 11 | # $000000000057A027 line 1525 of exttools.pas |
| 12 | # $000000000057B231 line 1814 of exttools.pas |
| 13 | # ) |
| 14 | # ... the script will clean CGE dir and just retry. |
| 15 | |
| 16 | LPI_FILENAME="$1" |
| 17 | |
| 18 | # For easy testing of "examples-laz" |
| 19 | # echo lazbuild "${LPI_FILENAME}" |
| 20 | # exit 0 |
| 21 | |
| 22 | if ! lazbuild "${LPI_FILENAME}"; then |
| 23 | echo '1st execution of lazbuild failed, trying again' |
| 24 | make clean |
| 25 | # Note: Hopefully it doesn't need to recompile all CGE LPK packages here. |
| 26 | lazbuild ${CASTLE_LAZBUILD_OPTIONS:-} "${LPI_FILENAME}" |
| 27 | fi |