Skip to content

feat(windows): add native Windows pdfium.dll build support - #6

Merged
danglong78 merged 1 commit into
luminpdf/masterfrom
feat/windows-native-build
Jun 23, 2026
Merged

danglong78 merged 1 commit into
luminpdf/masterfrom
feat/windows-native-build

Conversation

@danglong78

Copy link
Copy Markdown
Collaborator

Add a Windows target to the build pipeline producing a native x64 pdfium.dll that exports the fork's LMP_* functions (consumable via pdfium-render's bind_to_library by name).

  • modules/windows.py: build/patch/build/install/archive tasks (no lipo; collects pdfium.dll + import lib + headers)
  • modules/config.py: targets_windows (x64 only), shared_lib_windows=True
  • modules/common.py: win GN args branch + extra_cflags=/DFPDF_IMPLEMENTATION so dllexport is active after the public-headers patch
  • modules/pdfium.py: strip stray submodule .git from the build copy before git init; invoke depot_tools .bat tools (gclient/gn/ninja) via shell=True (Windows CreateProcess resolves .exe only, not .bat)
  • make.py: wire build-pdfium-windows/patch-windows/build-windows/ install-windows/archive-windows
  • docs/BUILD_WINDOWS.md: build guide incl. long-path, VS toolchain env vars, and Debugging-Tools (dbghelp.dll) prerequisites

Verified on Win11 + VS Build Tools 2022: produces pdfium.dll with 545 exports including 39 LMP_* functions.

Add a Windows target to the build pipeline producing a native x64
pdfium.dll that exports the fork's LMP_* functions (consumable via
pdfium-render's bind_to_library by name).

Adapted to the clone-based get_pdfium_by_target (the build now CLONES
git@github.com:luminpdf/pdfium.git @ luminpdf/main via gclient instead of
copying a local pdfium fork). Build dir is build/win.

- modules/windows.py: build/patch/build/install/archive tasks under
  build/win (no lipo; collects pdfium.dll + import lib + headers);
  build_pdfium calls get_pdfium_by_target("win", git_url, git_branch)
- modules/config.py: pdfium_win_git_url/pdfium_win_git_branch fork coords,
  targets_windows (x64 only, target_os "win"), shared_lib_windows=True
- modules/common.py: win GN args branch + extra_cflags=/DFPDF_IMPLEMENTATION
  so dllexport is active after the public-headers patch
- modules/pdfium.py: invoke depot_tools .bat tools (gclient) via shell=True
  with space-joined strings (Windows CreateProcess resolves .exe only, not
  .bat; cross-platform safe under POSIX /bin/sh)
- make.py: wire build-pdfium-windows/patch-windows/build-windows/
  install-windows/archive-windows
- docs/BUILD_WINDOWS.md: clone-based build guide incl. SSH-to-fork, long-path,
  VS toolchain env vars, and Debugging-Tools (dbghelp.dll) prerequisites

Verified on Win11 + VS Build Tools 2022: produces pdfium.dll with 545
exports including 39 LMP_* functions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@danglong78
danglong78 force-pushed the feat/windows-native-build branch from 66ecf1a to 9518b4e Compare June 22, 2026 18:33
@danglong78
danglong78 merged commit ab76642 into luminpdf/master Jun 23, 2026
5 of 8 checks passed
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