2022-01-17 19:42:00 +00:00
|
|
|
#"${folder}/CMakeLists.txt" Third-party libraries may have substandard code.
|
2018-07-30 20:36:23 +00:00
|
|
|
|
2021-04-28 22:16:45 +00:00
|
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
|
|
|
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
|
2016-08-25 21:55:02 +00:00
|
|
|
|
2020-12-23 12:31:18 +00:00
|
|
|
if (WITH_COVERAGE)
|
2020-12-24 13:06:32 +00:00
|
|
|
set (WITHOUT_COVERAGE_LIST ${WITHOUT_COVERAGE})
|
|
|
|
separate_arguments(WITHOUT_COVERAGE_LIST)
|
|
|
|
# disable coverage for contib files and build with optimisations
|
2021-01-07 16:38:58 +00:00
|
|
|
if (COMPILER_CLANG)
|
|
|
|
add_compile_options(-O3 -DNDEBUG -finline-functions -finline-hint-functions ${WITHOUT_COVERAGE_LIST})
|
|
|
|
else()
|
|
|
|
add_compile_options(-O3 -DNDEBUG -finline-functions ${WITHOUT_COVERAGE_LIST})
|
|
|
|
endif()
|
2020-12-23 12:31:18 +00:00
|
|
|
endif()
|
|
|
|
|
2020-11-06 17:52:28 +00:00
|
|
|
if (SANITIZE STREQUAL "undefined")
|
|
|
|
# 3rd-party libraries usually not intended to work with UBSan.
|
|
|
|
add_compile_options(-fno-sanitize=undefined)
|
|
|
|
endif()
|
|
|
|
|
2019-02-04 14:07:01 +00:00
|
|
|
set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL 1)
|
|
|
|
|
2022-01-17 19:04:55 +00:00
|
|
|
add_subdirectory (sparsehash-c11-cmake)
|
2021-02-27 16:04:32 +00:00
|
|
|
add_subdirectory (abseil-cpp-cmake)
|
2021-09-06 15:59:46 +00:00
|
|
|
add_subdirectory (magic-enum-cmake)
|
2020-06-09 10:54:49 +00:00
|
|
|
add_subdirectory (boost-cmake)
|
2020-05-08 14:11:19 +00:00
|
|
|
add_subdirectory (cctz-cmake)
|
|
|
|
add_subdirectory (consistent-hashing)
|
2020-12-07 18:26:02 +00:00
|
|
|
add_subdirectory (dragonbox-cmake)
|
2020-06-09 10:54:49 +00:00
|
|
|
add_subdirectory (hyperscan-cmake)
|
2020-05-08 14:11:19 +00:00
|
|
|
add_subdirectory (jemalloc-cmake)
|
|
|
|
add_subdirectory (libcpuid-cmake)
|
2020-06-09 10:54:49 +00:00
|
|
|
add_subdirectory (libdivide)
|
|
|
|
add_subdirectory (libmetrohash)
|
|
|
|
add_subdirectory (lz4-cmake)
|
2020-05-08 14:11:19 +00:00
|
|
|
add_subdirectory (murmurhash)
|
|
|
|
add_subdirectory (replxx-cmake)
|
|
|
|
add_subdirectory (unixodbc-cmake)
|
2021-04-20 11:07:05 +00:00
|
|
|
add_subdirectory (nanodbc-cmake)
|
2021-04-05 06:16:08 +00:00
|
|
|
|
2021-10-03 16:26:48 +00:00
|
|
|
if (USE_INTERNAL_CAPNP_LIBRARY AND NOT MISSING_INTERNAL_CAPNP_LIBRARY)
|
|
|
|
add_subdirectory(capnproto-cmake)
|
|
|
|
endif ()
|
|
|
|
|
2021-05-21 18:56:22 +00:00
|
|
|
if (USE_YAML_CPP)
|
|
|
|
add_subdirectory (yaml-cpp-cmake)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:45:54 +00:00
|
|
|
add_subdirectory (re2-cmake)
|
2022-01-17 18:45:54 +00:00
|
|
|
add_subdirectory (xz-cmake)
|
2022-01-17 18:48:14 +00:00
|
|
|
add_subdirectory (brotli-cmake)
|
2022-01-17 18:45:54 +00:00
|
|
|
add_subdirectory (double-conversion-cmake)
|
2022-01-17 05:45:10 +00:00
|
|
|
add_subdirectory (boringssl-cmake)
|
2020-05-08 14:11:19 +00:00
|
|
|
add_subdirectory (poco-cmake)
|
2020-10-23 11:42:21 +00:00
|
|
|
add_subdirectory (croaring-cmake)
|
2022-01-16 09:20:20 +00:00
|
|
|
add_subdirectory (zstd-cmake)
|
2022-01-16 10:34:54 +00:00
|
|
|
add_subdirectory (zlib-ng-cmake)
|
2022-01-16 10:55:08 +00:00
|
|
|
add_subdirectory (bzip2-cmake)
|
2022-01-16 20:00:25 +00:00
|
|
|
add_subdirectory (snappy-cmake)
|
|
|
|
add_subdirectory (rocksdb-cmake)
|
2022-01-17 05:10:57 +00:00
|
|
|
add_subdirectory (thrift-cmake)
|
2022-01-16 19:37:27 +00:00
|
|
|
# parquet/arrow/orc
|
2022-01-17 18:45:54 +00:00
|
|
|
add_subdirectory (arrow-cmake) # requires: snappy, thrift, double-conversion
|
2022-01-16 19:34:00 +00:00
|
|
|
add_subdirectory (avro-cmake) # requires: snappy
|
2022-01-17 05:06:53 +00:00
|
|
|
add_subdirectory (hive-metastore-cmake) # requires: thrift/avro/arrow
|
2022-01-17 05:21:56 +00:00
|
|
|
add_subdirectory (librdkafka-cmake)
|
|
|
|
add_subdirectory (cppkafka-cmake)
|
2022-01-17 06:00:50 +00:00
|
|
|
add_subdirectory (openldap-cmake)
|
2022-01-17 07:36:58 +00:00
|
|
|
add_subdirectory (grpc-cmake)
|
2022-01-17 07:46:31 +00:00
|
|
|
add_subdirectory (protobuf-cmake)
|
2022-01-17 18:45:53 +00:00
|
|
|
add_subdirectory (libhdfs3-cmake) # requires: protobuf
|
2020-05-08 14:11:19 +00:00
|
|
|
|
2022-01-17 18:45:53 +00:00
|
|
|
if (ENABLE_FUZZING)
|
|
|
|
add_subdirectory (libprotobuf-mutator-cmake)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 19:09:12 +00:00
|
|
|
add_subdirectory (cityhash102)
|
2022-01-17 19:16:12 +00:00
|
|
|
add_subdirectory (libfarmhash)
|
2022-01-17 19:20:39 +00:00
|
|
|
add_subdirectory (icu-cmake)
|
|
|
|
|
|
|
|
# TODO: refactor the contrib libraries below this comment.
|
2017-08-09 20:52:55 +00:00
|
|
|
|
2019-03-25 14:34:52 +00:00
|
|
|
if (USE_INTERNAL_H3_LIBRARY)
|
2019-06-30 18:49:57 +00:00
|
|
|
add_subdirectory(h3-cmake)
|
2019-03-25 14:34:52 +00:00
|
|
|
endif ()
|
|
|
|
|
2021-10-24 01:36:30 +00:00
|
|
|
if (USE_INTERNAL_MYSQL_LIBRARY)
|
|
|
|
add_subdirectory (mariadb-connector-c-cmake)
|
2018-08-02 00:49:31 +00:00
|
|
|
endif ()
|
|
|
|
|
2019-01-25 20:12:15 +00:00
|
|
|
if(USE_INTERNAL_GTEST_LIBRARY)
|
2021-11-21 16:30:36 +00:00
|
|
|
add_subdirectory(googletest-cmake)
|
2019-01-25 20:12:15 +00:00
|
|
|
elseif(GTEST_SRC_DIR)
|
|
|
|
add_subdirectory(${GTEST_SRC_DIR}/googletest ${CMAKE_CURRENT_BINARY_DIR}/googletest)
|
|
|
|
target_compile_definitions(gtest INTERFACE GTEST_HAS_POSIX_RE=0)
|
|
|
|
endif()
|
2018-11-16 12:22:51 +00:00
|
|
|
|
2021-09-09 19:41:26 +00:00
|
|
|
function(add_llvm)
|
2018-07-16 14:13:15 +00:00
|
|
|
# ld: unknown option: --color-diagnostics
|
2018-08-20 16:34:28 +00:00
|
|
|
if (APPLE)
|
2018-07-16 14:13:15 +00:00
|
|
|
set (LINKER_SUPPORTS_COLOR_DIAGNOSTICS 0 CACHE INTERNAL "")
|
|
|
|
endif ()
|
2021-05-22 12:22:38 +00:00
|
|
|
|
2021-09-09 19:41:27 +00:00
|
|
|
# Do not adjust RPATH in llvm, since then it will not be able to find libcxx/libcxxabi/libunwind
|
|
|
|
set (CMAKE_INSTALL_RPATH "ON")
|
2021-10-11 03:58:08 +00:00
|
|
|
set (LLVM_COMPILER_CHECKED 1 CACHE INTERNAL "")
|
2018-11-10 20:09:07 +00:00
|
|
|
set (LLVM_ENABLE_EH 1 CACHE INTERNAL "")
|
|
|
|
set (LLVM_ENABLE_RTTI 1 CACHE INTERNAL "")
|
2019-12-29 20:06:44 +00:00
|
|
|
set (LLVM_ENABLE_PIC 0 CACHE INTERNAL "")
|
2019-12-19 16:49:32 +00:00
|
|
|
set (LLVM_TARGETS_TO_BUILD "X86;AArch64" CACHE STRING "")
|
2021-03-29 13:09:50 +00:00
|
|
|
|
|
|
|
# Need to use C++17 since the compilation is not possible with C++20 currently, due to ambiguous operator != etc.
|
|
|
|
# LLVM project will set its default value for the -std=... but our global setting from CMake will override it.
|
|
|
|
set (CMAKE_CXX_STANDARD 17)
|
|
|
|
|
2018-05-09 20:31:03 +00:00
|
|
|
add_subdirectory (llvm/llvm)
|
2021-09-09 19:41:26 +00:00
|
|
|
endfunction()
|
|
|
|
if (USE_EMBEDDED_COMPILER)
|
|
|
|
add_llvm()
|
2018-05-09 20:31:03 +00:00
|
|
|
endif ()
|
2018-08-26 01:58:56 +00:00
|
|
|
|
2018-12-05 13:24:45 +00:00
|
|
|
if (USE_INTERNAL_LIBGSASL_LIBRARY)
|
2021-11-22 23:17:53 +00:00
|
|
|
add_subdirectory(libgsasl-cmake)
|
2018-12-05 13:24:45 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if (USE_INTERNAL_LIBXML2_LIBRARY)
|
|
|
|
add_subdirectory(libxml2-cmake)
|
|
|
|
endif ()
|
|
|
|
|
2020-05-27 19:11:04 +00:00
|
|
|
if (USE_INTERNAL_AWS_S3_LIBRARY)
|
2019-12-03 16:23:24 +00:00
|
|
|
add_subdirectory(aws-s3-cmake)
|
2019-12-18 14:44:19 +00:00
|
|
|
|
|
|
|
# The library is large - avoid bloat.
|
|
|
|
target_compile_options (aws_s3 PRIVATE -g0)
|
|
|
|
target_compile_options (aws_s3_checksums PRIVATE -g0)
|
2020-05-27 19:11:04 +00:00
|
|
|
|
2019-12-03 16:23:24 +00:00
|
|
|
endif ()
|
|
|
|
|
2018-10-11 16:22:50 +00:00
|
|
|
if (USE_BASE64)
|
|
|
|
add_subdirectory (base64-cmake)
|
2018-11-23 18:33:56 +00:00
|
|
|
endif()
|
2019-03-23 19:40:16 +00:00
|
|
|
|
2022-01-17 19:29:50 +00:00
|
|
|
add_subdirectory (simdjson-cmake)
|
2019-06-27 15:13:19 +00:00
|
|
|
|
2019-07-22 23:41:06 +00:00
|
|
|
if (USE_FASTOPS)
|
|
|
|
add_subdirectory (fastops-cmake)
|
|
|
|
endif()
|
2020-05-20 04:28:55 +00:00
|
|
|
|
2022-01-17 19:49:52 +00:00
|
|
|
add_subdirectory (libuv-cmake)
|
2022-01-17 19:53:36 +00:00
|
|
|
add_subdirectory (amqpcpp-cmake) # requires: libuv
|
2022-01-17 19:58:31 +00:00
|
|
|
add_subdirectory (cassandra-cmake) # requires: libuv
|
2020-05-26 20:41:57 +00:00
|
|
|
|
2021-01-17 15:38:29 +00:00
|
|
|
# Should go before:
|
|
|
|
# - sentry-native
|
|
|
|
add_subdirectory (curl-cmake)
|
|
|
|
|
2022-01-17 19:42:00 +00:00
|
|
|
add_subdirectory (azure-cmake)
|
2021-09-27 09:31:27 +00:00
|
|
|
|
2020-05-27 19:11:04 +00:00
|
|
|
if (USE_SENTRY)
|
2021-11-21 15:43:06 +00:00
|
|
|
add_subdirectory (sentry-native-cmake)
|
2020-05-27 19:11:04 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-22 10:58:29 +00:00
|
|
|
add_subdirectory (fmtlib-cmake)
|
2020-05-26 20:41:57 +00:00
|
|
|
|
2020-07-16 20:32:32 +00:00
|
|
|
if (USE_KRB5)
|
|
|
|
add_subdirectory (krb5-cmake)
|
|
|
|
if (USE_CYRUS_SASL)
|
|
|
|
add_subdirectory (cyrus-sasl-cmake)
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-09-02 09:13:59 +00:00
|
|
|
|
2020-12-05 21:32:03 +00:00
|
|
|
|
2020-12-10 00:36:31 +00:00
|
|
|
if (USE_LIBPQXX)
|
|
|
|
add_subdirectory (libpq-cmake)
|
|
|
|
add_subdirectory (libpqxx-cmake)
|
|
|
|
endif()
|
|
|
|
|
2022-01-17 18:45:54 +00:00
|
|
|
add_subdirectory (nuraft-cmake)
|
2021-11-21 15:09:41 +00:00
|
|
|
add_subdirectory(fast_float-cmake)
|
2021-07-30 13:30:30 +00:00
|
|
|
|
|
|
|
if (USE_NLP)
|
|
|
|
add_subdirectory(libstemmer-c-cmake)
|
|
|
|
add_subdirectory(wordnet-blast-cmake)
|
|
|
|
add_subdirectory(lemmagen-c-cmake)
|
|
|
|
endif()
|
2020-12-09 23:26:01 +00:00
|
|
|
|
2021-07-08 13:27:30 +00:00
|
|
|
if (USE_SQLITE)
|
|
|
|
add_subdirectory(sqlite-cmake)
|
|
|
|
endif()
|
2021-05-17 11:02:35 +00:00
|
|
|
|
2021-07-06 14:21:13 +00:00
|
|
|
if (USE_S2_GEOMETRY)
|
|
|
|
add_subdirectory(s2geometry-cmake)
|
|
|
|
endif()
|
2021-10-03 16:26:48 +00:00
|
|
|
|
|
|
|
# Put all targets defined here and in subdirectories under "contrib/<immediate-subdir>" folders in GUI-based IDEs.
|
|
|
|
# Some of third-party projects may override CMAKE_FOLDER or FOLDER property of their targets, so they would not appear
|
|
|
|
# in "contrib/..." as originally planned, so we workaround this by fixing FOLDER properties of all targets manually,
|
|
|
|
# instead of controlling it via CMAKE_FOLDER.
|
|
|
|
|
|
|
|
function (ensure_target_rooted_in _target _folder)
|
2021-11-25 23:04:11 +00:00
|
|
|
# Skip aliases and INTERFACE library targets, since FOLDER property is not available/writable for them.
|
|
|
|
get_target_property (_target_aliased "${_target}" ALIASED_TARGET)
|
2021-10-03 17:07:44 +00:00
|
|
|
get_target_property (_target_type "${_target}" TYPE)
|
2021-11-25 23:04:11 +00:00
|
|
|
if (_target_aliased OR _target_type STREQUAL "INTERFACE_LIBRARY")
|
2021-10-03 17:07:44 +00:00
|
|
|
return ()
|
|
|
|
endif ()
|
|
|
|
|
2021-10-03 16:26:48 +00:00
|
|
|
# Read the original FOLDER property value, if any.
|
|
|
|
get_target_property (_folder_prop "${_target}" FOLDER)
|
|
|
|
|
|
|
|
# Normalize that value, so we avoid possible repetitions in folder names.
|
|
|
|
|
|
|
|
if (NOT _folder_prop)
|
|
|
|
set (_folder_prop "")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_FOLDER AND _folder_prop MATCHES "^${CMAKE_FOLDER}/(.*)\$")
|
|
|
|
set (_folder_prop "${CMAKE_MATCH_1}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (_folder AND _folder_prop MATCHES "^${_folder}/(.*)\$")
|
|
|
|
set (_folder_prop "${CMAKE_MATCH_1}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (_folder)
|
|
|
|
set (_folder_prop "${_folder}/${_folder_prop}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (CMAKE_FOLDER)
|
|
|
|
set (_folder_prop "${CMAKE_FOLDER}/${_folder_prop}")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
# Set the updated FOLDER property value back.
|
|
|
|
set_target_properties ("${_target}" PROPERTIES FOLDER "${_folder_prop}")
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
function (ensure_own_targets_are_rooted_in _dir _folder)
|
|
|
|
get_directory_property (_targets DIRECTORY "${_dir}" BUILDSYSTEM_TARGETS)
|
|
|
|
foreach (_target IN LISTS _targets)
|
|
|
|
ensure_target_rooted_in ("${_target}" "${_folder}")
|
|
|
|
endforeach ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
function (ensure_all_targets_are_rooted_in _dir _folder)
|
|
|
|
ensure_own_targets_are_rooted_in ("${_dir}" "${_folder}")
|
|
|
|
|
|
|
|
get_property (_sub_dirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
|
|
|
|
foreach (_sub_dir IN LISTS _sub_dirs)
|
|
|
|
ensure_all_targets_are_rooted_in ("${_sub_dir}" "${_folder}")
|
|
|
|
endforeach ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
function (organize_ide_folders_2_level _dir)
|
|
|
|
get_filename_component (_dir_name "${_dir}" NAME)
|
|
|
|
ensure_own_targets_are_rooted_in ("${_dir}" "${_dir_name}")
|
|
|
|
|
|
|
|
# Note, that we respect only first two levels of nesting, we don't want to
|
|
|
|
# reorganize target folders further within each third-party dir.
|
|
|
|
|
|
|
|
get_property (_sub_dirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
|
|
|
|
foreach (_sub_dir IN LISTS _sub_dirs)
|
|
|
|
get_filename_component (_sub_dir_name "${_sub_dir}" NAME)
|
|
|
|
ensure_all_targets_are_rooted_in ("${_sub_dir}" "${_dir_name}/${_sub_dir_name}")
|
|
|
|
endforeach ()
|
|
|
|
endfunction ()
|
|
|
|
|
|
|
|
organize_ide_folders_2_level ("${CMAKE_CURRENT_LIST_DIR}")
|