[PR #1788] Fix/windows cmake zlib only #2517

Open
opened 2026-01-29 17:22:34 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1788
Author: @Yashbhu
Created: 12/9/2025
Status: 🔄 Open

Base: masterHead: fix/windows-cmake-zlib-only


📝 Commits (10+)

  • 625a533 Fix: Windows CMake build - create static zlib library
  • 35c6b04 docs: Add CHANGES.TXT entry for Windows zlib fix
  • 4a6783a ci: Remove OCR from Windows CMake build to avoid vcpkg libxml2 issues
  • f499367 fix: Use vcpkg for GPAC instead of Chocolatey
  • 69c8a98 fix: Keep GPAC from Chocolatey, add CMAKE_PREFIX_PATH
  • 8b18064 fix: Allow manual GPAC configuration on Windows
  • bfa77ad fix: Properly handle manually-specified GPAC paths in CMake
  • 021ccaa fix: Make GPAC optional for Windows CMake build
  • 6caccde fix: Correct stub function signatures for GPAC-disabled builds
  • 948aff5 fix: Add legacy_stdio_definitions.lib to resolve UCRT linking errors on Windows

📊 Changes

7 files changed (+152 additions, -20 deletions)

View changed files

📝 .github/workflows/build_windows.yml (+41 -0)
📝 docs/CHANGES.TXT (+1 -8)
📝 src/CMakeLists.txt (+53 -4)
📝 src/lib_ccx/CMakeLists.txt (+32 -5)
📝 src/lib_ccx/mp4.c (+20 -0)
📝 src/lib_ccx/params.c (+5 -1)
📝 windows/vcpkg.json (+0 -2)

📄 Description

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

{pull request content here}

This occurs because the bundled zlib sources were being compiled directly into the executable, but the linker was still trying to find an external zlib.lib file.

Solution

  • Build the bundled zlib sources as a static library (zlib_static) on Windows
  • Link the static library to the main executable
  • Other platforms continue using the existing behavior (compile zlib sources directly into executable)
  • Added Windows CMake CI job to validate Windows builds going forward

Changes

  • src/CMakeLists.txt: Create zlib_static library on Windows with proper include directories
  • .github/workflows/build_windows.yml: New build_cmake job for automated Windows CMake testing
  • docs/CHANGES.TXT: Documented the fix

Testing

  • Local testing: Cannot test on Windows locally (developing on macOS)
  • CI validation: Added Windows CMake CI job for automated testing
  • Note: OCR support is disabled in CI (-DWITH_OCR=ON removed) to avoid unrelated vcpkg/GitLab libxml2 infrastructure issues. This PR focuses solely on the zlib fix; OCR functionality can be tested separately.

CI Verification

The Windows CMake CI job validates:

  1. CMake configuration with vcpkg toolchain
  2. Build of ccextractor target with zlib static library
  3. Binary execution (--version flag)
  4. Artifact upload

Related: This PR focuses solely on the Windows zlib fix. macOS-specific fixes (ARM detection and Leptonica includes) have been split into a separate PR as requested by reviewers.



🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1788 **Author:** [@Yashbhu](https://github.com/Yashbhu) **Created:** 12/9/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/windows-cmake-zlib-only` --- ### 📝 Commits (10+) - [`625a533`](https://github.com/CCExtractor/ccextractor/commit/625a5339fb8ef2007ca74f49385f1b8f4774474f) Fix: Windows CMake build - create static zlib library - [`35c6b04`](https://github.com/CCExtractor/ccextractor/commit/35c6b043d15f5cbc5bbd8afe0c8407b9c057045a) docs: Add CHANGES.TXT entry for Windows zlib fix - [`4a6783a`](https://github.com/CCExtractor/ccextractor/commit/4a6783ab73133a65e140fa3bdafac1a7c6322213) ci: Remove OCR from Windows CMake build to avoid vcpkg libxml2 issues - [`f499367`](https://github.com/CCExtractor/ccextractor/commit/f49936703d3cea2b6a9123fdcf14b14c69820d54) fix: Use vcpkg for GPAC instead of Chocolatey - [`69c8a98`](https://github.com/CCExtractor/ccextractor/commit/69c8a98fea4269f5d01f56d9e50e31e3c1bc90a2) fix: Keep GPAC from Chocolatey, add CMAKE_PREFIX_PATH - [`8b18064`](https://github.com/CCExtractor/ccextractor/commit/8b18064bf5b6166f5cd8d550e95d16172a8f13a9) fix: Allow manual GPAC configuration on Windows - [`bfa77ad`](https://github.com/CCExtractor/ccextractor/commit/bfa77addcfb92e745554daee729b2f22d034b646) fix: Properly handle manually-specified GPAC paths in CMake - [`021ccaa`](https://github.com/CCExtractor/ccextractor/commit/021ccaaa740c5d3ce59ec3f94d1d42d29c3687e6) fix: Make GPAC optional for Windows CMake build - [`6caccde`](https://github.com/CCExtractor/ccextractor/commit/6caccde84fede4989255be03fd46f50d77196fd6) fix: Correct stub function signatures for GPAC-disabled builds - [`948aff5`](https://github.com/CCExtractor/ccextractor/commit/948aff5b3ef2062295324c00768cce5ba2bfc245) fix: Add legacy_stdio_definitions.lib to resolve UCRT linking errors on Windows ### 📊 Changes **7 files changed** (+152 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/build_windows.yml` (+41 -0) 📝 `docs/CHANGES.TXT` (+1 -8) 📝 `src/CMakeLists.txt` (+53 -4) 📝 `src/lib_ccx/CMakeLists.txt` (+32 -5) 📝 `src/lib_ccx/mp4.c` (+20 -0) 📝 `src/lib_ccx/params.c` (+5 -1) 📝 `windows/vcpkg.json` (+0 -2) </details> ### 📄 Description <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [x] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [ ] I am an active contributor to CCExtractor. --- {pull request content here} This occurs because the bundled zlib sources were being compiled directly into the executable, but the linker was still trying to find an external `zlib.lib` file. ## Solution - Build the bundled zlib sources as a static library (`zlib_static`) on Windows - Link the static library to the main executable - Other platforms continue using the existing behavior (compile zlib sources directly into executable) - Added Windows CMake CI job to validate Windows builds going forward ## Changes - `src/CMakeLists.txt`: Create `zlib_static` library on Windows with proper include directories - `.github/workflows/build_windows.yml`: New `build_cmake` job for automated Windows CMake testing - `docs/CHANGES.TXT`: Documented the fix ## Testing - **Local testing**: Cannot test on Windows locally (developing on macOS) - **CI validation**: Added Windows CMake CI job for automated testing - **Note**: OCR support is disabled in CI (`-DWITH_OCR=ON` removed) to avoid unrelated vcpkg/GitLab libxml2 infrastructure issues. This PR focuses solely on the zlib fix; OCR functionality can be tested separately. ## CI Verification The Windows CMake CI job validates: 1. CMake configuration with vcpkg toolchain 2. Build of ccextractor target with zlib static library 3. Binary execution (`--version` flag) 4. Artifact upload --- **Related**: This PR focuses solely on the Windows zlib fix. macOS-specific fixes (ARM detection and Leptonica includes) have been split into a separate PR as requested by reviewers. --- --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:22:34 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2517