Skip to content

Commit

Permalink
feat(udf): json functions (#3414)
Browse files Browse the repository at this point in the history
  • Loading branch information
aceforeverd authored and dl239 committed Sep 19, 2023
1 parent 0446706 commit 56fb5a8
Show file tree
Hide file tree
Showing 12 changed files with 48,808 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ include(FetchContent)
set(FETCHCONTENT_QUIET OFF)
include(farmhash)

# contrib libs
add_subdirectory(contrib EXCLUDE_FROM_ALL)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(OS_LIB ${CMAKE_THREAD_LIBS_INIT} rt)
set(BRPC_LIBS ${BRPC_LIBRARY} ${Protobuf_LIBRARIES} ${GLOG_LIBRARY} ${GFLAGS_LIBRARY} ${UNWIND_LIBRARY} ${OPENSSL_LIBRARIES} ${LEVELDB_LIBRARY} ${Z_LIBRARY} ${SNAPPY_LIBRARY} dl pthread ${OS_LIB})
Expand Down
2 changes: 1 addition & 1 deletion CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
linelength=120
filter=-build/c++11
filter=-build/c++11,-build/include_subdir
28 changes: 28 additions & 0 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)

# add_contrib cmake_folder[ base_folder1[, ...base_folderN]]
# or add_contrib base_folder
function(add_contrib cmake_folder)
if (ARGN)
set(base_folders ${ARGN})
else()
set(base_folders ${cmake_folder})
endif()

foreach (base_folder ${base_folders})
if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${base_folder}")
message(FATAL_ERROR "No such base folder '${base_folder}' (for '${cmake_folder}' cmake folder). Typo in the base folder name?")
endif()

file(GLOB contrib_files "${base_folder}/*")
if (NOT contrib_files)
message(FATAL_ERROR "submodule ${base_folder} is missing or empty.")
endif()
endforeach()

message(STATUS "Adding contrib module ${base_folders} (configuring with ${cmake_folder})")
add_subdirectory (${cmake_folder})
endfunction()

add_contrib(simdjson)

10 changes: 10 additions & 0 deletions contrib/simdjson/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
add_library(_simdjson ${CMAKE_CURRENT_SOURCE_DIR}/simdjson.cpp)
target_include_directories(_simdjson SYSTEM PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/")

# simdjson is using its own CPU dispatching and get confused if we enable AVX/AVX2 flags.
if(ARCH_AMD64)
target_compile_options(_simdjson PRIVATE -mno-avx -mno-avx2)
endif()

add_library(op_contrib::simdjson ALIAS _simdjson)

1 change: 1 addition & 0 deletions contrib/simdjson/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
smidjson v3.2.1: https://github.com/simdjson/simdjson/releases/tag/v3.2.1
Loading

0 comments on commit 56fb5a8

Please sign in to comment.