Skip to content

Commit

Permalink
Fix: Static Builds Against C-Blosc2
Browse files Browse the repository at this point in the history
This uses the new C-Blosc2 `Blosc2Config.cmake` packages, so we
can do purely static builds.
  • Loading branch information
ax3l committed Jul 26, 2023
1 parent 1df3a06 commit 6f3ae6f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 95 deletions.
7 changes: 4 additions & 3 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ function(lists_get_prefix listVars outVar)
endfunction()

# Blosc2
option(ADIOS2_PREFER_SHARED_Blosc2 "prefer sharred Blosc2 libraries" ON)
if(ADIOS2_USE_Blosc2 STREQUAL AUTO)
find_package(Blosc2 2.4)
find_package(Blosc2 2.4 CONFIG)
elseif(ADIOS2_USE_Blosc2)
find_package(Blosc2 2.4 REQUIRED)
find_package(Blosc2 2.4 CONFIG REQUIRED)
endif()
if(BLOSC2_FOUND)
if(Blosc2_FOUND)
set(ADIOS2_HAVE_Blosc2 TRUE)
endif()

Expand Down
91 changes: 0 additions & 91 deletions cmake/FindBlosc2.cmake

This file was deleted.

6 changes: 5 additions & 1 deletion source/adios2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ endif()

if(ADIOS2_HAVE_Blosc2)
target_sources(adios2_core PRIVATE operator/compress/CompressBlosc.cpp)
target_link_libraries(adios2_core PRIVATE Blosc2::Blosc2)
if(ADIOS2_PREFER_SHARED_Blosc2 AND TARGET Blosc2::blosc2_shared)
target_link_libraries(adios2_core PRIVATE Blosc2::blosc2_shared)
else()
target_link_libraries(adios2_core PRIVATE Blosc2::blosc2_static)
endif()
endif()

if(ADIOS2_HAVE_BZip2)
Expand Down

0 comments on commit 6f3ae6f

Please sign in to comment.