Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect environment CFLAGS #252

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
# by default python uses all the args which were used to compile it. But Python is C and some
# extension files are C++, resulting in annoying '-Wstrict-prototypes is not supported' messages.
# tweak the cflags to override
os.environ["CFLAGS"] = sysconfig.get_config_var(
"CFLAGS").replace("-Wstrict-prototypes", "")
os.environ["OPT"] = sysconfig.get_config_var(
"OPT").replace("-Wstrict-prototypes", "")
os.environ["CFLAGS"] = os.environ.get("CFLAGS", "").replace("-Wstrict-prototypes", "")

# Extensions need to link against appropriate libs
# We use pkg-config to find the appropriate set of includes and libs
Expand Down Expand Up @@ -132,7 +129,7 @@ def run(self):
# ('DEBUG_PIXEL',1), # debug spew for array handling
# ('EXPERIMENTAL_OPTIMIZATIONS',1), # enables some experimental optimizations
]
else:
elif not os.environ["CFLAGS"]:
extra_compile_args += ["-DNDEBUG", "-O3"]

module_fract4dc = Extension(
Expand Down