#!/bin/bash
SCRIPTDIR=$(readlink -f $(dirname "$0"))
cd "$SCRIPTDIR"/subhook
cmake -DSUBHOOK_FORCE_32BIT=1 -DSUBHOOK_STATIC=1 -DSUBHOOK_TESTS=0 -DCMAKE_INSTALL_PREFIX:PATH="$SCRIPTDIR/subhook_x86" .
make -j$(nproc) && make install
cd "$SCRIPTDIR"/cpputest/cpputest_build
cmake -DCPPUTEST_C_FLAGS=-m32 -DCPPUTEST_CXX_FLAGS=-m32 -DCPPUTEST_LD_FLAGS=-m32 \
    -DC++11=ON -DTESTS=OFF -DCMAKE_INSTALL_PREFIX:PATH="$SCRIPTDIR"/cpputest_x86 ..
make -j$(nproc) && make install
