Skip to content

Commit 76f5af0

Browse files
authored
Merge pull request #951 from kovdan01/add_span_support
Modernize codebase
2 parents be4d971 + d04b1e7 commit 76f5af0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+4151
-3820
lines changed

.github/depends/boost.sh

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
usage()
44
{
55
cat <<EOL
66
-b - 32-bit or 64-bit library, maybe 32, 64 or both
77
-t - the toolset, maybe gcc, clang or both
8+
-p - installation prefix
89
EOL
910
}
1011

1112
build_boost()
1213
{
13-
BASE=`pwd`/..
14-
./b2 -j4 --toolset=$1 --prefix=${BASE}/usr --libdir="${BASE}/usr/$1/lib$2" --with-chrono --with-context --with-filesystem --with-system --with-timer address-model=$2 install
14+
./b2 \
15+
--toolset=$1 \
16+
--prefix=$3/$2 \
17+
--with-test \
18+
--with-headers \
19+
--with-chrono \
20+
--with-context \
21+
--with-filesystem \
22+
--with-system \
23+
--with-timer \
24+
address-model=$2 \
25+
install || exit 1
1526
}
1627

1728
bit="64"
1829
toolset="gcc"
30+
prefix="$HOME/boost-prefix"
1931

20-
while getopts "b:t:" c; do
32+
while getopts "b:t:p:" c; do
2133
case "$c" in
2234
b)
2335
bit="$OPTARG"
@@ -27,24 +39,28 @@ while getopts "b:t:" c; do
2739
toolset="$OPTARG"
2840
[ "$toolset" != "gcc" ] && [ "$toolset" != "clang" ] && [ "$toolset" != "both" ] && usage && exit 1
2941
;;
42+
p)
43+
prefix="$OPTARG"
44+
;;
3045
?*)
3146
echo "invalid arguments." && exit 1
3247
;;
3348
esac
3449
done
3550

36-
wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2
37-
tar xf boost_1_72_0.tar.bz2
38-
cd boost_1_72_0
39-
./bootstrap.sh
51+
mkdir $prefix || exit 1
52+
wget https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 || exit 1
53+
tar xf boost_1_76_0.tar.bz2 || exit 1
54+
cd boost_1_76_0
55+
./bootstrap.sh || exit 1
4056

4157
build()
4258
{
4359
if [ "$bit" = "both" ]; then
44-
build_boost $1 32
45-
build_boost $1 64
60+
build_boost $1 32 $prefix
61+
build_boost $1 64 $prefix
4662
else
47-
build_boost $1 $bit
63+
build_boost $1 $bit $prefix
4864
fi
4965
}
5066

.github/depends/zlib.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
usage()
4+
{
5+
cat <<EOL
6+
-b - 32-bit or 64-bit library, maybe 32 or 64
7+
-p - installation prefix
8+
EOL
9+
}
10+
11+
bit="64"
12+
prefix="$HOME/zlib-prefix"
13+
14+
while getopts "b:t:p:" c; do
15+
case "$c" in
16+
b)
17+
bit="$OPTARG"
18+
[ "$bit" != "32" ] && [ "$bit" != "64" ] && [ "$bit" != "both" ] && usage && exit 1
19+
;;
20+
p)
21+
prefix="$OPTARG"
22+
;;
23+
?*)
24+
echo "invalid arguments." && exit 1
25+
;;
26+
esac
27+
done
28+
29+
mkdir $prefix || exit 1
30+
wget https://zlib.net/zlib-1.2.11.tar.gz || exit 1
31+
tar -xf zlib-1.2.11.tar.gz || exit 1
32+
cd zlib-1.2.11
33+
34+
build()
35+
{
36+
cmake \
37+
-D CMAKE_BUILD_TYPE=Release \
38+
-D CMAKE_INSTALL_PREFIX=$2/$1 \
39+
-D CMAKE_C_FLAGS="-m$1" \
40+
-D CMAKE_SHARED_LINKER_FLAGS="-m$1" \
41+
-B build$1 \
42+
-S .
43+
cmake --build build$1 --target install
44+
}
45+
46+
if [ "$bit" = "both" ]; then
47+
build 32 $prefix
48+
build 64 $prefix
49+
else
50+
build $bit $prefix
51+
fi

