Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NC-15765: update zlib to v1.3 #327

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4f2ae2f
NC-15765: adding zlib as external project via cmake
gangatp Nov 20, 2023
ec7ca4a
handle offline mode
gangatp Nov 21, 2023
09cd844
adding zlib as submodule
gangatp Nov 23, 2023
5d8a1f1
cpp-base64 updated
gangatp Nov 28, 2023
99c6e4c
updating zlib
gangatp Nov 28, 2023
f9a1bcc
updating libzip
gangatp Nov 29, 2023
03243c0
removed old googletest
gangatp Nov 29, 2023
10ee058
removed old libressl
gangatp Nov 29, 2023
1b9bdbf
updating googletest
gangatp Nov 30, 2023
91c8e05
libressl copied release version
gangatp Dec 5, 2023
534ab10
updating github workflows mac and ubuntu OS versions
gangatp Dec 6, 2023
2730971
checking mingw and unix build
gangatp Dec 6, 2023
83f3f71
adding platform specific libzip headers
gangatp Dec 6, 2023
b3adc8b
libzip unix compile options
gangatp Dec 6, 2023
fa968b0
fixing mac build
gangatp Dec 7, 2023
0c10465
fixing linux version
gangatp Dec 7, 2023
571028f
fixing win32 build
gangatp Dec 7, 2023
8132c1d
checking mingw build
gangatp Dec 7, 2023
3c25db4
fixing memory leak in linux build
gangatp Dec 7, 2023
a8027b5
Revert "fixing memory leak in linux build"
gangatp Dec 7, 2023
b9c3409
try mem leak linux fix
gangatp Dec 7, 2023
aa7ed43
try linux build mem leak using insert
gangatp Dec 7, 2023
811bc75
reserve vector size
gangatp Dec 8, 2023
b4cf5ee
checking valgrind in debug build
gangatp Dec 8, 2023
b5b014c
checking lib3mf ubuntu mem leak in debug mode
gangatp Dec 11, 2023
07211df
trigger GitHub actions
gangatp Dec 11, 2023
f0c221c
checking lib3mf ubuntu mem leak in debug mode
gangatp Dec 11, 2023
4dd84e7
updating with ubuntu latest
gangatp Dec 11, 2023
f697d3d
adding sudo apt update to ubuntu
gangatp Dec 11, 2023
a39c596
fixing decryption size in RSA
gangatp Dec 12, 2023
3e1af9b
try linux build mem leak using insert
gangatp Dec 12, 2023
dcf4a03
remove debug config
gangatp Dec 12, 2023
7dafc44
excluding 3rd parties in codecov
gangatp Dec 13, 2023
c52139b
excluding 3rd parties in codecov
gangatp Dec 13, 2023
874eb7e
using latest codecov
gangatp Dec 13, 2023
dcbec3b
using latest checkout actions
gangatp Dec 13, 2023
e1be4a3
using locv ignore errors
gangatp Dec 13, 2023
1a5b97a
using locv ignore errors
gangatp Dec 13, 2023
e0ae7a7
using locv ignore errors
gangatp Dec 13, 2023
6bd2878
using locv ignore errors
gangatp Dec 13, 2023
ae3c74a
fixing code coverage
gangatp Dec 14, 2023
c1dc55c
excluding more files
gangatp Dec 14, 2023
de54f00
adding fast_float as dependency lib
gangatp Dec 15, 2023
f0644da
update scripting
gangatp Dec 18, 2023
30d50c6
fixing broken gtest update
gangatp Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
fixes:
- "Users/runner/work::" # move path

ignore:
- "Libraries"
- "submodules"
- "Documentation"
- "cmake"
- "CI"
- "**/*.py"
- "**/*.sh"
- "**/*.bat"
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ on: [push, pull_request]
name: Build
jobs:
build-linux:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- run: sudo apt update
- run: sudo apt install -y valgrind uuid-dev
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
codecoverage-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Prerequisites
Expand All @@ -61,11 +62,11 @@ jobs:
name: codecoverage.zip
path: build/codecoverage.zip
- name: Upload code coverage to codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/Test_CPP_Bindings_filtered.info
fail_ci_if_error: false # optional (default = false)
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

build-windows-release:
Expand Down Expand Up @@ -139,7 +140,7 @@ jobs:
- run: ctest -V
working-directory: ./build
assemble-sdk:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [build-windows-release, build-linux, build-macos]
steps:
- run: sudo apt install -y zip unzip
Expand All @@ -161,7 +162,7 @@ jobs:
name: lib3mf_sdk.zip
path: build/lib3mf_sdk.zip
deploy-linux:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: [assemble-sdk]
steps:
- run: sudo apt install -y zip unzip
Expand Down
18 changes: 12 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
[submodule "Tests/googletest"]
path = Tests/googletest
url = https://github.com/google/googletest.git
[submodule "Tests/libressl"]
path = Tests/libressl
url = https://github.com/3MFConsortium/forks-libressl-distribution.git
[submodule "submodules/AutomaticComponentToolkit"]
path = submodules/AutomaticComponentToolkit
url = https://github.com/Autodesk/AutomaticComponentToolkit.git
[submodule "submodules/fast_float"]
path = submodules/fast_float
url = https://github.com/fastfloat/fast_float.git
[submodule "submodules/zlib"]
path = submodules/zlib
url = https://github.com/madler/zlib.git
[submodule "submodules/libzip"]
path = submodules/libzip
url = https://github.com/nih-at/libzip.git
[submodule "submodules/cpp-base64"]
path = submodules/cpp-base64
url = https://github.com/ReneNyffenegger/cpp-base64.git
[submodule "submodules/googletest"]
path = submodules/googletest
url = https://github.com/google/googletest.git
53 changes: 45 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,56 @@ add_library(${PROJECT_NAME} SHARED ${SRCS_COMMON} ${HDRS_COMMON}
)
SOURCE_GROUP("Source Files\\Autogenerated" FILES ${ACT_GENERATED_SOURCE})


