diff --git a/CMake/Findzstd.cmake b/CMake/Findzstd.cmake index a74adb0fbe0..3285c5744d5 100644 --- a/CMake/Findzstd.cmake +++ b/CMake/Findzstd.cmake @@ -50,3 +50,11 @@ if(NOT TARGET zstd::zstd) zstd::zstd PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${ZSTD_LIBRARIES}") endif() + +if(NOT TARGET zstd::libzstd_shared) + add_library(zstd::libzstd_shared ALIAS zstd::zstd) +endif() + +if(NOT TARGET zstd::libzstd_static) + add_library(zstd::libzstd_static ALIAS zstd::zstd) +endif() diff --git a/CMake/resolve_dependency_modules/clp.cmake b/CMake/resolve_dependency_modules/clp.cmake index 5cb4c731de2..93d57bf4da6 100644 --- a/CMake/resolve_dependency_modules/clp.cmake +++ b/CMake/resolve_dependency_modules/clp.cmake @@ -16,7 +16,7 @@ include_guard(GLOBAL) FetchContent_Declare( clp GIT_REPOSITORY https://github.com/y-scope/clp.git - GIT_TAG 581bd46198a97a89b174849851cc3f1f2100e466) + GIT_TAG 19cd534e629d746395efc64343a60f768b0c9a2d) set(CLP_BUILD_CLP_REGEX_UTILS OFF @@ -39,6 +39,5 @@ set(CLP_BUILD_TESTING FetchContent_Populate(clp) -list(APPEND CMAKE_MODULE_PATH "${clp_SOURCE_DIR}/components/core/cmake/Modules") add_subdirectory(${clp_SOURCE_DIR}/components/core ${clp_BINARY_DIR}/components/core) diff --git a/CMake/resolve_dependency_modules/log_surgeon.cmake b/CMake/resolve_dependency_modules/log_surgeon.cmake new file mode 100644 index 00000000000..7b447fc6810 --- /dev/null +++ b/CMake/resolve_dependency_modules/log_surgeon.cmake @@ -0,0 +1,25 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# Licensed 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. +include_guard(GLOBAL) + +FetchContent_Declare( + log_surgeon + GIT_REPOSITORY https://github.com/y-scope/log-surgeon.git + GIT_TAG 85d4f2c09c0e55f1fb87cdc8b0f4d13fb1a733e1 + OVERRIDE_FIND_PACKAGE) + +FetchContent_MakeAvailable(log_surgeon) + +# To work around y-scope/log-surgeon#155 +install(TARGETS GSL EXPORT log_surgeon-targets) diff --git a/CMake/resolve_dependency_modules/microsoft_gsl.cmake b/CMake/resolve_dependency_modules/microsoft_gsl.cmake new file mode 100644 index 00000000000..5fc1731231e --- /dev/null +++ b/CMake/resolve_dependency_modules/microsoft_gsl.cmake @@ -0,0 +1,34 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# Licensed 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. +include_guard(GLOBAL) + +# Version you want to build +set(VELOX_GSL_BUILD_VERSION 4.0.0) +set(VELOX_GSL_BUILD_SHA256_CHECKSUM + f0e32cb10654fea91ad56bde89170d78cfbf4363ee0b01d8f097de2ba49f6ce9) +set(VELOX_GSL_SOURCE_URL + "https://github.com/microsoft/GSL/archive/refs/tags/v${VELOX_GSL_BUILD_VERSION}.tar.gz" +) + +velox_resolve_dependency_url(GSL) + +message(STATUS "Building Microsoft.GSL from source") + +FetchContent_Declare( + Microsoft.GSL + URL ${VELOX_GSL_SOURCE_URL} + URL_HASH ${VELOX_GSL_BUILD_SHA256_CHECKSUM} + OVERRIDE_FIND_PACKAGE EXCLUDE_FROM_ALL SYSTEM) + +FetchContent_MakeAvailable(Microsoft.GSL) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba0734c6ee4..1b6529423fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,20 +509,13 @@ if(${VELOX_BUILD_MINIMAL_WITH_DWIO} OR ${VELOX_ENABLE_HIVE_CONNECTOR}) find_package(lzo2 REQUIRED) find_package(zstd REQUIRED) find_package(Snappy REQUIRED) - if(NOT TARGET zstd::zstd) - if(TARGET zstd::libzstd_static) - set(ZSTD_TYPE static) - else() - set(ZSTD_TYPE shared) - endif() - add_library(zstd::zstd ALIAS zstd::libzstd_${ZSTD_TYPE}) - endif() endif() velox_set_source(re2) velox_resolve_dependency(re2) if(${VELOX_ENABLE_CLP_CONNECTOR}) + # Independent dependencies velox_set_source(absl) velox_resolve_dependency(absl) @@ -532,6 +525,9 @@ if(${VELOX_ENABLE_CLP_CONNECTOR}) velox_set_source(date) velox_resolve_dependency(date) + velox_set_source(microsoft_gsl) + velox_resolve_dependency(microsoft_gsl) + velox_set_source(msgpack-cxx) velox_resolve_dependency(msgpack-cxx) @@ -544,6 +540,10 @@ if(${VELOX_ENABLE_CLP_CONNECTOR}) velox_set_source(spdlog) velox_resolve_dependency(spdlog) + # Dependencies that depend on other dependencies + velox_set_source(log_surgeon) + velox_resolve_dependency(log_surgeon) + set(ystdlib_cpp_SOURCE BUNDLED) velox_resolve_dependency(ystdlib_cpp) diff --git a/velox/connectors/clp/search_lib/ClpQueryRunner.cpp b/velox/connectors/clp/search_lib/ClpQueryRunner.cpp index a1c9032ebd5..300606a9007 100644 --- a/velox/connectors/clp/search_lib/ClpQueryRunner.cpp +++ b/velox/connectors/clp/search_lib/ClpQueryRunner.cpp @@ -18,7 +18,6 @@ using namespace clp_s; using namespace clp_s::search; -using namespace clp_s::search::clp_search; namespace facebook::velox::connector::clp::search_lib {