1
0
Fork 0
mirror of https://gitee.com/fantix/kloop.git synced 2024-04-25 01:38:45 +00:00

Unify debug setting

This commit is contained in:
Fantix King 2022-07-02 18:08:25 -04:00
parent 479d8be584
commit bfc3fb451a
No known key found for this signature in database
GPG key ID: 95304B04071CCDB4
2 changed files with 11 additions and 14 deletions

View file

@ -36,6 +36,14 @@ class build_ext_with_resolver(build_ext):
self.force = os.getenv("KLOOP_FORCE", "0") == "1"
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 "-O0" not in ext.extra_compile_args:
ext.extra_compile_args.append("-O0")
@ -49,10 +57,6 @@ class build_ext_with_resolver(build_ext):
if resolver not in ext.depends:
ext.depends.append(resolver)
self.distribution.ext_modules = cythonize(
self.distribution.ext_modules, language_level="3",
)
super().finalize_options()
def run(self):
@ -118,22 +122,16 @@ setup(
],
include_dirs=[
d.strip().removeprefix("-I")
for d in sysconfig.get_config_var(
"OPENSSL_INCLUDES"
).split()
for d in sysconfig.get_config_var("OPENSSL_INCLUDES").split()
],
library_dirs=[
d.strip().removeprefix("-L")
for d in sysconfig.get_config_var(
"OPENSSL_LDFLAGS"
).split()
for d in sysconfig.get_config_var("OPENSSL_LDFLAGS").split()
if d.strip().startswith("-L")
],
extra_link_args=[
d.strip()
for d in sysconfig.get_config_var(
"OPENSSL_LDFLAGS"
).split()
for d in sysconfig.get_config_var("OPENSSL_LDFLAGS").split()
if not d.strip().startswith("-L")
],
runtime_library_dirs=(lambda x: [x] if x else [])(

View file

@ -45,7 +45,6 @@ cdef unsigned char FLAGS_PROXY_RECV_ALL = (
)
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: