Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame] | 4 | if [[ -z $DISABLE_ASAN ]]; then |
Davide Pesavento | 5188f31 | 2019-03-18 18:38:45 -0400 | [diff] [blame] | 5 | ASAN="--with-sanitizer=address" |
| 6 | fi |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame] | 7 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 8 | COVERAGE="--with-coverage" |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 9 | fi |
| 10 | |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 11 | set -x |
| 12 | |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame] | 13 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
| 14 | # Build in release mode with tests |
| 15 | ./waf --color=yes configure --with-tests |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 16 | ./waf --color=yes build |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 17 | |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame] | 18 | # Cleanup |
| 19 | ./waf --color=yes distclean |
| 20 | |
| 21 | # Build in release mode without tests |
| 22 | ./waf --color=yes configure |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 23 | ./waf --color=yes build |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame] | 24 | |
| 25 | # Cleanup |
| 26 | ./waf --color=yes distclean |
| 27 | fi |
| 28 | |
| 29 | # Build in debug mode with tests |
| 30 | ./waf --color=yes configure --debug --with-tests $ASAN $COVERAGE |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 31 | ./waf --color=yes build |
Davide Pesavento | a0546db | 2020-04-01 19:18:04 -0400 | [diff] [blame] | 32 | |
| 33 | # (tests will be run against the debug version) |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 34 | |
| 35 | # Install |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 36 | sudo ./waf --color=yes install |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 37 | |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 38 | if [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 9c4bd6d | 2022-07-26 15:28:08 -0400 | [diff] [blame] | 39 | sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64 |
| 40 | fi |
Davide Pesavento | 15a7442 | 2022-08-19 15:48:45 -0400 | [diff] [blame] | 41 | if [[ $ID_LIKE == *linux* ]]; then |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 42 | sudo ldconfig |
Davide Pesavento | 7ef57e2 | 2017-10-28 16:58:43 -0400 | [diff] [blame] | 43 | fi |