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

update zlib to v1.3.0 #332

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 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 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 Expand Up @@ -235,4 +236,4 @@ jobs:
sh Examples/Cpp/GenerateMake.sh
cd Examples/Cpp/build
cmake --build .
./Example_ExtractInfo ../../Files/Helix.3mf
./Example_ExtractInfo ../../Files/Helix.3mf
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[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
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ 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)
Expand All @@ -136,17 +145,13 @@ 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)


set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" IMPORT_PREFIX "" )
# This makes sure symbols are exported
target_compile_options(${PROJECT_NAME} PRIVATE "-D__LIB3MF_EXPORTS")
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/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
Loading
Loading