提交 ec3cef2e authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Optionally pass the c compiler to headers() and libraries() of ops.

上级 e5b19522
......@@ -930,15 +930,19 @@ class CLinker(link.Linker):
"-Wno-unused-variable", # idem as the precedent
"-Wno-write-strings", # generated by our code generator...
]
c_compiler = self.c_compiler()
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
ret += x.c_compile_args()
try:
ret += x.c_compile_args(c_compiler)
except TypeError:
ret += x.c_compile_args()
except utils.MethodNotDefined:
pass
c_compiler = self.c_compiler()
ret = utils.uniq(ret) # to remove duplicate
# The args set by the compiler include the user flags. We do not want
# to reorder them
......@@ -946,7 +950,11 @@ class CLinker(link.Linker):
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
for i in x.c_no_compile_args():
try:
no_comp = x.c_no_compile_args(c_compiler)
except TypeError:
no_comp = x.c_no_compile_args()
for i in no_comp:
try:
ret.remove(i)
except ValueError:
......@@ -966,10 +974,14 @@ class CLinker(link.Linker):
"""
ret = []
c_compiler = self.c_compiler()
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
ret += x.c_headers()
try:
ret += x.c_headers(c_compiler)
except TypeError:
ret += x.c_headers()
except utils.MethodNotDefined:
pass
return utils.uniq(ret)
......@@ -1023,10 +1035,14 @@ class CLinker(link.Linker):
"""
ret = []
c_compiler = self.c_compiler()
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
ret += x.c_header_dirs()
try:
ret += x.c_header_dirs(c_compiler)
except TypeError:
ret += x.c_header_dirs()
except utils.MethodNotDefined:
pass
return utils.uniq(ret)
......@@ -1042,10 +1058,14 @@ class CLinker(link.Linker):
"""
ret = []
c_compiler = self.c_compiler()
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
ret += x.c_libraries()
try:
ret += x.c_libraries(c_compiler)
except TypeError:
ret += x.c_libraries()
except utils.MethodNotDefined:
pass
return utils.uniq(ret)
......@@ -1061,10 +1081,14 @@ class CLinker(link.Linker):
"""
ret = []
c_compiler = self.c_compiler()
for x in [y.type for y in self.variables] + [
y.op for y in self.node_order]:
try:
ret += x.c_lib_dirs()
try:
ret += x.c_lib_dirs(c_compiler)
except TypeError:
ret += x.c_lib_dirs()
except utils.MethodNotDefined:
pass
return utils.uniq(ret)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论