.github/workflows/coverage.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,58 @@ on:
1010
- '*'
1111

1212
jobs:
13-
1413
codecov:
1514
timeout-minutes: 30
1615
runs-on: ubuntu-latest
1716

1817
steps:
1918
- uses: actions/checkout@v1
20-
- name: install depends
19+
- name: Install build dependencies
2120
run: |
2221
sudo apt-get update
23-
sudo apt-get install g++-multilib lcov
22+
sudo apt-get install g++-10 cmake lcov -y
23+
./ci/set_gcc_10.sh
24+
2425
- name: Cache boost
2526
id: cache-boost
2627
uses: actions/cache@v1
2728
with:
28-
path: usr
29-
key: ${{ runner.os }}-boost-20210508-1-72-0
29+
path: ~/boost-prefix/
30+
key: ${{ runner.os }}-boost-64-1-76-0-2021-08-09
31+
3032
- name: Build boost
3133
if: steps.cache-boost.outputs.cache-hit != 'true'
32-
run: ./.github/depends/boost.sh -b both -t gcc
34+
run: ./.github/depends/boost.sh -b 64 -t gcc -p $HOME/boost-prefix
35+
36+
- name: Cache zlib
37+
id: cache-zlib
38+
uses: actions/cache@v1
39+
with:
40+
path: ~/zlib-prefix/
41+
key: ${{ runner.os }}-zlib-64-1-2-11-2021-08-09
42+
43+
- name: Build zlib
44+
if: steps.cache-zlib.outputs.cache-hit != 'true'
45+
run: ./.github/depends/zlib.sh -b 64 -p $HOME/zlib-prefix
46+
3347
- name: Compile tests
3448
run: |
35-
# install gtest
36-
BASE=`pwd`
37-
wget https://github.com/google/googletest/archive/release-1.7.0.zip -O googletest-release-1.7.0.zip
38-
unzip -q googletest-release-1.7.0.zip
39-
cd googletest-release-1.7.0
40-
g++ -m64 src/gtest-all.cc -I. -Iinclude -c -fPIC
41-
g++ -m64 src/gtest_main.cc -I. -Iinclude -c -fPIC
42-
ar -rv libgtest.a gtest-all.o
43-
ar -rv libgtest_main.a gtest_main.o
44-
mkdir -p ${BASE}/usr/include
45-
cp -r include/gtest ${BASE}/usr/include
46-
mkdir -p ${BASE}/usr/lib
47-
mv *.a ${BASE}/usr/lib
48-
cd ..
49-
50-
mkdir build && cd build
51-
CMAKE_LIBRARY_PATH="${BASE}/build" GTEST_ROOT="${BASE}/usr" CMAKE_PREFIX_PATH="${BASE}/usr/gcc/lib64/cmake" cmake -DMSGPACK_CXX17=ON -DMSGPACK_32BIT=OFF -DMSGPACK_CHAR_SIGN=signed -DMSGPACK_USE_X3_PARSE=ON -DMSGPACK_BUILD_EXAMPLES=ON -DMSGPACK_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DMSGPACK_GEN_COVERAGE=ON ..
52-
make -j4
53-
make test
49+
mkdir build
50+
cmake \
51+
-D MSGPACK_CXX20=ON \
52+
-D MSGPACK_32BIT=OFF \
53+
-D MSGPACK_CHAR_SIGN=signed \
54+
-D MSGPACK_USE_X3_PARSE=ON \
55+
-D MSGPACK_BUILD_EXAMPLES=ON \
56+
-D MSGPACK_BUILD_TESTS=ON \
57+
-D CMAKE_BUILD_TYPE=Debug \
58+
-D MSGPACK_GEN_COVERAGE=ON \
59+
-D CMAKE_PREFIX_PATH="$HOME/zlib-prefix/64;$HOME/boost-prefix/64" \
60+
-B build \
61+
-S . || exit 1
62+
cmake --build build --target all || exit 1
63+
ctest --test-dir build || exit 1
64+
5465
- name: Upload coverage to Codecov
5566
working-directory: build
5667
run: |

0 commit comments

Comments
 (0)