Skip to content

Commit 26d582f

Browse files
committed
[acquire/CMakeLists.txt] Fix handling of checksums and unarchive libs ; [acquire/acquire_miniz.h] Use my new vcpkg upgrade of this port with a reasonably deep include hierarchy ; [acquire/acquire_crc32c.h] Add missing include to resolve undefined symbol error
1 parent aa0598a commit 26d582f

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

acquire/CMakeLists.txt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,7 @@ else ()
350350
message(STATUS "[libacquire] Using var ${CHECKSUM_LIBRARIES} for checksums")
351351
target_link_libraries("${LIBRARY_NAME}" PUBLIC "${CHECKSUM_LIBRARIES}")
352352
target_compile_definitions("${LIBRARY_NAME}" PRIVATE "${CHECKSUM_LIBRARIES_USE}=1")
353-
elseif (LIBACQUIRE_USE_CRC32C)
354-
message(STATUS "[libacquire] Using internal CRC32C implementation")
355-
target_compile_definitions("${LIBRARY_NAME}" PRIVATE LIBACQUIRE_USE_CRC32C=1)
356-
else ()
357-
message(FATAL_ERROR "No checksum implementation selected: define `LIBACQUIRE_USE_LIBRHASH` or `LIBACQUIRE_USE_CRC32C`")
358-
endif ()
359-
360-
if (LIBACQUIRE_USE_LIBRHASH)
353+
elseif (LIBACQUIRE_USE_LIBRHASH)
361354
message(STATUS "[libacquire] Using LibRHash for checksums")
362355

363356
find_package(LibRHash REQUIRED)
@@ -372,10 +365,22 @@ else ()
372365
else ()
373366
message(STATUS "${LIBRARY_NAME} already linked with '${_lib}'")
374367
endif (lib_index EQUAL -1)
375-
elseif (LIBACQUIRE_USE_MINIZ)
368+
elseif (LIBACQUIRE_USE_CRC32C)
369+
message(STATUS "[libacquire] Using internal CRC32C implementation")
370+
target_compile_definitions("${LIBRARY_NAME}" PRIVATE LIBACQUIRE_USE_CRC32C=1)
371+
else ()
372+
message(FATAL_ERROR "No checksum implementation selected: define `LIBACQUIRE_USE_LIBRHASH` or `LIBACQUIRE_USE_CRC32C`")
373+
endif ()
374+
375+
if (LIBACQUIRE_USE_MINIZ)
376376
find_package(kubazip CONFIG REQUIRED)
377377
target_compile_definitions("${LIBRARY_NAME}" PRIVATE LIBACQUIRE_USE_MINIZ=1)
378-
target_link_libraries("${EXEC_NAME}" PRIVATE kubazip::kubazip)
378+
target_link_libraries("${LIBRARY_NAME}" PRIVATE kubazip::kubazip)
379+
elseif (LIBACQUIRE_USE_LIBARCHIVE)
380+
target_compile_definitions("${LIBRARY_NAME}" PRIVATE LIBACQUIRE_USE_LIBARCHIVE=1)
381+
target_link_libraries("${LIBRARY_NAME}" PRIVATE "${LibArchive_LIBRARIES}")
382+
else ()
383+
message(FATAL_ERROR "No unarchive implementation selected: define `LIBACQUIRE_USE_LIBARCHIVE` or `LIBACQUIRE_USE_MINIZ`")
379384
endif ()
380385

381386
if (NOT BSD)

acquire/acquire_crc32c.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ extern "C" {
2626
#endif /* defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || \
2727
defined(__NT__) */
2828

29+
#include "acquire_checksums.h"
30+
2931
/*
3032
* Taken from FreeBSD implementation of CRC32C, specifically:
3133
* - usr.bin\cksum\crc32_algo.c @ d91d2b513eb30a226e87f0e52e2f9f232a2e1ca3

acquire/acquire_miniz.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extern "C" {
1111
#include <stdio.h>
1212
#include <stdlib.h>
1313

14-
#include <kubazip/zip/zip.h>
14+
#include <kubazip/zip.h>
1515

1616
#include "acquire_errors.h"
1717
#include "acquire_extract.h"

0 commit comments

Comments
 (0)