Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 2 | set -ex |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 3 | |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 4 | git submodule sync |
| 5 | git submodule update --init |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 6 | |
Davide Pesavento | ab7300b | 2020-04-09 00:51:41 -0400 | [diff] [blame] | 7 | if [[ -z $DISABLE_ASAN ]]; then |
| 8 | ASAN="--with-sanitizer=address" |
| 9 | fi |
| 10 | if [[ $JOB_NAME == *"code-coverage" ]]; then |
| 11 | COVERAGE="--with-coverage" |
| 12 | fi |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 13 | if has CentOS-8 $NODE_LABELS; then |
| 14 | # https://bugzilla.redhat.com/show_bug.cgi?id=1721553 |
| 15 | PCH="--without-pch" |
| 16 | fi |
| 17 | |
Davide Pesavento | 0530b5b | 2016-11-07 03:23:58 +0100 | [diff] [blame] | 18 | if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 19 | # Build static library in release mode with tests and without precompiled headers |
| 20 | ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 21 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 22 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 23 | # Cleanup |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 24 | ./waf --color=yes distclean |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 25 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 26 | # Build static and shared library in release mode without tests |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 27 | ./waf --color=yes configure --enable-static --enable-shared $PCH |
| 28 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 29 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 30 | # Cleanup |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 31 | ./waf --color=yes distclean |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 32 | fi |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 33 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 34 | # Build shared library in debug mode with tests and examples |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 35 | ./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $PCH |
| 36 | ./waf --color=yes build -j$WAF_JOBS |
Davide Pesavento | dfe9c6b | 2014-08-25 21:17:10 +0200 | [diff] [blame] | 37 | |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 38 | # (tests will be run against the debug version) |
Alexander Afanasyev | a87e0a8 | 2014-10-21 14:09:19 -0400 | [diff] [blame] | 39 | |
| 40 | # Install |
Davide Pesavento | cdb5d8f | 2018-09-05 22:27:49 -0400 | [diff] [blame] | 41 | sudo_preserve_env PATH -- ./waf --color=yes install |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 42 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 43 | if has CentOS-8 $NODE_LABELS; then |
| 44 | sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64 |
| 45 | fi |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 46 | if has Linux $NODE_LABELS; then |
| 47 | sudo ldconfig |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 48 | fi |