Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 2 | set -ex |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 3 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 4 | git submodule sync |
| 5 | git submodule update --init |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 6 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 7 | if [[ -z $DISABLE_ASAN ]]; then |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 8 | ASAN="--with-sanitizer=address" |
| 9 | fi |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 10 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 11 | COVERAGE="--with-coverage" |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 12 | fi |
| 13 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 14 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
| 15 | # Build in release mode with tests |
| 16 | ./waf --color=yes configure --with-tests |
| 17 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 18 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 19 | # Cleanup |
| 20 | ./waf --color=yes distclean |
| 21 | |
| 22 | # Build in release mode without tests |
| 23 | ./waf --color=yes configure |
| 24 | ./waf --color=yes build -j$WAF_JOBS |
| 25 | |
| 26 | # Cleanup |
| 27 | ./waf --color=yes distclean |
| 28 | fi |
| 29 | |
Davide Pesavento | d4689c8 | 2021-10-07 02:53:03 -0400 | [diff] [blame] | 30 | # Build in debug mode with tests and examples |
| 31 | ./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 32 | ./waf --color=yes build -j$WAF_JOBS |
| 33 | |
| 34 | # (tests will be run against the debug version) |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 35 | |
| 36 | # Install |
| 37 | sudo_preserve_env PATH -- ./waf --color=yes install |
| 38 | |
Davide Pesavento | 7e7bd89 | 2022-07-10 00:30:06 -0400 | [diff] [blame^] | 39 | if has CentOS $NODE_LABELS; then |
| 40 | sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64 |
| 41 | fi |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 42 | if has Linux $NODE_LABELS; then |
| 43 | sudo ldconfig |
Davide Pesavento | 8f9d062 | 2018-11-27 01:23:37 -0500 | [diff] [blame] | 44 | fi |