Module setup_native

Module setup_native 

Source
Expand description

cargo xtask setup-native — build MuPDF and the C wrapper for native dev.

  1. Downloads MuPDF sources if the required version is not already present.
  2. Builds the mupdf_wrapper C library.
  3. Compiles MuPDF using system libraries.
  4. Creates symlinks in target/mupdf_wrapper/<platform>/ so the Rust build script can find the static libraries.

§Required MuPDF version

The version is pinned to REQUIRED_MUPDF_VERSION. If the sources already present on disk match this version the download is skipped.

Structs§

SetupNativeArgs
Arguments for cargo xtask setup-native.

Constants§

NATIVE_BUILT_MARKER 🔒
Marker file written after a successful native MuPDF build.
REQUIRED_MUPDF_VERSION
The MuPDF source version that must be present for a successful build.

Functions§

build_mupdf_native 🔒
Compiles MuPDF using system libraries for the native platform.
build_mupdf_wrapper_native_if_needed 🔒
Builds the mupdf_wrapper C static library for the native platform.
collect_system_cflags 🔒
Collects system library CFLAGS via pkg-config on macOS.
ensure_mupdf_sources
Ensures MuPDF sources at the required version are present in thirdparty/mupdf/.
link_mupdf_artifacts 🔒
Creates symlinks in target/mupdf_wrapper/<platform>/ pointing to the compiled MuPDF static libraries.
native_mupdf_ready 🔒
Returns true when native MuPDF libraries are present and marked as built.
read_mupdf_version 🔒
Reads the MuPDF version string from the version header file.
run
Builds MuPDF and the C wrapper for native (non-cross-compiled) development.
symlink_force 🔒
Creates a symlink at link pointing to target, removing any existing file or symlink at link first.
write_native_build_marker 🔒
Writes the native build marker in the MuPDF source directory.