Skip to content

Updates to project#1

Open
winterheart wants to merge 12 commits into
celyrin:masterfrom
winterheart:cmake-fixes
Open

Updates to project#1
winterheart wants to merge 12 commits into
celyrin:masterfrom
winterheart:cmake-fixes

Conversation

@winterheart

@winterheart winterheart commented Jul 22, 2026

Copy link
Copy Markdown

Hello.
Here some changes to enhance project.

  • Fix compilation with recent GCC-16, CLang and MSVC.
  • Update CMake project with Cmake's best practices.
  • Add installation steps and export project for easy use as external dependency.
  • GitHub Action CI pipeline.
  • Some fixes to test applications.

Set cmake_minimum_required to 3.24 as current CMake-4 not supporting <3.5. Use new features that provides 3.24: CMAKE_COMPILE_WARNING_AS_ERROR, CMAKE_POSITION_INDEPENDENT_CODE, and others. Enforce C++14 standard.

Add various configuration options for convenience:
* LIB7ZIP_ENABLE_TESTING - enables building testing programs
* LIB7ZIP_WARNING_AS_ERROR - enforce CMAKE_COMPILE_WARNING_AS_ERROR

Formatting code and cleanup.
CPP/7zip/Common/FileStreams.h requires additional code from 7zip. Otherwise, compilation will fail with "undefined reference to `vtable for COutFileStream'" and
"undefined reference to `NC::NFile::NIO::CFileBase::Close()'" errors.
Fix -Winconsistent-missing-override compilation failure.
Copying (U)Int64 types definitions from 7zip header.
This allows to use and install lib7zip independently of 7zip sources.
Build only one type of library (STATIC/SHARED) at same time. In order to get both types users should use CMake Presets or MultiConfig generators.
Add CI pipeline for build testing.
Use "%hs" for wprintf() on wstring.
Use "%lld" for wprintf() on UInt64 types.
Convert input TCHAR* parameter into std::string.
lib7zip not ready yet for Windows DLL linking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant