Skip to content

Commit

Permalink
Install boost manually.
Browse files Browse the repository at this point in the history
  • Loading branch information
redboltz committed Mar 8, 2021
1 parent 0a0c6a9 commit 3e0161d
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .github/depends/boost.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/sh

usage()
{
cat <<EOL
-b - 32-bit or 64-bit library, maybe 32, 64 or both
-t - the toolset, maybe gcc, clang or both
EOL
}

build_boost()
{
BASE=`pwd`/..
./b2 -j4 --toolset=$1 --prefix=${BASE}/usr --libdir="${BASE}/usr/$1/lib$2" --with-chrono --with-date_time --with-filesystem --with-system --with-thread --with-program_options --with-log --with-test address-model=$2 install
}

bit="64"
toolset="gcc"

while getopts "b:t:" c; do
case "$c" in
b)
bit="$OPTARG"
[ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1
;;
t)
toolset="$OPTARG"
[ "$toolset" != "gcc" ] && [ "$toolset" != "clang" ] && [ "$toolset" != "both" ] && usage && exit 1
;;
?*)
echo "invalid arguments." && exit 1
;;
esac
done

wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2
tar xf boost_1_72_0.tar.bz2
cd boost_1_72_0
./bootstrap.sh

build()
{
if [ "$bit" = "both" ]; then
build_boost $1 32
build_boost $1 64
else
build_boost $1 $bit
fi
}

if [ "$toolset" = "both" ]; then
build gcc
build clang
else
build $toolset
fi
15 changes: 14 additions & 1 deletion .github/workflows/gha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache boost
id: cache-boost
uses: actions/cache@v1
with:
path: usr
key: ${{ runner.os }}-boost-20200107
- name: Build boost
if: steps.cache-boost.outputs.cache-hit != 'true'
run: ./.github/depends/boost.sh -b 64 -t gcc
- name: Configure
env:
S_CFLAGS: -Werror -g -Wall -Wextra -Wno-ignored-qualifiers -Wconversion -fno-omit-frame-pointer -fsanitize=address
Expand All @@ -73,7 +82,11 @@ jobs:
[ ${{ matrix.pattern }} == 6 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=ON -DMQTT_TEST_6=ON -DMQTT_TEST_7=OFF -DMQTT_BUILD_EXAMPLES=OFF -DMQTT_USE_TLS=ON -DMQTT_USE_WS=ON -DMQTT_USE_STR_CHECK=ON -DMQTT_USE_LOG=OFF -DMQTT_STD_ANY=ON -DMQTT_STD_OPTIONAL=ON -DMQTT_STD_VARIANT=ON -DMQTT_STD_STRING_VIEW=ON -DMQTT_STD_SHARED_PTR_ARRAY=OFF"
[ ${{ matrix.pattern }} == 7 ] && FLAGS="-DCMAKE_CXX_COMPILER=g++ -DMQTT_CODECOV=ON -DMQTT_TEST_1=OFF -DMQTT_TEST_2=OFF -DMQTT_TEST_3=OFF -DMQTT_TEST_4=OFF -DMQTT_TEST_5=OFF -DMQTT_TEST_6=OFF -DMQTT_TEST_7=ON -DMQTT_BUILD_EXAMPLES=ON -DMQTT_USE_TLS=ON -DMQTT_USE_WS=OFF -DMQTT_USE_STR_CHECK=OFF -DMQTT_USE_LOG=ON -DMQTT_STD_ANY=OFF -DMQTT_STD_OPTIONAL=OFF -DMQTT_STD_VARIANT=OFF -DMQTT_STD_STRING_VIEW=OFF -DMQTT_STD_SHARED_PTR_ARRAY=OFF"
BOOST_ROOT=$BOOST_ROOT_1_72_0 cmake -S ${{ github.workspace }} -B ${{ runner.temp }} ${FLAGS} -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
echo "begin"
echo ${{env.BOOST_ROOT}}
echo "end"
ls -al /home/runner/work/mqtt_cpp/mqtt_cpp/usr/gcc
BOOST_ROOT=/home/runner/work/mqtt_cpp/mqtt_cpp/usr/gcc cmake -S ${{ github.workspace }} -B ${{ runner.temp }} ${FLAGS} -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DCMAKE_EXE_LINKER_FLAGS="${LDFLAGS}"
- name: Check Header Dependencies
run: |
cmake --build ${{ runner.temp }} --parallel $(nproc) --clean-first --target check_deps
Expand Down

0 comments on commit 3e0161d

Please sign in to comment.