file(GLOB
LIBS_INCLUDE
LIST_DIRECTORIES true
${CMAKE_CURRENT_SOURCE_DIR}/Libraries/*/Include
)
list(FILTER LIBS_INCLUDE EXCLUDE REGEX "zlib|libzip|libressl")
target_include_directories(${PROJECT_NAME} PRIVATE ${LIBS_INCLUDE})


target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR_AUTOGENERATED}/Source)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/API)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include)


if (USE_INCLUDED_LIBZIP)
target_compile_options(${PROJECT_NAME} PRIVATE "-DZIP_STATIC")
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/Libraries/libzip)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libzip/Include)
if(MSVC)
target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)
target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_NONSTDC_NO_DEPRECATE)
endif()
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE advapi32)
# disable win32 build failing 'initializing': conversion from 'zip_uint64_t' to 'size_t', possible loss of data
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
target_compile_options(${PROJECT_NAME} PRIVATE /wd4244)
endif()
endif()

# 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"
"-DENABLE_BZIP2=OFF" "-DENABLE_LZMA=OFF" "-DENABLE_ZSTD=OFF"
"-DBUILD_TOOLS=OFF" "-DBUILD_REGRESS=OFF"
"-DBUILD_EXAMPLES=OFF" "-DBUILD_DOC=OFF" "-DBUILD_SHARED_LIBS=OFF" "-DLIBZIP_DO_INSTALL=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)

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")
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")
endif()

else()
Expand All @@ -136,15 +173,15 @@ else()
target_link_libraries(${PROJECT_NAME} ${LIBZIP_LIBRARIES})
endif()
if (USE_INCLUDED_ZLIB)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Include/Libraries/zlib)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/zlib/Include)
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(ZLIB REQUIRED zlib)
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES})
endif()


target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/fast_float/include)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/fast_float/Include)


set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "" )
Expand Down
2 changes: 1 addition & 1 deletion Include/Common/NMR_StringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ and Exception-safe
#include "Common/NMR_Types.h"
#include "Common/NMR_Local.h"

#include <fast_float/fast_float.h>
#include <fast_float.h>

#include <string>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion Include/Common/OPC/NMR_OpcPackageReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ NMR_OpcPackageReader.h defines an OPC Package reader in a portable way.
#include "Common/OPC/NMR_OpcPackageRelationship.h"
#include "Common/3MF_ProgressMonitor.h"
#include "Common/NMR_ModelWarnings.h"
#include "Libraries/libzip/zip.h"
#include "zip.h"
#include <list>
#include <vector>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion Include/Common/Platform/NMR_ExportStream_Compressed.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NMR_ExportStream_Compressed.h defines a stream to write compressed files
#include "Common/NMR_Types.h"
#include "Common/Platform/NMR_ExportStream.h"
#include "Common/Platform/NMR_PortableZIPWriter.h"
#include "Libraries/zlib/zlib.h"
#include <zlib.h>

#define EXPORTSTREAM_WRITE_BUFFER_CHUNKSIZE 1024

Expand Down
2 changes: 1 addition & 1 deletion Include/Common/Platform/NMR_ExportStream_ZIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ NMR_PortableZIPWriter.h defines a portable stream to write into ZIP files
#include "Common/NMR_Types.h"
#include "Common/Platform/NMR_ExportStream.h"
#include "Common/Platform/NMR_PortableZIPWriter.h"
#include "Libraries/zlib/zlib.h"
#include <zlib.h>

#include <array>

Expand Down
2 changes: 1 addition & 1 deletion Include/Common/Platform/NMR_ImportStream_Compressed.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This is a stream class for importing from a compressed object.
#define __NMR_IMPORTSTREAM_COMPRESSED

#include "Common/Platform/NMR_ImportStream.h"
#include "Libraries/zlib/zlib.h"
#include <zlib.h>

#define IMPORTSTREAM_READ_BUFFER_CHUNKSIZE 1024
#define IMPORTSTREAM_COMPRESSED_CHUNKSIZE 1024
Expand Down
2 changes: 1 addition & 1 deletion Include/Common/Platform/NMR_ImportStream_ZIP.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ This is a stream class for importing from a libZIP object.
#define __NMR_IMPORTSTREAM_ZIP

#include "Common/Platform/NMR_ImportStream.h"
#include "Libraries/libzip/zip.h"
#include "zip.h"

#define IMPORTSTREAM_ZIP_CHUNKSIZE (1024 * 1024)

Expand Down
15 changes: 0 additions & 15 deletions Include/Libraries/cpp-base64/base64.h

This file was deleted.

62 changes: 0 additions & 62 deletions Include/Libraries/libzip/config.h

This file was deleted.

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

This file was deleted.

Loading
Loading