Skip to content

Still a corner case failure with if(ENABLE_ZSTD) #404

@heitbaum

Description

@heitbaum

I looked at this further today. Whilst there is a workaround by setting ENABLE_ZSTD=OFF the following code still has the chance of erroring. There is an alternative fix in that line 251 could be updated to cause a hard failure, not passthru.

libzip/CMakeLists.txt

Lines 241 to 253 in 210b09d

if(ENABLE_ZSTD)
find_package(zstd 1.3.6)
if(zstd_FOUND)
set(HAVE_LIBZSTD 1)
if(TARGET zstd::libzstd_shared)
set(zstd_TARGET zstd::libzstd_shared)
else()
set(zstd_TARGET zstd::libzstd_static)
endif()
else()
message(WARNING "-- zstd library not found; zstandard support disabled")
endif(zstd_FOUND)
endif(ENABLE_ZSTD)

Line 353 should really be conditioned by zstd_FOUND or zstd_TARGET, as if zstd is not found then the incorrect .pc file is still generated.

libzip/CMakeLists.txt

Lines 352 to 354 in 210b09d

if(ENABLE_ZSTD)
string(REGEX REPLACE "-l${zstd_TARGET}" "-lzstd" LIBS ${LIBS})
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions