Commit 2eab8206 authored by Jeroen Demeyer's avatar Jeroen Demeyer

When merging a transitive_list, copy the list

parent 3719264b
......@@ -216,12 +216,13 @@ class DistutilsInfo(object):
self.values[key] = value
elif type is transitive_list:
if key in self.values:
all = self.values[key]
# Change a *copy* of the list (Trac #845)
all = self.values[key][:]
for v in value:
if v not in all:
all.append(v)
else:
self.values[key] = value
value = all
self.values[key] = value
return self
def subs(self, aliases):
......@@ -250,9 +251,8 @@ class DistutilsInfo(object):
for key, value in self.values.items():
type = distutils_settings[key]
if type in [list, transitive_list]:
getattr(extension, key).extend(value)
else:
setattr(extension, key, value)
value = getattr(extension, key) + list(value)
setattr(extension, key, value)
@cython.locals(start=long, q=long, single_q=long, double_q=long, hash_mark=long,
end=long, k=long, counter=long, quote_len=long)
......
PYTHON setup.py build_ext --inplace
######## setup.py ########
from Cython.Build import cythonize
from Cython.Distutils.extension import Extension
ext_modules = [
Extension("a", ["a.pyx"]),
Extension("x", ["x.pyx"]),
Extension("y", ["y.pyx"]),
]
ext_modules = cythonize(ext_modules)
assert ext_modules[1].libraries == ["lib_x"]
assert ext_modules[2].libraries == ["lib_y"]
######## libx.pxd ########
# distutils: libraries = lib_x
######## liby.pxd ########
# distutils: libraries = lib_y
######## a.pyx ########
cimport libx
cimport liby
######## x.pyx ########
cimport libx
######## y.pyx ########
cimport liby
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