Skip to content

Commit

Permalink
feat: support to build a portable rocksdb binary (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
empiredan authored Dec 27, 2020
1 parent f27decf commit 60831d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function usage_build()
echo " e.g., \"dsn_runtime_tests,dsn_meta_state_tests\","
echo " if not set, then run all tests"
fi

echo " --enable_rocksdb_portable build a portable rocksdb binary"
}
function run_build()
{
Expand All @@ -82,6 +84,7 @@ function run_build()
CHECK=NO
SANITIZER=""
TEST_MODULE=""
ROCKSDB_PORTABLE=OFF
while [[ $# > 0 ]]; do
key="$1"
case $key in
Expand Down Expand Up @@ -153,6 +156,9 @@ function run_build()
TEST_MODULE="$2"
shift
;;
--enable_rocksdb_portable)
ROCKSDB_PORTABLE=ON
;;
*)
echo "ERROR: unknown option \"$key\""
echo
Expand Down Expand Up @@ -180,7 +186,8 @@ function run_build()
echo "Start building third-parties..."
mkdir -p build
pushd build
cmake .. -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DCMAKE_BUILD_TYPE=Release
cmake .. -DCMAKE_C_COMPILER=$C_COMPILER -DCMAKE_CXX_COMPILER=$CXX_COMPILER -DCMAKE_BUILD_TYPE=Release \
-DROCKSDB_PORTABLE=${ROCKSDB_PORTABLE}
make -j$JOB_NUM
exit_if_fail $?
popd
Expand Down
3 changes: 3 additions & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ ExternalProject_Add(s2geometry
DEPENDS googletest
)

option(ROCKSDB_PORTABLE "build a portable binary" OFF)

ExternalProject_Add(rocksdb
URL ${OSS_URL_PREFIX}/pegasus-rocksdb-6.6.4-compatible.zip
https://github.com/XiaoMi/pegasus-rocksdb/archive/v6.6.4-compatible.zip
Expand All @@ -311,6 +313,7 @@ ExternalProject_Add(rocksdb
-DUSE_RTTI=ON
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DPORTABLE=${ROCKSDB_PORTABLE}
)

# kerberos
Expand Down

0 comments on commit 60831d6

Please sign in to comment.