Updates for v12.2.0 release (#1289)
[dyninst.git] / docker / build.sh
1 #!/bin/bash
2 set -euo pipefail
3
4 printf "⭐️ Setting up spack environment for Dyninst\n"
5 . /opt/spack/share/spack/setup-env.sh
6 spack env activate .
7
8 # 1. Build Dyninst
9 printf "⭐️ Preparing to build Dyninst\n"
10 echo "::group::build dyninst"
11
12 DYNINST_BUILD_DIR=/opt/dyninst-env/build/dyninst
13 mkdir -p $DYNINST_BUILD_DIR
14
15 DYNINST_INSTALL_DIR=/opt/dyninst-env/install/dyninst
16 mkdir -p $DYNINST_INSTALL_DIR
17
18 CMAKE_WERROR_FLAGS='-DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
19 cmake -S /code -B $DYNINST_BUILD_DIR -DCMAKE_INSTALL_PREFIX=$DYNINST_INSTALL_DIR $CMAKE_WERROR_FLAGS
20 cmake --build $DYNINST_BUILD_DIR --target all --parallel 2 -- VERBOSE=1
21 cmake --install $DYNINST_BUILD_DIR
22
23 echo "::endgroup::"