Skip to content

Commit

Permalink
Remove vestiges of SparseHash support
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Dec 17, 2024
1 parent 65ca936 commit 4c62886
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions cmake/FindOsmium.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
# io - include libraries needed for any type of input/output
# geos - include if you want to use any of the GEOS functions
# gdal - include if you want to use any of the OGR functions
# sparsehash - include if you use the sparsehash index (deprecated!)
# lz4 - include support for LZ4 compression of PBF files
#
# You can check for success with something like this:
Expand Down Expand Up @@ -204,41 +203,6 @@ if(Osmium_USE_GDAL)
endif()
endif()

#----------------------------------------------------------------------
# Component 'sparsehash'
if(Osmium_USE_SPARSEHASH)
message(WARNING "Osmium: Use of Google SparseHash is deprecated. Please switch to a different index type.")
find_path(SPARSEHASH_INCLUDE_DIR google/sparsetable)

list(APPEND OSMIUM_EXTRA_FIND_VARS SPARSEHASH_INCLUDE_DIR)
if(SPARSEHASH_INCLUDE_DIR)
# Find size of sparsetable::size_type. This does not work on older
# CMake versions because they can do this check only in C, not in C++.
if(NOT CMAKE_VERSION VERSION_LESS 3.0)
include(CheckTypeSize)
set(CMAKE_REQUIRED_INCLUDES ${SPARSEHASH_INCLUDE_DIR})
set(CMAKE_EXTRA_INCLUDE_FILES "google/sparsetable")
check_type_size("google::sparsetable<int>::size_type" SPARSETABLE_SIZE_TYPE LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_INCLUDES)
else()
set(SPARSETABLE_SIZE_TYPE ${CMAKE_SIZEOF_VOID_P})
endif()

# Sparsetable::size_type must be at least 8 bytes (64bit), otherwise
# OSM object IDs will not fit.
if(SPARSETABLE_SIZE_TYPE GREATER 7)
set(SPARSEHASH_FOUND 1)
add_definitions(-DOSMIUM_WITH_SPARSEHASH=${SPARSEHASH_FOUND})
list(APPEND OSMIUM_INCLUDE_DIRS ${SPARSEHASH_INCLUDE_DIR})
else()
message(WARNING "Osmium: Disabled Google SparseHash library on 32bit system (size_type=${SPARSETABLE_SIZE_TYPE}).")
endif()
else()
message(WARNING "Osmium: Google SparseHash library is required but not found, please install it or configure the paths.")
endif()
endif()

#----------------------------------------------------------------------

list(REMOVE_DUPLICATES OSMIUM_INCLUDE_DIRS)
Expand Down

0 comments on commit 4c62886

Please sign in to comment.