| # Licensed to the Apache Software Foundation (ASF) under one | |
| # or more contributor license agreements. See the NOTICE file | |
| # distributed with this work for additional information | |
| # regarding copyright ownership. The ASF licenses this file | |
| # to you under the Apache License, Version 2.0 (the | |
| # "License"); you may not use this file except in compliance | |
| # with the License. You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # Adapted from Apache Arrow: | |
| # https://github.com/apache/arrow/blob/apache-arrow-17.0.0/cpp/CMakeLists.txt | |
| cmake_minimum_required(VERSION 3.22) | |
| # 3.22 is the minimum required by Corrosion-rs (used for the Rust<->C++ FFI | |
| # integration, see crates/lance_ffi). Ubuntu 24.04 ships CMake 3.28 and | |
| # CentOS 8+/RHEL 9+ ship 3.20+, so older distributions need a newer CMake | |
| # installation. | |
| message(STATUS "Building using CMake version: ${CMAKE_VERSION}") | |
| # https://cmake.org/cmake/help/latest/policy/CMP0135.html | |
| # | |
| # CMP0135 is for solving re-building and re-downloading. | |
| # We don't have a real problem with the OLD behavior for now | |
| # but we use the NEW behavior explicitly to suppress CMP0135 | |
| # warnings. | |
| if(POLICY CMP0135) | |
| cmake_policy(SET CMP0135 NEW) | |
| endif() | |
| if(NOT CMAKE_BUILD_TYPE) | |
| set(CMAKE_BUILD_TYPE | |
| Release | |
| CACHE STRING "Choose the type of build.") | |
| endif() | |
| project(paimon | |
| VERSION 0.4.0 | |
| DESCRIPTION "Paimon C++ Project") | |
| string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_BUILD_TYPE) | |
| set(CMAKE_CXX_STANDARD 17) | |
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | |
| set(CMAKE_CXX_EXTENSIONS OFF) | |
| set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | |
| option(PAIMON_BUILD_STATIC "Build static library" ON) | |
| option(PAIMON_BUILD_SHARED "Build shared library" ON) | |
| option(PAIMON_BUILD_TESTS "Build tests" OFF) | |
| option(PAIMON_BUILD_BENCHMARKS "Build benchmarks" OFF) | |
| option(PAIMON_USE_ASAN "Use Address Sanitizer" OFF) | |
| option(PAIMON_USE_UBSAN "Use Undefined Behavior Sanitizer" OFF) | |
| option(PAIMON_USE_CXX11_ABI "Use C++11 ABI" ON) | |
| option(PAIMON_ENABLE_AVRO "Whether to enable avro file format" ON) | |
| option(PAIMON_ENABLE_ORC "Whether to enable orc file format" ON) | |
| option(PAIMON_ENABLE_MOSAIC "Whether to enable mosaic file format (Rust FFI)" OFF) | |
| option(PAIMON_ENABLE_LANCE "Whether to enable lance file format (Rust FFI)" OFF) | |
| option(PAIMON_ENABLE_VORTEX "Whether to enable vortex file format (Rust FFI)" OFF) | |
| option(PAIMON_ENABLE_JINDO "Whether to enable jindo file system" OFF) | |
| option(PAIMON_ENABLE_OSS "Whether to enable OSS SDK v2 file system" OFF) | |
| option(PAIMON_ENABLE_S3 "Whether to enable S3 file system" OFF) | |
| option(PAIMON_ENABLE_NETWORK_TESTS | |
| "Whether to enable tests that access real remote services over the network" OFF) | |
| option(PAIMON_ENABLE_LUMINA "Whether to enable lumina vector index" OFF) | |
| option(PAIMON_ENABLE_LUCENE "Whether to enable lucene index" OFF) | |
| option(PAIMON_ENABLE_FULL_TEXT | |
| "Whether to enable full-text global index (Rust FFI, experimental)" OFF) | |
| option(PAIMON_ENABLE_REST | |
| "Whether to enable the rest catalog (requires libcurl and OpenSSL)" OFF) | |
| if(PAIMON_ENABLE_ORC) | |
| add_definitions(-DPAIMON_ENABLE_ORC) | |
| endif() | |
| if(PAIMON_ENABLE_REST) | |
| add_definitions(-DPAIMON_ENABLE_REST) | |
| endif() | |
| # libcurl supports the REST and S3 HTTP clients, the OSS SDK transport, and object store timestamps. | |
| if(PAIMON_ENABLE_OSS | |
| OR PAIMON_ENABLE_S3 | |
| OR PAIMON_ENABLE_REST) | |
| find_package(CURL REQUIRED) | |
| endif() | |
| if(PAIMON_ENABLE_REST) | |
| find_package(OpenSSL 1.1.0 REQUIRED) | |
| endif() | |
| if(PAIMON_ENABLE_AVRO) | |
| add_definitions(-DPAIMON_ENABLE_AVRO) | |
| endif() | |
| if(PAIMON_ENABLE_MOSAIC) | |
| add_definitions(-DPAIMON_ENABLE_MOSAIC) | |
| endif() | |
| if(PAIMON_ENABLE_LANCE) | |
| add_definitions(-DPAIMON_ENABLE_LANCE) | |
| endif() | |
| if(PAIMON_ENABLE_VORTEX) | |
| add_definitions(-DPAIMON_ENABLE_VORTEX) | |
| endif() | |
| if(PAIMON_ENABLE_JINDO) | |
| add_definitions(-DPAIMON_ENABLE_JINDO) | |
| endif() | |
| if(PAIMON_ENABLE_OSS) | |
| add_definitions(-DPAIMON_ENABLE_OSS) | |
| endif() | |
| if(PAIMON_ENABLE_S3) | |
| add_definitions(-DPAIMON_ENABLE_S3) | |
| endif() | |
| if(PAIMON_ENABLE_NETWORK_TESTS) | |
| add_definitions(-DPAIMON_ENABLE_NETWORK_TESTS) | |
| endif() | |
| if(PAIMON_USE_CXX11_ABI) | |
| add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) | |
| else() | |
| # Lumina is provided as a shared library and cannot be recompiled with C++11 ABI off. | |
| if(PAIMON_ENABLE_LUMINA) | |
| message(FATAL_ERROR "Lumina cannot be enabled with C++11 ABI off") | |
| endif() | |
| add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) | |
| endif() | |
| if(PAIMON_ENABLE_LUMINA) | |
| add_definitions(-DPAIMON_ENABLE_LUMINA) | |
| endif() | |
| if(PAIMON_ENABLE_LUCENE) | |
| add_definitions(-DPAIMON_ENABLE_LUCENE) | |
| endif() | |
| if(PAIMON_ENABLE_FULL_TEXT) | |
| add_definitions(-DPAIMON_ENABLE_FULL_TEXT) | |
| endif() | |
| add_definitions(-DSNAPPY_CODEC_AVAILABLE) | |
| add_definitions(-DZSTD_CODEC_AVAILABLE) | |
| add_definitions(-DRAPIDJSON_HAS_STDSTRING) | |
| set(CLANG_TIDY_BIN "clang-tidy") | |
| set(PAIMON_SOURCE_DIR ${PROJECT_SOURCE_DIR}) | |
| set(PAIMON_BINARY_DIR ${PROJECT_BINARY_DIR}) | |
| set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules") | |
| set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build_support") | |
| include(GNUInstallDirs) | |
| set(PAIMON_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Paimon") | |
| include(DefineOptions) | |
| if(PAIMON_OPTIONAL_INSTALL) | |
| # Don't make the "install" target depend on the "all" target | |
| set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true) | |
| set(INSTALL_IS_OPTIONAL OPTIONAL) | |
| endif() | |
| if(PAIMON_EXTRA_ERROR_CONTEXT) | |
| add_definitions(-DPAIMON_EXTRA_ERROR_CONTEXT) | |
| endif() | |
| if(NOT PAIMON_VERBOSE_LINT) | |
| set(PAIMON_LINT_QUIET "--quiet") | |
| endif() | |
| set(LINT_EXCLUSIONS_FILE ${BUILD_SUPPORT_DIR}/lint_exclusions.txt) | |
| set(LINT_SOURCE_DIRS ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src | |
| ${CMAKE_SOURCE_DIR}/test ${CMAKE_SOURCE_DIR}/examples) | |
| set(CLANG_TIDY_OPTIONS | |
| ${PAIMON_LINT_QUIET} | |
| --compile_commands | |
| ${CMAKE_BINARY_DIR}/compile_commands.json | |
| --exclude_globs | |
| ${LINT_EXCLUSIONS_FILE}) | |
| if(PAIMON_LINT_GIT_DIFF_MODE) | |
| list(JOIN LINT_SOURCE_DIRS "|" _lint_dir_union) | |
| set(LINT_DIR_REGEX "^(${_lint_dir_union}\/?)") | |
| set(GIT_DIFF_FILE_PATH ${CMAKE_BINARY_DIR}/git_diff_files.txt) | |
| add_custom_target(update_diff_files | |
| # get git-diff file list | |
| COMMAND git diff-index --name-only --diff-filter=d --cached | |
| ${PAIMON_LINT_GIT_TARGET_COMMIT} > ${GIT_DIFF_FILE_PATH} | |
| # convert to absolute path | |
| COMMAND sed -i \"s|^|${CMAKE_SOURCE_DIR}/|\" ${GIT_DIFF_FILE_PATH} | |
| # filter with ${LINT_SOURCE_DIRS} dirs | |
| COMMAND sed -nE -i '\\@${LINT_DIR_REGEX}@p' ${GIT_DIFF_FILE_PATH} | |
| COMMENT "Generate git_diff_files.txt for git-diff lint" | |
| BYPRODUCTS ${GIT_DIFF_FILE_PATH}) | |
| list(APPEND CLANG_TIDY_OPTIONS --source_file @${GIT_DIFF_FILE_PATH}) | |
| else() | |
| list(APPEND CLANG_TIDY_OPTIONS --source_dir ${LINT_SOURCE_DIRS}) | |
| endif() | |
| # runs clang-tidy and attempts to fix any warning automatically | |
| add_custom_target(clang-tidy | |
| ${PYTHON_EXECUTABLE} | |
| ${BUILD_SUPPORT_DIR}/run_clang_tidy.py | |
| --clang_tidy_binary | |
| ${CLANG_TIDY_BIN} | |
| ${CLANG_TIDY_OPTIONS} | |
| --fix) | |
| # runs clang-tidy and exits with a non-zero exit code if any errors are found. | |
| add_custom_target(check-clang-tidy | |
| ${PYTHON_EXECUTABLE} | |
| ${BUILD_SUPPORT_DIR}/run_clang_tidy.py | |
| --clang_tidy_binary | |
| ${CLANG_TIDY_BIN} | |
| ${CLANG_TIDY_OPTIONS}) | |
| if(PAIMON_LINT_GIT_DIFF_MODE) | |
| add_dependencies(clang-tidy update_diff_files) | |
| add_dependencies(check-clang-tidy update_diff_files) | |
| endif() | |
| if(UNIX) | |
| add_custom_target(iwyu | |
| ${CMAKE_COMMAND} | |
| -E | |
| env | |
| "PYTHON=${PYTHON_EXECUTABLE}" | |
| ${BUILD_SUPPORT_DIR}/iwyu/iwyu.sh) | |
| add_custom_target(iwyu-all | |
| ${CMAKE_COMMAND} | |
| -E | |
| env | |
| "PYTHON=${PYTHON_EXECUTABLE}" | |
| ${BUILD_SUPPORT_DIR}/iwyu/iwyu.sh | |
| all) | |
| endif(UNIX) | |
| # Setup ccache to accelerate compilation if available | |
| if(PAIMON_USE_CCACHE | |
| AND NOT CMAKE_C_COMPILER_LAUNCHER | |
| AND NOT CMAKE_CXX_COMPILER_LAUNCHER) | |
| find_program(CCACHE_PROGRAM ccache) | |
| if(CCACHE_PROGRAM) | |
| message(STATUS "Found ccache: ${CCACHE_PROGRAM}") | |
| set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | |
| set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | |
| else() | |
| message(STATUS "ccache not found, compiling without cache acceleration") | |
| endif() | |
| endif() | |
| include(SetupCxxFlags) | |
| # set compile output directory | |
| string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_SUBDIR_NAME) | |
| # If build in-source, create the latest symlink. If build out-of-source, which | |
| # is preferred, simply output the binaries in the build folder | |
| if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) | |
| set(BUILD_OUTPUT_ROOT_DIRECTORY | |
| "${CMAKE_CURRENT_BINARY_DIR}/build/${BUILD_SUBDIR_NAME}/") | |
| # Link build/latest to the current build directory, to avoid developers | |
| # accidentally running the latest debug build when in fact they're building | |
| # release builds. | |
| file(MAKE_DIRECTORY ${BUILD_OUTPUT_ROOT_DIRECTORY}) | |
| if(NOT APPLE) | |
| set(MORE_ARGS "-T") | |
| endif() | |
| execute_process(COMMAND ln ${MORE_ARGS} -sf ${BUILD_OUTPUT_ROOT_DIRECTORY} | |
| ${CMAKE_CURRENT_BINARY_DIR}/build/latest) | |
| else() | |
| set(BUILD_OUTPUT_ROOT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${BUILD_SUBDIR_NAME}/") | |
| endif() | |
| # where to put generated archives (.a files) | |
| set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| set(ARCHIVE_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| # where to put generated libraries (.so files) | |
| set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| set(LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| # where to put generated binaries | |
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| set(RUNTIME_OUTPUT_DIRECTORY "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| set(EXECUTABLE_OUTPUT_PATH "${BUILD_OUTPUT_ROOT_DIRECTORY}") | |
| include(BuildUtils) | |
| enable_testing() | |
| # Add common flags | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_COMMON_FLAGS}") | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PAIMON_CXXFLAGS}") | |
| # For any C code, use the same flags. These flags don't contain C++ specific | |
| # flags. | |
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_COMMON_FLAGS} ${PAIMON_CXXFLAGS}") | |
| # Remove --std=c++17 to avoid errors from C compilers | |
| string(REPLACE "-std=c++17" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) | |
| # Add C++-only flags, like -std=c++11 | |
| set(CMAKE_CXX_FLAGS "${CXX_ONLY_FLAGS} ${CMAKE_CXX_FLAGS}") | |
| include(san-config) | |
| # Code coverage | |
| if("${PAIMON_GENERATE_COVERAGE}") | |
| set(CMAKE_C_FLAGS | |
| "${CMAKE_C_FLAGS} --coverage -fprofile-update=atomic -DCOVERAGE_BUILD") | |
| set(CMAKE_CXX_FLAGS | |
| "${CMAKE_CXX_FLAGS} --coverage -fprofile-update=atomic -DCOVERAGE_BUILD") | |
| endif() | |
| # CMAKE_CXX_FLAGS now fully assembled | |
| message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") | |
| message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") | |
| include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) | |
| include_directories(src) | |
| # | |
| # Visibility | |
| # | |
| # For generate_export_header() and add_compiler_export_flags(). | |
| include(GenerateExportHeader) | |
| include(ExternalProject) | |
| include(ThirdpartyToolchain) | |
| add_custom_target(paimon_dependencies) | |
| if(PAIMON_STATIC_LINK_LIBS) | |
| add_dependencies(paimon_dependencies ${PAIMON_STATIC_LINK_LIBS}) | |
| endif() | |
| set(PAIMON_SHARED_PRIVATE_LINK_LIBS ${PAIMON_STATIC_LINK_LIBS}) | |
| add_subdirectory(third_party/roaring_bitmap EXCLUDE_FROM_ALL) | |
| add_subdirectory(third_party/xxhash EXCLUDE_FROM_ALL) | |
| # ---- Rust FFI crates via Corrosion-rs ------------------------------------------- | |
| if(PAIMON_ENABLE_LANCE) | |
| include(CorrosionFetch) | |
| endif() | |
| if(PAIMON_ENABLE_LANCE) | |
| find_program(PAIMON_LANCE_PROTOC protoc REQUIRED) | |
| corrosion_import_crate(MANIFEST_PATH crates/lance_ffi/Cargo.toml CRATES | |
| paimon_lance_ffi) | |
| corrosion_experimental_cbindgen(TARGET paimon_lance_ffi HEADER_NAME | |
| paimon_lance_ffi.h) | |
| corrosion_set_env_vars(paimon_lance_ffi "PROTOC=${PAIMON_LANCE_PROTOC}") | |
| endif() | |
| if(PAIMON_ENABLE_LUCENE) | |
| set(PAIMON_DICT_DEST "share/paimon/dict") | |
| install(DIRECTORY ${JIEBA_DICT_DIR}/ | |
| DESTINATION ${PAIMON_DICT_DEST} | |
| FILES_MATCHING | |
| PATTERN "jieba.dict.utf8" | |
| PATTERN "hmm_model.utf8" | |
| PATTERN "idf.utf8" | |
| PATTERN "stop_words.utf8" | |
| PATTERN "user.dict.utf8" | |
| PATTERN "pos_dict" | |
| PATTERN ".git*" EXCLUDE | |
| PATTERN "*.md" EXCLUDE) | |
| endif() | |
| install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ | |
| DESTINATION "include" | |
| FILES_MATCHING | |
| PATTERN "*.h") | |
| set(CMAKE_CXX_VISIBILITY_PRESET hidden) | |
| set(CMAKE_C_VISIBILITY_PRESET hidden) | |
| include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) | |
| include_directories("${CMAKE_SOURCE_DIR}/third_party/roaring_bitmap") | |
| include_directories("${CMAKE_SOURCE_DIR}/third_party/xxhash") | |
| include_directories(SYSTEM ${ARROW_INCLUDE_DIR}) | |
| include_directories(SYSTEM ${TBB_INCLUDE_DIR}) | |
| include_directories(SYSTEM ${GLOG_INCLUDE_DIR}) | |
| add_compile_definitions("GLOG_USE_GLOG_EXPORT") | |
| set(THREADS_PREFER_PTHREAD_FLAG ON) | |
| find_package(Threads REQUIRED) | |
| set(PAIMON_VERSION_SCRIPT_FLAGS) | |
| if(NOT APPLE) | |
| set(PAIMON_VERSION_SCRIPT_FLAGS | |
| "-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/paimon/symbols.map") | |
| endif() | |
| set(ENV{PAIMON_TEST_DATA} "${CMAKE_SOURCE_DIR}/test/test_data") | |
| if(PAIMON_BUILD_TESTS OR PAIMON_BUILD_BENCHMARKS) | |
| resolve_dependency(GTest) | |
| include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) | |
| paimon_link_libraries_whole_archive(PAIMON_LOCAL_FILE_SYSTEM_STATIC_LINK_LIBS | |
| paimon_local_file_system_static) | |
| paimon_link_libraries_no_as_needed(PAIMON_LOCAL_FILE_SYSTEM_SHARED_LINK_LIBS | |
| paimon_local_file_system_shared) | |
| paimon_link_libraries_whole_archive(PAIMON_BLOB_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_blob_file_format_static) | |
| paimon_link_libraries_whole_archive(PAIMON_PARQUET_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_parquet_file_format_static) | |
| if(PAIMON_ENABLE_MOSAIC) | |
| paimon_link_libraries_whole_archive(PAIMON_MOSAIC_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_mosaic_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_LANCE) | |
| paimon_link_libraries_whole_archive(PAIMON_LANCE_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_lance_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_VORTEX) | |
| paimon_link_libraries_whole_archive(PAIMON_VORTEX_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_vortex_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_ORC) | |
| paimon_link_libraries_whole_archive(PAIMON_ORC_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_orc_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_AVRO) | |
| paimon_link_libraries_whole_archive(PAIMON_AVRO_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_avro_file_format_static) | |
| endif() | |
| endif() | |
| if(PAIMON_BUILD_TESTS) | |
| if(NOT PAIMON_ENABLE_ORC) | |
| message(FATAL_ERROR "PAIMON_ENABLE_ORC must be enabled if PAIMON_BUILD_TESTS is enable" | |
| ) | |
| endif() | |
| if(NOT PAIMON_ENABLE_AVRO) | |
| message(FATAL_ERROR "PAIMON_ENABLE_AVRO must be enabled if PAIMON_BUILD_TESTS is enable" | |
| ) | |
| endif() | |
| # Adding unit tests part of the "paimon" portion of the test suite | |
| add_custom_target(paimon-tests) | |
| add_custom_target(unittest | |
| ctest | |
| -j4 | |
| -L | |
| unittest | |
| --output-on-failure) | |
| add_dependencies(unittest paimon-tests) | |
| include_directories("${CMAKE_SOURCE_DIR}/test/") | |
| paimon_link_libraries_whole_archive( | |
| TEST_WHOLE_ARCHIVE_LINK_LIBS | |
| paimon_file_index_static | |
| paimon_global_index_static | |
| paimon_local_file_system_static | |
| paimon_mock_file_format_static) | |
| paimon_link_libraries_no_as_needed( | |
| TEST_PLUGIN_LINK_LIBS paimon_parquet_file_format_shared | |
| paimon_blob_file_format_shared) | |
| set(TEST_STATIC_LINK_LIBS ${TEST_WHOLE_ARCHIVE_LINK_LIBS} ${TEST_PLUGIN_LINK_LIBS}) | |
| paimon_link_libraries_whole_archive(PAIMON_LOCAL_FILE_SYSTEM_STATIC_LINK_LIBS | |
| paimon_local_file_system_static) | |
| paimon_link_libraries_no_as_needed(PAIMON_LOCAL_FILE_SYSTEM_SHARED_LINK_LIBS | |
| paimon_local_file_system_shared) | |
| paimon_link_libraries_whole_archive(PAIMON_BLOB_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_blob_file_format_static) | |
| paimon_link_libraries_whole_archive(PAIMON_PARQUET_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_parquet_file_format_static) | |
| if(PAIMON_ENABLE_MOSAIC) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_mosaic_file_format_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| paimon_link_libraries_whole_archive(PAIMON_MOSAIC_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_mosaic_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_LANCE) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_lance_file_format_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| paimon_link_libraries_whole_archive(PAIMON_LANCE_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_lance_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_VORTEX) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_vortex_file_format_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| paimon_link_libraries_whole_archive(PAIMON_VORTEX_FILE_FORMAT_STATIC_LINK_LIBS | |
| paimon_vortex_file_format_static) | |
| endif() | |
| if(PAIMON_ENABLE_ORC) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_orc_file_format_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_AVRO) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_avro_file_format_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_JINDO) | |
| paimon_link_libraries_whole_archive(PAIMON_JINDO_FILE_SYSTEM_STATIC_LINK_LIBS | |
| paimon_jindo_file_system_static) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_jindo_file_system_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_OSS) | |
| paimon_link_libraries_whole_archive(PAIMON_OSS_FILE_SYSTEM_STATIC_LINK_LIBS | |
| paimon_oss_file_system_static) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_oss_file_system_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_S3) | |
| paimon_link_libraries_whole_archive(PAIMON_S3_FILE_SYSTEM_STATIC_LINK_LIBS | |
| paimon_s3_file_system_static) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_s3_file_system_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_LUMINA) | |
| paimon_link_libraries_whole_archive(PAIMON_LUMINA_INDEX_STATIC_LINK_LIBS | |
| paimon_lumina_index_static) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_lumina_index_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_LUCENE) | |
| paimon_link_libraries_whole_archive(PAIMON_LUCENE_INDEX_STATIC_LINK_LIBS | |
| paimon_lucene_index_static) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_lucene_index_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| if(PAIMON_ENABLE_FULL_TEXT) | |
| paimon_link_libraries_whole_archive(PAIMON_FULL_TEXT_INDEX_STATIC_LINK_LIBS | |
| paimon_full_text_index_static) | |
| paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS | |
| paimon_full_text_index_shared) | |
| list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS}) | |
| endif() | |
| endif() | |
| if(PAIMON_BUILD_BENCHMARKS) | |
| add_custom_target(paimon-benchmarks) | |
| add_custom_target(benchmark | |
| ctest | |
| -j4 | |
| -L | |
| benchmark | |
| --output-on-failure) | |
| add_dependencies(benchmark paimon-benchmarks) | |
| set(PAIMON_BENCHMARK_LINK_TOOLCHAIN benchmark::benchmark) | |
| endif() | |
| paimon_print_dependency_resolution_summary() | |
| include(CMakePackageConfigHelpers) | |
| write_basic_package_version_file( | |
| "${CMAKE_CURRENT_BINARY_DIR}/PaimonConfigVersion.cmake" | |
| VERSION ${PROJECT_VERSION} | |
| COMPATIBILITY SameMinorVersion) | |
| configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/PaimonConfig.cmake.in" | |
| "${CMAKE_CURRENT_BINARY_DIR}/PaimonConfig.cmake" | |
| INSTALL_DESTINATION ${PAIMON_CMAKE_INSTALL_DIR}) | |
| install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PaimonConfig.cmake" | |
| "${CMAKE_CURRENT_BINARY_DIR}/PaimonConfigVersion.cmake" | |
| DESTINATION ${PAIMON_CMAKE_INSTALL_DIR}) | |
| config_summary_message() | |
| add_subdirectory(src/paimon) | |
| add_subdirectory(src/paimon/fs/local) | |
| if(PAIMON_ENABLE_JINDO) | |
| add_subdirectory(src/paimon/fs/jindo) | |
| endif() | |
| add_subdirectory(src/paimon/fs/oss) | |
| add_subdirectory(src/paimon/fs/s3) | |
| add_subdirectory(src/paimon/format/blob) | |
| add_subdirectory(src/paimon/format/orc) | |
| add_subdirectory(src/paimon/format/parquet) | |
| add_subdirectory(src/paimon/format/avro) | |
| if(PAIMON_ENABLE_MOSAIC) | |
| add_subdirectory(src/paimon/format/mosaic) | |
| endif() | |
| if(PAIMON_ENABLE_LANCE) | |
| add_subdirectory(src/paimon/format/lance) | |
| endif() | |
| if(PAIMON_ENABLE_VORTEX) | |
| add_subdirectory(src/paimon/format/vortex) | |
| endif() | |
| if(PAIMON_ENABLE_LUMINA) | |
| add_subdirectory(src/paimon/indexer/lumina) | |
| endif() | |
| add_subdirectory(src/paimon/global_index/lucene) | |
| if(PAIMON_ENABLE_FULL_TEXT) | |
| add_subdirectory(src/paimon/global_index/full_text) | |
| endif() | |
| add_subdirectory(src/paimon/testing/mock) | |
| add_subdirectory(src/paimon/testing/utils) | |
| add_subdirectory(test/inte) | |
| install(EXPORT PaimonTargets | |
| NAMESPACE Paimon:: | |
| DESTINATION ${PAIMON_CMAKE_INSTALL_DIR}) | |
| # benchmark/ also holds gtest targets that guard the assumptions the benchmarks are built on, and | |
| # those have to be built whenever tests are. The subdirectory gates each target on the option it | |
| # belongs to, so a tests-only build adds no benchmark executable. | |
| if(PAIMON_BUILD_TESTS OR PAIMON_BUILD_BENCHMARKS) | |
| add_subdirectory(benchmark) | |
| endif() | |
| install(EXPORT PaimonTargets | |
| NAMESPACE Paimon:: | |
| DESTINATION ${PAIMON_CMAKE_INSTALL_DIR}) |