Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 2 | set -eo pipefail |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 3 | |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -0400 | [diff] [blame] | 4 | if [[ -z $DISABLE_ASAN ]]; then |
Davide Pesavento | cf9ffe4 | 2018-01-21 22:21:53 -0500 | [diff] [blame] | 5 | ASAN="--with-sanitizer=address" |
| 6 | fi |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -0400 | [diff] [blame] | 7 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 8 | COVERAGE="--with-coverage" |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 9 | fi |
| 10 | |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 11 | set -x |
| 12 | |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -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 | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 16 | ./waf --color=yes build |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 17 | |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -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 | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 23 | ./waf --color=yes build |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -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 | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 31 | ./waf --color=yes build |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -0400 | [diff] [blame] | 32 | |
| 33 | # (tests will be run against the debug version) |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 34 | |
| 35 | # Install |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 36 | sudo ./waf --color=yes install |
Zhiyi Zhang | 7021a93 | 2017-03-17 10:26:51 -0700 | [diff] [blame] | 37 | |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 38 | if [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | 573a621 | 2022-07-09 21:56:41 -0400 | [diff] [blame] | 39 | sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64 |
| 40 | fi |
Davide Pesavento | 6d1b672 | 2022-08-20 17:54:05 -0400 | [diff] [blame^] | 41 | if [[ $ID_LIKE == *linux* ]]; then |
Zhiyi Zhang | 7021a93 | 2017-03-17 10:26:51 -0700 | [diff] [blame] | 42 | sudo ldconfig |
Zhiyi Zhang | 7021a93 | 2017-03-17 10:26:51 -0700 | [diff] [blame] | 43 | fi |