Skip to content

Commit 3724bdd

Browse files
Merge pull request he4rt#104 from he4rt/feat/better-compilation-scripts
feature(scripts): compilation scripts for libuv and cpp drivers
2 parents f30ffae + 2c25f93 commit 3724bdd

File tree

3 files changed

+74
-14
lines changed

3 files changed

+74
-14
lines changed

Diff for: scripts/compile-cpp-driver.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
SCYLLA_OR_CASSANDRA=$1
2+
CURRENT_DIR="$(pwd)"
3+
4+
if [ -z "$SCYLLA_OR_CASSANDRA" ]; then
5+
SCYLLA_OR_CASSANDRA="scylladb"
6+
fi
7+
8+
if [ "$SCYLLA_OR_CASSANDRA" = "scylladb" ]; then
9+
GIT_REPO="https://github.com/scylladb/cpp-driver.git"
10+
GIT_OUTPUT="/opt/scylladb-driver"
11+
else
12+
GIT_REPO="https://github.com/datastax/cpp-driver.git"
13+
GIT_OUTPUT="/opt/cassandra-driver"
14+
fi
15+
16+
git clone --depth 1 "$GIT_REPO" "$GIT_OUTPUT"
17+
18+
cd "$GIT_OUTPUT" || exit 1
19+
20+
mkdir build || exit 1
21+
22+
cd build || exit 1
23+
24+
CFLAGS="-fPIC" CXXFLAGS="-fPIC -Wno-error=redundant-move" LDFLAGS="-flto" cmake -G Ninja \
25+
-DCASS_CPP_STANDARD=17 \
26+
-DCASS_BUILD_STATIC=ON \
27+
-DCASS_BUILD_SHARED=ON \
28+
-DCASS_USE_STD_ATOMIC=ON \
29+
-DCASS_USE_STATIC_LIBS=ON \
30+
-DCASS_USE_TIMERFD=ON \
31+
-DCASS_USE_LIBSSH2=ON \
32+
-DCASS_USE_ZLIB=ON \
33+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
34+
-DCMAKE_EXPORT_COMPILE_COMMANDS="OFF" \
35+
-DCMAKE_BUILD_TYPE="RelWithInfo" \
36+
..
37+
38+
CFLAGS="-fPIC" CXXFLAGS="-fPIC -Wno-error=redundant-move" LDFLAGS="-flto" ninja install
39+
40+
cd .. || exit
41+
42+
rm -rf build
43+
44+
cd "$CURRENT_DIR" || exit 1

Diff for: scripts/compile-libuv.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
LIBUV_VERSION="v1.48.0"
2+
LIBUV_REPO="https://github.com/libuv/libuv.git"
3+
CURRENT_DIR="$(pwd)"
4+
5+
git clone --depth=1 "$LIBUV_REPO" /opt/libuv
6+
7+
cd /opt/libuv || exit 1
8+
9+
git fetch --tags
10+
11+
git checkout -b $LIBUV_VERSION tags/$LIBUV_VERSION
12+
13+
mkdir build || exit 1
14+
15+
cd build || exit 1
16+
17+
LDFLAGS="-flto" CFLAGS="-fPIC" cmake -G Ninja \
18+
-DBUILD_TESTING=OFF \
19+
-DBUILD_BENCHMARKS=OFF \
20+
-DLIBUV_BUILD_SHARED=ON \
21+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
22+
-DCMAKE_BUILD_TYPE="RelWithInfo" ..
23+
24+
LDFLAGS="-flto" CFLAGS="-fPIC" ninja install
25+
26+
cd .. || exit
27+
28+
rm -rf build
29+
30+
cd "$CURRENT_DIR" || exit 1

Diff for: scripts/compile-scylladb.sh

-14
This file was deleted.

0 commit comments

Comments
 (0)