summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNilesh Patra <nilesh@debian.org>2023-02-07 09:05:03 +0100
committerAndreas Tille <tille@debian.org>2023-02-07 09:05:03 +0100
commit0ddfb89d6d42b741b92fb0e4eaed376edacbc132 (patch)
treedbdacd42f5064743f97fd87711d3943a9fe1fa05
parent557fb16509d9b931a479ccfc02f3f147efc47572 (diff)
Use packaged streamvbyte instead of third_party
Forwarded: not-needed Last-Update: 2021-05-22 Gbp-Pq: Name use-packaged-streamvbyte.patch
-rw-r--r--CMakeLists.txt30
-rw-r--r--vbz/CMakeLists.txt16
2 files changed, 8 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9421f8..b3b7f1d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -145,34 +145,8 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/third_party")
find_package(HDF5 1.8.16)
find_package(zstd 1.3.1 REQUIRED)
find_package(Sanitizers)
-
-get_filename_component(STREAMVBYTE_SOURCE_DIR
- third_party/streamvbyte
- ABSOLUTE
-)
-set(STREAMVBYTE_INSTALL_DIR "${CMAKE_BINARY_DIR}/streamvbyte_lib/")
-set(STREAMVBYTE_PREFIX ${CMAKE_BINARY_DIR}/streamvbyte)
-set(STREAMVBYTE_STATIC_LIB_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}streamvbyte_static${CMAKE_STATIC_LIBRARY_SUFFIX})
-set(STREAMVBYTE_STATIC_LIB_SUBDIR ".")
-get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
-if (is_multi_config)
- set(STREAMVBYTE_STATIC_LIB_SUBDIR "$<CONFIG>")
-endif()
-ExternalProject_Add(
- streamvbyte
- SOURCE_DIR ${STREAMVBYTE_SOURCE_DIR}
- UPDATE_DISCONNECTED TRUE
- PREFIX ${STREAMVBYTE_PREFIX}
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${STREAMVBYTE_INSTALL_DIR} -DSTREAMVBYTE_DISABLE_NATIVE=ON -DSTD_FLAGS="-std=c99"
- # We need to tell CMake about libraries we will link to, otherwise some generators (eg: Ninja)
- # complain about how knowing how to build libstreamvbyte_static.a, for example.
- # Ideally, we'd set a hypothetical INSTALL_BYPRODUCTS, and link to the installed file, but that
- # doesn't seem to be an option.
- BUILD_BYPRODUCTS "<BINARY_DIR>/${STREAMVBYTE_STATIC_LIB_NAME}"
-)
-ExternalProject_Get_Property(streamvbyte BINARY_DIR)
-set(STREAMVBYTE_STATIC_LIB "${BINARY_DIR}/${STREAMVBYTE_STATIC_LIB_SUBDIR}/${STREAMVBYTE_STATIC_LIB_NAME}")
-
+find_library(STREAMVBYTE_STATIC_LIB NAMES libstreamvbyte.a PATHS /usr/lib/$ENV{DEB_HOST_MULTIARCH})
+message("INFO: The library that was found is: ${STREAMVBYTE_STATIC_LIB}")
########################################################################
#
diff --git a/vbz/CMakeLists.txt b/vbz/CMakeLists.txt
index 964b765..4526474 100644
--- a/vbz/CMakeLists.txt
+++ b/vbz/CMakeLists.txt
@@ -22,14 +22,16 @@ target_include_directories(vbz
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ${STREAMVBYTE_INSTALL_DIR}/include
+)
+
+target_link_libraries(vbz
+ PUBLIC
+ ${STREAMVBYTE_STATIC_LIB}
+ zstd::zstd
)
# This explicit dependency is required to make sure the header files are installed into the right
# location before we try building against them.
-add_dependencies(vbz
- streamvbyte
-)
if (WIN32 OR
(APPLE AND NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm64") OR
@@ -39,12 +41,6 @@ if (WIN32 OR
endif()
endif()
-target_link_libraries(vbz
- PUBLIC
- ${STREAMVBYTE_STATIC_LIB}
- zstd::zstd
-)
-
if (BUILD_TESTING)
add_subdirectory(fuzzing)
add_subdirectory(test)