2022-09-25 12:10:27 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
. sdk.sh
|
2022-11-13 17:35:33 +01:00
|
|
|
LEVELDB_VERSION=1.23
|
2022-09-25 12:10:27 +02:00
|
|
|
|
|
|
|
if [ ! -d leveldb-src ]; then
|
2022-11-13 17:35:33 +01:00
|
|
|
git clone -b $LEVELDB_VERSION --depth 1 https://github.com/google/leveldb leveldb-src
|
2022-09-25 12:10:27 +02:00
|
|
|
mkdir leveldb-src/build
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -rf leveldb
|
|
|
|
|
|
|
|
cd leveldb-src/build
|
|
|
|
|
|
|
|
cmake .. \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_C_FLAGS="$OSX_FLAGS $OSX_ARCH" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$OSX_FLAGS $OSX_ARCH" \
|
|
|
|
-DLEVELDB_BUILD_TESTS=FALSE \
|
|
|
|
-DLEVELDB_BUILD_BENCHMARKS=FALSE \
|
|
|
|
-DLEVELDB_INSTALL=FALSE
|
2022-11-13 17:35:33 +01:00
|
|
|
|
2022-09-25 12:10:27 +02:00
|
|
|
cmake --build . -j
|
|
|
|
|
|
|
|
mkdir -p ../../leveldb
|
2022-11-13 17:35:33 +01:00
|
|
|
cp -v libleveldb.a ../../leveldb
|
|
|
|
cp -rv ../include ../../leveldb/include
|
2022-09-25 12:10:27 +02:00
|
|
|
|
|
|
|
echo "LevelDB build successful"
|