Skip to content

Commit

Permalink
snappy
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 4, 2023
1 parent bf275fe commit 648caf4
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif ()
endif ()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(OpenSSL REQUIRED)

include(ExternalProject)
Expand Down Expand Up @@ -361,6 +365,33 @@ ExternalProject_Add(jemalloc
DOWNLOAD_NO_PROGRESS true
)

set(SNAPPY_OPTIONS
-DCMAKE_INSTALL_PREFIX=${TP_OUTPUT}
-DBUILD_SHARED_LIBS=OFF
-DSNAPPY_BUILD_TESTS=OFF
-DSNAPPY_BUILD_BENCHMARKS=OFF
-DSNAPPY_FUZZING_BUILD=OFF
-DSNAPPY_INSTALL=ON)
execute_process(COMMAND arch OUTPUT_VARIABLE ARCH_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "ARCH_NAME = ${ARCH_NAME}")
if (ARCH_NAME EQUAL "x86_64")
set(SNAPPY_OPTIONS
${SNAPPY_OPTIONS}
-DSNAPPY_REQUIRE_AVX=ON
-DSNAPPY_REQUIRE_AVX2=ON)
endif ()
ExternalProject_Add(snappy
URL ${OSS_URL_PREFIX}/snappy-1.1.10.tar.gz
https://github.com/google/snappy/archive/refs/tags/1.1.10.tar.gz
URL_MD5 70153395ebe6d72febe2cf2e40026a44
PATCH_COMMAND ""
CMAKE_ARGS ${SNAPPY_OPTIONS}
BUILD_COMMAND make -j${PARALLEL}
INSTALL_COMMAND make install
DOWNLOAD_EXTRACT_TIMESTAMP true
DOWNLOAD_NO_PROGRESS true
)

option(ROCKSDB_PORTABLE "Minimum CPU arch to support, or 0 = current CPU, 1 = baseline CPU" 0)
set(ROCKSDB_OPTIONS
-DFAIL_ON_WARNINGS=OFF
Expand Down

0 comments on commit 648caf4

Please sign in to comment.