Skip to content

Commit f032f63

Browse files
authored
perf: update to bit7z 4.0.10 (#84)
Signed-off-by: l.feng <[email protected]>
1 parent aa4766e commit f032f63

7 files changed

+165
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/cmake/CompilerOptions.cmake b/cmake/CompilerOptions.cmake
2+
index 1cdb84f..fd9346f 100644
3+
--- a/cmake/CompilerOptions.cmake
4+
+++ b/cmake/CompilerOptions.cmake
5+
@@ -70,7 +70,7 @@ if( MSVC )
6+
endforeach()
7+
endif()
8+
else()
9+
- target_compile_options( ${LIB_TARGET} PRIVATE -Wall -Wextra -Werror -Wconversion -Wsign-conversion )
10+
+ target_compile_options( ${LIB_TARGET} PRIVATE -Wall -Wextra -Wconversion -Wsign-conversion )
11+
endif()
12+
13+
# Extra warning flags for Clang
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index f8ff6f0..855b78d 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -194,15 +194,22 @@ include( cmake/BuildOptions.cmake )
6+
include( cmake/CompilerOptions.cmake )
7+
8+
# dependencies
9+
-include( cmake/Dependencies.cmake )
10+
+# include( cmake/Dependencies.cmake )
11+
+find_package(7zip CONFIG REQUIRED)
12+
+add_library(7-zip ALIAS 7zip::7zip)
13+
14+
# 7-zip source code
15+
target_link_libraries( ${LIB_TARGET} PRIVATE 7-zip )
16+
17+
# filesystem library (needed if std::filesystem is not available)
18+
+if(0)
19+
if( ghc_filesystem_ADDED )
20+
target_link_libraries( ${LIB_TARGET} PRIVATE ghc_filesystem )
21+
endif()
22+
+else()
23+
+ find_package(ghc_filesystem CONFIG REQUIRED)
24+
+ target_link_libraries(${LIB_TARGET} PRIVATE ghcFilesystem::ghc_filesystem )
25+
+endif()
26+
27+
# public includes
28+
target_include_directories( ${LIB_TARGET} PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 2eb8634..f8ff6f0 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -179,7 +179,7 @@ message( STATUS "Language Standard for bit7z: C++${CMAKE_CXX_STANDARD}" )
6+
set( LIB_TARGET bit7z${ARCH_POSTFIX} )
7+
add_library( ${LIB_TARGET} STATIC )
8+
target_sources( ${LIB_TARGET}
9+
- PUBLIC ${PUBLIC_HEADERS}
10+
+ # PUBLIC ${PUBLIC_HEADERS}
11+
PRIVATE ${HEADERS} ${SOURCES} )
12+
13+
# additional target without the architecture suffix in the name
14+
@@ -246,3 +246,29 @@ endif()
15+
if( BIT7Z_BUILD_DOCS )
16+
add_subdirectory( docs )
17+
endif()
18+
+
19+
+set_target_properties(${LIB_TARGET} PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
20+
+
21+
+include(CMakePackageConfigHelpers)
22+
+configure_package_config_file(
23+
+ "${CMAKE_CURRENT_SOURCE_DIR}/unofficial-bit7z-config.cmake.in"
24+
+ "${CMAKE_CURRENT_BINARY_DIR}/unofficial-bit7z-config.cmake"
25+
+ INSTALL_DESTINATION "share/unofficial-bit7z"
26+
+)
27+
+install(
28+
+ FILES "${CMAKE_CURRENT_BINARY_DIR}/unofficial-bit7z-config.cmake"
29+
+ DESTINATION "share/unofficial-bit7z"
30+
+)
31+
+
32+
+include(GNUInstallDirs)
33+
+install(
34+
+ TARGETS ${LIB_TARGET}
35+
+ EXPORT unofficial-bit7z-targets
36+
+ COMPONENT bit7z
37+
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
38+
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
39+
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
40+
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bit7z COMPONENT bit7z_development)
41+
+
42+
+install(EXPORT unofficial-bit7z-targets FILE unofficial-bit7z-targets.cmake NAMESPACE unofficial::bit7z:: DESTINATION share/unofficial-bit7z)
43+
+
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2+
3+
vcpkg_from_github(
4+
OUT_SOURCE_PATH SOURCE_PATH
5+
REPO rikyoz/bit7z
6+
REF "v${VERSION}"
7+
SHA512 18bd18bc7186c04d9c2e731c76f23ab97a796a0ec027dc7163626f30ca807ba98733dbcd96bbca9af0cd0497cede4561c84560bf4e28030f59e1e34c1d98204d
8+
HEAD_REF master
9+
PATCHES
10+
fix_install.patch
11+
fix_dependency.patch
12+
fix_compile_options.patch
13+
)
14+
15+
file(COPY "${CMAKE_CURRENT_LIST_DIR}/unofficial-bit7z-config.cmake.in" DESTINATION "${SOURCE_PATH}")
16+
17+
vcpkg_check_features(
18+
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
19+
FEATURES
20+
regex-matching BIT7Z_REGEX_MATCHING
21+
)
22+
23+
vcpkg_cmake_configure(
24+
SOURCE_PATH "${SOURCE_PATH}"
25+
OPTIONS
26+
-DBIT7Z_AUTO_FORMAT=ON
27+
-DBIT7Z_AUTO_PREFIX_LONG_PATHS=ON
28+
-DBIT7Z_DISABLE_ZIP_ASCII_PWD_CHECK=OFF
29+
-DBIT7Z_PATH_SANITIZATION=ON
30+
-DBIT7Z_DISABLE_USE_STD_FILESYSTEM=OFF
31+
-DBIT7Z_USE_STD_BYTE=OFF
32+
-DBIT7Z_USE_NATIVE_STRING=OFF
33+
-DBIT7Z_USE_SYSTEM_CODEPAGE=OFF
34+
-DBIT7Z_BUILD_TESTS=OFF
35+
-DBIT7Z_BUILD_DOCS=OFF
36+
${FEATURE_OPTIONS}
37+
)
38+
39+
vcpkg_cmake_install()
40+
vcpkg_copy_pdbs()
41+
42+
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-bit7z CONFIG_PATH share/unofficial-bit7z)
43+
44+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
45+
46+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@PACKAGE_INIT@
2+
3+
include(CMakeFindDependencyMacro)
4+
5+
find_dependency(7zip CONFIG)
6+
find_dependency(ghc_filesystem CONFIG)
7+
8+
include("${CMAKE_CURRENT_LIST_DIR}/unofficial-bit7z-targets.cmake")
9+
10+
check_required_components(bit7z)

cmake/vcpkg/ports/bit7z/vcpkg.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "bit7z",
3+
"version": "4.0.10",
4+
"description": "A C++ static library offering a clean and simple interface to the 7-zip shared libraries.",
5+
"homepage": "https://github.com/rikyoz/bit7z",
6+
"license": "MPL-2.0",
7+
"dependencies": [
8+
"7zip",
9+
"ghc-filesystem",
10+
{
11+
"name": "vcpkg-cmake",
12+
"host": true
13+
},
14+
{
15+
"name": "vcpkg-cmake-config",
16+
"host": true
17+
}
18+
],
19+
"features": {
20+
"regex-matching": {
21+
"description": "Enables the support for extracting files matching regular expressions"
22+
}
23+
}
24+
}

vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"name": "bit7z",
26-
"version": "4.0.9#1"
26+
"version": "4.0.10"
2727
},
2828
{
2929
"name": "7zip",

0 commit comments

Comments
 (0)