Skip to content

Commit

Permalink
Merge pull request #131 from a-detiste/master
Browse files Browse the repository at this point in the history
allow one to use system ZSTD
  • Loading branch information
rtissera authored Nov 11, 2024
2 parents 51d1f28 + 40159c5 commit b397465
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if(CMAKE_PROJECT_NAME STREQUAL "chdr")
endif()
option(INSTALL_STATIC_LIBS "Install static libraries" OFF)
option(WITH_SYSTEM_ZLIB "Use system provided zlib library" OFF)
option(WITH_SYSTEM_ZSTD "Use system provided zstd library" OFF)

option(BUILD_LTO "Compile libchdr with link-time optimization if supported" OFF)
if(BUILD_LTO)
Expand Down Expand Up @@ -49,11 +50,16 @@ else()
endif()

# zstd
option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF)
option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF)
option(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
add_subdirectory(deps/zstd-1.5.6/build/cmake EXCLUDE_FROM_ALL)
list(APPEND CHDR_LIBS libzstd_static)
if (WITH_SYSTEM_ZSTD)
find_package(zstd REQUIRED)
list(APPEND PLATFORM_LIBS zstd::libzstd_shared)
else()
option(ZSTD_BUILD_SHARED "BUILD SHARED LIBRARIES" OFF)
option(ZSTD_BUILD_PROGRAMS "BUILD PROGRAMS" OFF)
option(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
add_subdirectory(deps/zstd-1.5.6/build/cmake EXCLUDE_FROM_ALL)
list(APPEND CHDR_LIBS libzstd_static)
endif()
#--------------------------------------------------
# chdr
#--------------------------------------------------
Expand Down

0 comments on commit b397465

Please sign in to comment.