@@ -465,7 +465,7 @@ def get_mupdf():
465465library_dirs = []
466466libraries = []
467467extra_link_args = []
468-
468+ extra_compile_args = []
469469
470470if 'sdist' in sys .argv :
471471 # Create local mupdf.tgz, for inclusion in sdist.
@@ -641,6 +641,13 @@ def get_mupdf():
641641 "libthirdparty" ,
642642 ]
643643 extra_link_args = ["/NODEFAULTLIB:MSVCRT" ]
644+
645+ if linux or openbsd or freebsd or darwin :
646+ extra_compile_args .append ( '-Wno-incompatible-pointer-types' )
647+ extra_compile_args .append ( '-Wno-pointer-sign' )
648+ extra_compile_args .append ( '-Wno-sign-compare' )
649+ if openbsd :
650+ extra_compile_args .append ( '-Wno-deprecated-declarations' )
644651
645652 # add any local include and library folders
646653 pymupdf_dirs = os .environ .get ("PYMUPDF_DIRS" , None )
@@ -657,6 +664,11 @@ def get_mupdf():
657664 log ( f'include_dirs={ include_dirs } ' )
658665 log ( f'extra_link_args={ extra_link_args } ' )
659666
667+ log ( f'include_dirs={ include_dirs } ' )
668+ log ( f'library_dirs={ library_dirs } ' )
669+ log ( f'libraries={ libraries } ' )
670+ log ( f'extra_compile_args={ extra_compile_args } ' )
671+ log ( f'extra_link_args={ extra_link_args } ' )
660672
661673module = Extension (
662674 "fitz._fitz" ,
@@ -665,6 +677,7 @@ def get_mupdf():
665677 include_dirs = include_dirs ,
666678 library_dirs = library_dirs ,
667679 libraries = libraries ,
680+ extra_compile_args = extra_compile_args ,
668681 extra_link_args = extra_link_args ,
669682)
670683
0 commit comments