Skip to content

Commit a5018f7

Browse files
setup.py: disable some cc warnings that we can't avoid (because in swig-generated code).
1 parent 0865033 commit a5018f7

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

setup.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def get_mupdf():
465465
library_dirs = []
466466
libraries = []
467467
extra_link_args = []
468-
468+
extra_compile_args = []
469469

470470
if '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

661673
module = 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

Comments
 (0)