Fix compilation on Travis
This commit is contained in:
parent
8b4c7ea23f
commit
ae112294c8
15
setup.py
15
setup.py
@ -337,6 +337,14 @@ def parallel_run(todo, desc='Compiling {} ...'):
|
||||
run_tool(failed[1])
|
||||
|
||||
|
||||
def safe_remove(items, *removals):
|
||||
for x in removals:
|
||||
try:
|
||||
items.remove(x)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
||||
def compile_c_extension(kenv, module, incremental, compilation_database, all_keys, sources, headers):
|
||||
prefix = os.path.basename(module)
|
||||
objects = [
|
||||
@ -370,7 +378,12 @@ def compile_c_extension(kenv, module, incremental, compilation_database, all_key
|
||||
parallel_run(todo)
|
||||
dest = os.path.join(base, module + '.so')
|
||||
if not incremental or newer(dest, *objects):
|
||||
run_tool([kenv.cc] + kenv.cflags + kenv.ldflags + objects + kenv.ldpaths + ['-o', dest], desc='Linking {} ...'.format(emphasis(module)))
|
||||
linker_cflags = list(kenv.cflags)
|
||||
# Old versions of clang dont like -pthread being passed to the linker
|
||||
# Dont treat linker warnings as errors (linker generates spurious
|
||||
# warnings on some old systems)
|
||||
safe_remove(linker_cflags, '-pthread', '-Werror', '-pedantic-errors')
|
||||
run_tool([kenv.cc] + linker_cflags + kenv.ldflags + objects + kenv.ldpaths + ['-o', dest], desc='Linking {} ...'.format(emphasis(module)))
|
||||
|
||||
|
||||
def find_c_files():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user