Commit d918a5a7 authored by Stefan Behnel's avatar Stefan Behnel

simplify inplace build setup in pyxbuild.py

parent 24294c5c
...@@ -47,6 +47,8 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0, ...@@ -47,6 +47,8 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
args = [quiet, "build_ext"] args = [quiet, "build_ext"]
if force_rebuild: if force_rebuild:
args.append("--force") args.append("--force")
if inplace:
args.append("--inplace")
if HAS_CYTHON and build_in_temp: if HAS_CYTHON and build_in_temp:
args.append("--pyrex-c-in-temp") args.append("--pyrex-c-in-temp")
sargs = setup_args.copy() sargs = setup_args.copy()
...@@ -84,15 +86,8 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0, ...@@ -84,15 +86,8 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
try: try:
obj_build_ext = dist.get_command_obj("build_ext") obj_build_ext = dist.get_command_obj("build_ext")
orig_inplace = obj_build_ext.inplace
if inplace:
obj_build_ext.inplace = True
try:
dist.run_commands() dist.run_commands()
finally: if obj_build_ext.inplace:
obj_build_ext.inplace = orig_inplace
so_path = obj_build_ext.get_outputs()[0]
if orig_inplace or inplace:
# Python distutils get_outputs()[ returns a wrong so_path # Python distutils get_outputs()[ returns a wrong so_path
# when --inplace ; see http://bugs.python.org/issue5977 # when --inplace ; see http://bugs.python.org/issue5977
# workaround: # workaround:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment