Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add GEOS library as an optional dependency #12243

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMake/resolve_dependency_modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ by Velox. See details on bundling below.
| DuckDB (testing) | 0.8.1 | Yes |
| cpr (testing) | 1.10.15 | Yes |
| arrow | 15.0.0 | Yes |
| geos | 3.13.0 | Yes |

# Bundled Dependency Management
This module provides a dependency management system that allows us to automatically fetch and build dependencies from source if needed.
Expand Down
33 changes: 33 additions & 0 deletions CMake/resolve_dependency_modules/geos.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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)

# GEOS Configuration
set(VELOX_GEOS_BUILD_VERSION 3.13.0)
set(VELOX_GEOS_BUILD_SHA256_CHECKSUM
47ec83ff334d672b9e4426695f15da6e6368244214971fabf386ff8ef6df39e4)
string(
CONCAT
VELOX_GEOS_SOURCE_URL "https://download.osgeo.org/geos/"
"geos-${VELOX_GEOS_BUILD_VERSION}.tar.bz2")

velox_resolve_dependency_url(GEOS)

FetchContent_Declare(
geos
URL ${VELOX_GEOS_SOURCE_URL}
URL_HASH ${VELOX_GEOS_BUILD_SHA256_CHECKSUM}
)
set(BUILD_SHARED_LIBS ${VELOX_BUILD_SHARED})
FetchContent_MakeAvailable(geos)
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ option(VELOX_ENABLE_ABFS "Build Abfs Connector" OFF)
option(VELOX_ENABLE_HDFS "Build Hdfs Connector" OFF)
option(VELOX_ENABLE_PARQUET "Enable Parquet support" ON)
option(VELOX_ENABLE_ARROW "Enable Arrow support" OFF)
option(VELOX_ENABLE_GEO "Enable Geospatial support" ON)
option(VELOX_ENABLE_REMOTE_FUNCTIONS "Enable remote function support" OFF)
option(VELOX_ENABLE_CCACHE "Use ccache if installed." ON)

Expand Down Expand Up @@ -626,4 +627,9 @@ if(VELOX_ENABLE_ARROW)
velox_resolve_dependency(Arrow)
endif()

if(VELOX_ENABLE_GEO)
velox_set_source(geos)
velox_resolve_dependency(geos)
endif()

add_subdirectory(velox)