-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2389 from Cgettys/fix-miniz-bug
zip: Update to latest version
- Loading branch information
Showing
15 changed files
with
5,692 additions
and
2,897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
# | ||
# Build script for travis-ci.org builds. | ||
# | ||
if [ $ANALYZE = "true" ] && [ "$CC" = "clang" ]; then | ||
# scan-build -h | ||
scan-build cmake -G "Unix Makefiles" | ||
scan-build -enable-checker security.FloatLoopCounter \ | ||
-enable-checker security.insecureAPI.UncheckedReturn \ | ||
--status-bugs -v \ | ||
make -j 8 \ | ||
make -j 8 test | ||
else | ||
cmake -DCMAKE_BUILD_TYPE=Debug -DSANITIZE_ADDRESS=On -DCMAKE_INSTALL_PREFIX=_install | ||
make -j 8 | ||
make install | ||
ASAN_OPTIONS=detect_leaks=0 LSAN_OPTIONS=verbosity=1:log_threads=1 ctest -V | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
language: c | ||
addons: | ||
apt: | ||
packages: &1 | ||
- lcov | ||
# Compiler selection | ||
compiler: | ||
- clang | ||
- gcc | ||
env: | ||
- ANALYZE=false | ||
- ANALYZE=true | ||
# Build steps | ||
script: | ||
- mkdir build | ||
- cd build | ||
- cmake -DCMAKE_BUILD_TYPE=Debug .. && make && make test | ||
- ./.travis.sh | ||
after_success: | ||
# Creating report | ||
- cmake -DENABLE_COVERAGE=ON | ||
- make | ||
- make test | ||
# Uploading report to CodeCov | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,47 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
project(zip) | ||
enable_language(C) | ||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
|
||
if (MSVC) | ||
# Use secure functions by defaualt and suppress warnings about "deprecated" functions | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1") | ||
# Use secure functions by defaualt and suppress warnings about "deprecated" functions | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1") | ||
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR | ||
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR | ||
"${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic") | ||
endif (MSVC) | ||
|
||
# zip | ||
set(SRC src/miniz.h src/zip.h src/zip.c) | ||
add_library(${CMAKE_PROJECT_NAME} ${SRC}) | ||
add_library(${PROJECT_NAME} ${SRC}) | ||
target_include_directories(${PROJECT_NAME} INTERFACE src) | ||
|
||
# test | ||
enable_testing() | ||
add_subdirectory(test) | ||
if (NOT CMAKE_DISABLE_TESTING) | ||
enable_testing() | ||
add_subdirectory(test) | ||
find_package(Sanitizers) | ||
add_sanitizers(${PROJECT_NAME} test.exe) | ||
add_sanitizers(${PROJECT_NAME} test_miniz.exe) | ||
endif() | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
RUNTIME DESTINATION bin | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
COMPONENT library) | ||
install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION include) | ||
|
||
# uninstall target (https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake) | ||
if(NOT TARGET uninstall) | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" | ||
IMMEDIATE @ONLY) | ||
|
||
add_custom_target(uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake) | ||
endif() |
Oops, something went wrong.