Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Jun 17, 2024
1 parent bca2f1c commit 76d2d58
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
52 changes: 52 additions & 0 deletions CMake/resolve_dependency_modules/hyperscan.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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)

if(DEFINED ENV{VELOX_HYPERSCAN_URL})
set(VELOX_HYPERSCAN_SOURCE_URL "$ENV{VELOX_HYPERSCAN_URL}")
else()
set(VELOX_HYPERSCAN_VERSION v5.4.2)
set(VELOX_HYPERSCAN_SOURCE_URL
"https://github.com/intel/hyperscan/archive/refs/tags/${VELOX_HYPERSCAN_VERSION}.tar.gz"
)
set(VELOX_HYPERSCAN_BUILD_SHA256_CHECKSUM
32b0f24b3113bbc46b6bfaa05cf7cf45840b6b59333d078cc1f624e4c40b2b99)
endif()

message(STATUS "Building hyperscan from source")
FetchContent_Declare(
hyperscan
URL ${VELOX_HYPERSCAN_SOURCE_URL}
URL_HASH SHA256=${VELOX_HYPERSCAN_BUILD_SHA256_CHECKSUM})

set(CMAKE_CXX_STANDARD_BACKUP ${CMAKE_CXX_STANDARD})
# C++ 17 is not supported.
set(CMAKE_CXX_STANDARD 11)
set(BUILD_EXAMPLES FALSE)
#set(BUILD_AVX512 ON)
FetchContent_MakeAvailable(hyperscan)
set(CMAKE_CXX_STANDARD ${CMAKE_CXX_STANDARD_BACKUP})
# if(ICU_SOURCE)
# # empty var will cause a syntax error
# if(${ICU_SOURCE} STREQUAL "BUNDLED")
# # build re2 after icu so the files are available
# add_dependencies(re2 ICU ICU::uc)
# endif()
# endif()

# set(re2_LIBRARIES ${re2_BINARY_DIR}/libre2.a)
# set(re2_INCLUDE_DIRS ${re2_SOURCE_DIR})

# set(RE2_ROOT ${re2_BINARY_DIR})
# set(re2_ROOT ${re2_BINARY_DIR})
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,9 @@ endif()
set_source(re2)
resolve_dependency(re2)

set_source(hyperscan)
resolve_dependency(hyperscan 5.4.2)

if(${VELOX_BUILD_PYTHON_PACKAGE})
set_source(pybind11)
resolve_dependency(pybind11 2.10.0)
Expand Down

0 comments on commit 76d2d58

Please sign in to comment.