Skip to content

Commit

Permalink
feat: offline with git submodule (#3787)
Browse files Browse the repository at this point in the history
  • Loading branch information
QiChenX committed Mar 4, 2024
1 parent c2e77b2 commit f35f26b
Show file tree
Hide file tree
Showing 10 changed files with 12,210 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "gflags"]
path = contrib/gflags
url = https://github.com/gflags/gflags
[submodule "contrib/rapidjson"]
path = contrib/rapidjson
url = https://github.com/Tencent/rapidjson.git
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ else()
set(RocksDB_LIB ${RocksDB_LIBRARY})
endif()

# third party sources
include(FetchContent)
set(FETCHCONTENT_QUIET OFF)
include(farmhash)
include(rapidjson)

# contrib libs
add_subdirectory(contrib EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -298,6 +294,7 @@ include_directories(
${LLVM_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${CMAKE_PREFIX_PATH}/include
${PROJECT_SOURCE_DIR}/contrib/rapidjson/include
)

link_directories(
Expand Down
17 changes: 0 additions & 17 deletions cmake/farmhash.cmake

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/rapidjson.cmake

This file was deleted.

2 changes: 2 additions & 0 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function(add_contrib cmake_folder)
endfunction()

add_contrib(simdjson)
add_contrib(rapidjson)
add_contrib(farmhash)

if (BUILD_SHARED_LIBS)
add_contrib(gflags-cmake gflags)
Expand Down
12 changes: 12 additions & 0 deletions contrib/farmhash/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

add_library(farmhash ${CMAKE_CURRENT_SOURCE_DIR}/src/farmhash.cc)
target_include_directories(farmhash SYSTEM PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src/")
set_target_properties(farmhash
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
target_compile_definitions(farmhash
PUBLIC NAMESPACE_FOR_HASH_FUNCTIONS=farmhash)

add_library(op_contrib::farmhash ALIAS farmhash)

0 comments on commit f35f26b

Please sign in to comment.