Skip to content

Commit

Permalink
Upgrade cmake to 3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-- authored and prot0man committed Jan 16, 2024
1 parent 0b8109e commit d519e89
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
cmake --build build
tree -sha build
- name: Test
run: ASAN_OPTIONS=detect_leaks=0 LSAN_OPTIONS=verbosity=1:log_threads=1 cmake --build build --target test
run: |
cd build
ASAN_OPTIONS=detect_leaks=0 LSAN_OPTIONS=verbosity=1:log_threads=1 CTEST_OUTPUT_ON_FAILURE=1 ctest -VV --output-on-failure
macos:
runs-on: macos-latest
Expand All @@ -33,7 +35,9 @@ jobs:
cmake --build build
tree -sha build
- name: Test
run: cmake --build build --target test
run: |
cd build
CTEST_OUTPUT_ON_FAILURE=1 ctest -VV --output-on-failure
# freebsd:
# runs-on: macos-latest
Expand Down Expand Up @@ -63,7 +67,7 @@ jobs:
- name: Test
run: |
cd build
ctest -VV -C "Debug"
ctest -VV -C "Debug" --output-on-failure
windows-mingw:
runs-on: "windows-latest"
Expand All @@ -76,4 +80,6 @@ jobs:
cmake --build build
tree /a /f build
- name: Test
run: cmake --build build --target test
run: |
cd build
ctest -VV -C "Debug" --output-on-failure
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.17)

project(zip
LANGUAGES C
Expand Down
6 changes: 5 additions & 1 deletion src/zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ zip_stream_extract(const char *stream, size_t size, const char *dir,
/**
* Opens zip archive stream into memory.
*
* @param stream zip archive stream.
* @param stream zip archive stream. If not NULL,
* stream will be freed on zip_stream_close.
* @param size stream size.
* @param level compression level (0-9 are the standard zlib-style levels).
* @param mode file access mode.
Expand Down Expand Up @@ -494,6 +495,9 @@ extern ZIP_EXPORT ssize_t zip_stream_copy(struct zip_t *zip, void **buf,
/**
* Close zip archive releases resources.
*
* If a buffer was provided to zip_stream_open,
* it will be unallocated here.
*
* @param zip zip archive handler.
*
* @return
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.17)

find_package(Sanitizers)

Expand Down
2 changes: 1 addition & 1 deletion test/test_entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ MU_TEST(test_entries_delete_stream) {
zip_stream_copy(zip, (void **)&modified_zdata, &zsize);
mu_check(modified_zdata != NULL);

// Note that zip_stream_close will free the zdata passed in zip_stream_open
zip_stream_close(zip);
free(zdata);
zdata = NULL;

zip = zip_stream_open(modified_zdata, zsize, 0, 'r');
Expand Down

0 comments on commit d519e89

Please sign in to comment.