Skip to content

Commit

Permalink
adding platform specific libzip headers
Browse files Browse the repository at this point in the history
  • Loading branch information
gangatp committed Dec 6, 2023
1 parent caf3036 commit d81ce65
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 148 deletions.
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ if (USE_INCLUDED_LIBZIP)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE advapi32)
endif()
if (UNIX OR MINGW)
target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_FSEEKO")
target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_FTELLO")
target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_STRCASECMP")
target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_UNISTD_H")

# create libzip autogenerated platform specific headers
if(NOT EXISTS ${CMAKE_BINARY_DIR}/libzip)
execute_process(
COMMAND ${CMAKE_COMMAND} "-DZLIB_INCLUDE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/submodules/zlib" "-DZLIB_LIBRARY=zlibstatic" "-DENABLE_COMMONCRYPTO=OFF" "-DENABLE_GNUTLS=OFF" "-DENABLE_MBEDTLS=OFF" "-DENABLE_OPENSSL=OFF" "-DENABLE_WINDOWS_CRYPTO=OFF" "-S" "${CMAKE_CURRENT_SOURCE_DIR}/submodules/libzip" "-B" "${CMAKE_CURRENT_BINARY_DIR}/libzip"
RESULT_VARIABLE CMD_ERROR
OUTPUT_QUIET)
MESSAGE( STATUS "CMD_ERROR:" ${CMD_ERROR})
endif()
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/libzip)

else()
find_package(PkgConfig REQUIRED)
Expand Down
72 changes: 0 additions & 72 deletions Libraries/libzip/Include/config.h

This file was deleted.

51 changes: 0 additions & 51 deletions Libraries/libzip/Include/zipconf.h

This file was deleted.

10 changes: 0 additions & 10 deletions submodules/update_libs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,6 @@ mkdir "%lib_path_dest%Source\unix"
robocopy *win32*.c %lib_path_src%lib\ "%lib_path_dest%Source\win"
robocopy *unix*.c *stdio_named*.c %lib_path_src%lib\ "%lib_path_dest%Source\unix"

cd %lib_name%
mkdir build
cd build
cmake .. -DZLIB_INCLUDE_DIR="../../zlib" -DZLIB_LIBRARY=zlibstatic -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF

cd ..
robocopy *.h %lib_path_src%build ..\%lib_path_dest%Include
RD /S /Q build
cd %base_path%

REM generate autogenerated file using cmake script run
cd %lib_path_dest%Source\
cmake -DPROJECT_SOURCE_DIR=%lib_path_src% -P %lib_path_src%cmake\GenerateZipErrorStrings.cmake
Expand Down
10 changes: 0 additions & 10 deletions submodules/update_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,11 @@ find "${lib_path_src}lib" -name "*win32*.c" \
find "${lib_path_src}lib" \( -name "*unix*.c" -o -name "*stdio_named*.c" \) \
-exec cp {} "${lib_path_dest}Source/unix" \;

cd ${lib_path_src}
mkdir build
cd build
cmake .. -DZLIB_INCLUDE_DIR="../../zlib" -DZLIB_LIBRARY=zlibstatic -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF
cd ..
cp ${lib_path_src}build/*.h "../${lib_path_dest}Include"
rm -rf build
cd "$base_path"

cd "${lib_path_dest}Source"
cmake -DPROJECT_SOURCE_DIR=${lib_path_src} -P ${lib_path_src}cmake/GenerateZipErrorStrings.cmake
cd "$base_path"
echo "$tag" > "$lib_path_dest${lib_name}_$tag.txt"


# updating the googletest library
lib_name="googletest"
lib_path_src="$base_path$lib_name/googletest/"
Expand Down

0 comments on commit d81ce65

Please sign in to comment.