Skip to content

Commit

Permalink
setup.py: include libmupdf-threads in mupdf-devel/lib/.
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Nov 5, 2024
1 parent d6a652b commit 5dcc4e2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ def build():
# Download MuPDF.
#
mupdf_local, mupdf_location = get_mupdf()
mupdf_version_tuple = get_mupdf_version(mupdf_local)

build_type = os.environ.get( 'PYMUPDF_SETUP_MUPDF_BUILD_TYPE', 'release')
assert build_type in ('debug', 'memento', 'release'), \
Expand Down Expand Up @@ -644,10 +645,17 @@ def add(flavour, from_, to_):
# Add Windows .lib files.
mupdf_build_dir2 = _windows_lib_directory(mupdf_local, build_type)
add('d', f'{mupdf_build_dir2}/mupdfcpp{wp.cpu.windows_suffix}.lib', f'{to_dir_d}/lib/')
if mupdf_version_tuple >= (1, 25):
# MuPDF-1.25+ language bindings build also builds libmuthreads.
add('d', f'{mupdf_build_dir2}/libmuthreads.lib', f'{to_dir_d}/lib/')
elif darwin:
add('p', f'{mupdf_build_dir}/_mupdf.so', to_dir)
add('b', f'{mupdf_build_dir}/libmupdfcpp.so', to_dir)
add('b', f'{mupdf_build_dir}/libmupdf.dylib', f'{to_dir}libmupdf.dylib')
add('b', f'{mupdf_build_dir}/libmupdf.dylib', to_dir)
if mupdf_version_tuple >= (1, 25):
# MuPDF-1.25+ language bindings build also builds
# libmupdf-threads.a.
add('d', f'{mupdf_build_dir}/libmupdf-threads.a', f'{to_dir_d}/lib/')
elif pyodide:
add('p', f'{mupdf_build_dir}/_mupdf.so', to_dir)
add('b', f'{mupdf_build_dir}/libmupdfcpp.so', 'PyMuPDF.libs/')
Expand All @@ -656,6 +664,10 @@ def add(flavour, from_, to_):
add('p', f'{mupdf_build_dir}/_mupdf.so', to_dir)
add('b', pipcl.get_soname(f'{mupdf_build_dir}/libmupdfcpp.so'), to_dir)
add('b', pipcl.get_soname(f'{mupdf_build_dir}/libmupdf.so'), to_dir)
if mupdf_version_tuple >= (1, 25):
# MuPDF-1.25+ language bindings build also builds
# libmupdf-threads.a.
add('d', f'{mupdf_build_dir}/libmupdf-threads.a', f'{to_dir_d}/lib/')

if 'd' in PYMUPDF_SETUP_FLAVOUR:
# Add MuPDF C and C++ headers to `ret_d`. Would prefer to use
Expand Down

0 comments on commit 5dcc4e2

Please sign in to comment.