Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Add here...
### Specifications

- OS platform:
- Rust version:
- C++ compiler and compiler version:
- `databento-cpp` version:
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.32.1 - 2025-04-07

### Bug fixes
- Fixed CMake error when `zstdTargets.cmake` exists
- Reverted `vcpkg` baseline change

## 0.32.0 - 2025-04-02

### Enhancements
Expand Down
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14)
# Project details
#

project("databento" VERSION 0.32.0 LANGUAGES CXX)
project("databento" VERSION 0.32.1 LANGUAGES CXX)
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPERCASE)

#
Expand Down Expand Up @@ -115,7 +115,14 @@ endif()
#

find_package(OpenSSL REQUIRED)
find_package(Zstd REQUIRED)
find_package(zstd REQUIRED)
if(NOT TARGET zstd::libzstd)
if(TARGET zstd::libzstd_shared)
add_library(zstd::libzstd ALIAS zstd::libzstd_shared)
elseif(TARGET zstd::libzstd_static)
add_library(zstd::libzstd ALIAS zstd::libzstd_static)
endif()
endif()
find_package(Threads REQUIRED)

include(FetchContent)
Expand Down Expand Up @@ -239,7 +246,7 @@ target_link_libraries(
OpenSSL::Crypto
OpenSSL::SSL
Threads::Threads
${ZSTD_TARGET}
zstd::libzstd
)

target_compile_definitions(
Expand Down Expand Up @@ -376,7 +383,7 @@ install(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
# Install so it can be used in databentoConfig.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindZstd.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findzstd.cmake
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
Expand Down
59 changes: 38 additions & 21 deletions cmake/FindZstd.cmake → cmake/Findzstd.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
include(FindPackageHandleStandardArgs)

find_library(ZSTD_LIBRARY NAMES zstd)
if(WIN32)
find_library(ZSTD_SHARED_LIBRARY NAMES zstd)
else()
set(_previous_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".dylib")
find_library(ZSTD_SHARED_LIBRARY NAMES zstd)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib")
find_library(ZSTD_STATIC_LIBRARY NAMES zstd zstd_static zstd-static)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_previous_suffixes})
endif()

find_path(ZSTD_INCLUDE_DIR NAMES zstd.h)

if(ZSTD_SHARED_LIBRARY)
set(ZSTD_LIBRARY "${ZSTD_SHARED_LIBRARY}")
elseif(ZSTD_STATIC_LIBRARY)
set(ZSTD_LIBRARY "${ZSTD_STATIC_LIBRARY}")
endif()

#
# Detect version
#
Expand All @@ -25,7 +41,7 @@ if(ZSTD_INCLUDE_DIR)
endif()

find_package_handle_standard_args(
Zstd
zstd
REQUIRED_VARS ZSTD_LIBRARY ZSTD_INCLUDE_DIR
VERSION_VAR ZSTD_VERSION
)
Expand All @@ -34,35 +50,36 @@ if(ZSTD_FOUND)
mark_as_advanced(ZSTD_LIBRARY)
mark_as_advanced(ZSTD_INCLUDE_DIR)
mark_as_advanced(ZSTD_VERSION)
else()
# Error out if neither target is found
message(FATAL_ERROR "zstd target not found.")
endif()

#
# Create namespaced target
#
if(ZSTD_FOUND AND NOT TARGET zstd::zstd)
add_library(zstd::zstd UNKNOWN IMPORTED)
if(NOT TARGET zstd::libzstd)
if(ZSTD_SHARED_LIBRARY)
if(WIN32)
add_library(zstd::libzstd UNKNOWN IMPORTED)
else()
add_library(zstd::libzstd SHARED IMPORTED)
endif()
if (NOT TARGET zstd::libzstd_shared)
add_library(zstd::libzstd_shared ALIAS zstd::libzstd)
endif()
else()
add_library(zstd::libzstd STATIC IMPORTED)
if (NOT TARGET zstd::libzstd_static)
add_library(zstd::libzstd_static ALIAS zstd::libzstd)
endif()
endif()
set_target_properties(
zstd::zstd
zstd::libzstd
PROPERTIES
IMPORTED_LOCATION ${ZSTD_LIBRARY}
# target_include_directories doesn't work with unknown imported libraries in older
# cmake versions
INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIR}
)
endif()
# cpp-httplib only searches for zstd::libzstd
if (NOT TARGET zstd::libzstd)
add_library(zstd::libzstd ALIAS zstd::zstd)
endif()

# Check if the Conan-provided target exists
if(TARGET zstd::libzstd_static)
# If the Conan target exists, use it
set(ZSTD_TARGET zstd::libzstd_static)
elseif(TARGET zstd::zstd)
# If the system-installed target exists, use it
set(ZSTD_TARGET zstd::zstd)
else()
# Error out if neither target is found
message(FATAL_ERROR "Zstd target not found.")
endif()
9 changes: 8 additions & 1 deletion cmake/databentoConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
# Add dependencies here so end-user doesn't have to
include(CMakeFindDependencyMacro)
find_dependency(date)
find_dependency(zstd)
if(NOT TARGET zstd::libzstd)
if(TARGET zstd::libzstd_shared)
add_library(zstd::libzstd ALIAS zstd::libzstd_shared)
elseif(TARGET zstd::libzstd_static)
add_library(zstd::libzstd ALIAS zstd::libzstd_static)
endif()
endif()
find_dependency(httplib)
find_dependency(nlohmann_json)
find_dependency(Threads)
find_dependency(Zstd)

include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")

Expand Down
2 changes: 1 addition & 1 deletion pkg/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Databento <support@databento.com>
_pkgname=databento-cpp
pkgname=databento-cpp-git
pkgver=0.32.0
pkgver=0.32.1
pkgrel=1
pkgdesc="Official C++ client for Databento"
arch=('any')
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"openssl",
"zstd"
],
"builtin-baseline": "b02e341c927f16d991edbd915d8ea43eac52096c"
"builtin-baseline": "d1e11918f5c88c1dd364b93e1452fea69bacd479"
}
Loading