mirror of
https://gitee.com/fantix/kloop.git
synced 2025-02-17 04:15:16 +00:00
Unify debug setting
This commit is contained in:
parent
479d8be584
commit
bfc3fb451a
2 changed files with 11 additions and 14 deletions
24
setup.py
24
setup.py
|
@ -36,6 +36,14 @@ class build_ext_with_resolver(build_ext):
|
||||||
self.force = os.getenv("KLOOP_FORCE", "0") == "1"
|
self.force = os.getenv("KLOOP_FORCE", "0") == "1"
|
||||||
|
|
||||||
for ext in self.distribution.ext_modules:
|
for ext in self.distribution.ext_modules:
|
||||||
|
if ext.cython_directives:
|
||||||
|
ext.cython_directives["language_level"] = "3"
|
||||||
|
else:
|
||||||
|
ext.cython_directives = {"language_level": "3"}
|
||||||
|
if ext.cython_compile_time_env:
|
||||||
|
ext.cython_compile_time_env["DEBUG"] = self.debug
|
||||||
|
else:
|
||||||
|
ext.cython_compile_time_env = {"DEBUG": self.debug}
|
||||||
if self.debug:
|
if self.debug:
|
||||||
if "-O0" not in ext.extra_compile_args:
|
if "-O0" not in ext.extra_compile_args:
|
||||||
ext.extra_compile_args.append("-O0")
|
ext.extra_compile_args.append("-O0")
|
||||||
|
@ -49,10 +57,6 @@ class build_ext_with_resolver(build_ext):
|
||||||
if resolver not in ext.depends:
|
if resolver not in ext.depends:
|
||||||
ext.depends.append(resolver)
|
ext.depends.append(resolver)
|
||||||
|
|
||||||
self.distribution.ext_modules = cythonize(
|
|
||||||
self.distribution.ext_modules, language_level="3",
|
|
||||||
)
|
|
||||||
|
|
||||||
super().finalize_options()
|
super().finalize_options()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -118,22 +122,16 @@ setup(
|
||||||
],
|
],
|
||||||
include_dirs=[
|
include_dirs=[
|
||||||
d.strip().removeprefix("-I")
|
d.strip().removeprefix("-I")
|
||||||
for d in sysconfig.get_config_var(
|
for d in sysconfig.get_config_var("OPENSSL_INCLUDES").split()
|
||||||
"OPENSSL_INCLUDES"
|
|
||||||
).split()
|
|
||||||
],
|
],
|
||||||
library_dirs=[
|
library_dirs=[
|
||||||
d.strip().removeprefix("-L")
|
d.strip().removeprefix("-L")
|
||||||
for d in sysconfig.get_config_var(
|
for d in sysconfig.get_config_var("OPENSSL_LDFLAGS").split()
|
||||||
"OPENSSL_LDFLAGS"
|
|
||||||
).split()
|
|
||||||
if d.strip().startswith("-L")
|
if d.strip().startswith("-L")
|
||||||
],
|
],
|
||||||
extra_link_args=[
|
extra_link_args=[
|
||||||
d.strip()
|
d.strip()
|
||||||
for d in sysconfig.get_config_var(
|
for d in sysconfig.get_config_var("OPENSSL_LDFLAGS").split()
|
||||||
"OPENSSL_LDFLAGS"
|
|
||||||
).split()
|
|
||||||
if not d.strip().startswith("-L")
|
if not d.strip().startswith("-L")
|
||||||
],
|
],
|
||||||
runtime_library_dirs=(lambda x: [x] if x else [])(
|
runtime_library_dirs=(lambda x: [x] if x else [])(
|
||||||
|
|
|
@ -45,7 +45,6 @@ cdef unsigned char FLAGS_PROXY_RECV_ALL = (
|
||||||
)
|
)
|
||||||
|
|
||||||
cdef size_t CMSG_SIZE = libc.CMSG_SPACE(sizeof(unsigned char))
|
cdef size_t CMSG_SIZE = libc.CMSG_SPACE(sizeof(unsigned char))
|
||||||
DEF DEBUG = 0
|
|
||||||
|
|
||||||
|
|
||||||
cdef inline void reset_msg(libc.msghdr* msg, void* cmsg) nogil:
|
cdef inline void reset_msg(libc.msghdr* msg, void* cmsg) nogil:
|
||||||
|
|
Loading…
Reference in a new issue