mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
Build: enable strict Cython warnings and clean up compiler flags
This commit is contained in:
parent
4496904f48
commit
7fe2d56a9f
1 changed files with 6 additions and 2 deletions
8
setup.py
8
setup.py
|
|
@ -46,7 +46,10 @@ cpu_threads = multiprocessing.cpu_count() if multiprocessing and multiprocessing
|
|||
on_rtd = os.environ.get("READTHEDOCS")
|
||||
|
||||
# Extra cflags for all extensions, usually just warnings we want to enable explicitly
|
||||
cflags = ["-Wall", "-Wextra", "-Wpointer-arith", "-Wno-unreachable-code-fallthrough"]
|
||||
cflags = ["-Wall", "-Wextra", "-Wpointer-arith"]
|
||||
|
||||
if not is_win32:
|
||||
cflags.extend(["-Wstrict-prototypes"])
|
||||
|
||||
compress_source = "src/borg/compress.pyx"
|
||||
crypto_ll_source = "src/borg/crypto/low_level.pyx"
|
||||
|
|
@ -225,7 +228,8 @@ if not on_rtd:
|
|||
if cythonize and cythonizing:
|
||||
# 3str is the default in Cython3 and we do not support older Cython releases.
|
||||
# we only set this to avoid the related FutureWarning from Cython3.
|
||||
cython_opts = dict(compiler_directives={"language_level": "3str"})
|
||||
cython_opts = dict(compiler_directives={"language_level": "3str", "warn.unreachable": True})
|
||||
|
||||
if not is_win32:
|
||||
# Compile .pyx extensions to .c in parallel; does not work on Windows
|
||||
cython_opts["nthreads"] = cpu_threads
|
||||
|
|
|
|||
Loading…
Reference in a new issue