Skip to content

Commit 2c25f93

Browse files
feature(scripts): compilation scripts for libuv and cpp drivers
Signed-off-by: Dusan Malusev <dusan.malusev@scylladb.com>
1 parent f30ffae commit 2c25f93

File tree

3 files changed

+74
-14
lines changed

3 files changed

+74
-14
lines changed

scripts/compile-cpp-driver.sh

Lines changed: 44 additions & 0 deletions
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

scripts/compile-libuv.sh

Lines changed: 30 additions & 0 deletions
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

scripts/compile-scylladb.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy