Skip to content

Commit

Permalink
Merge e5c641f into a58ded0
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAFile committed Apr 25, 2019
2 parents a58ded0 + e5c641f commit ff738a3
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,32 @@

# Compile the server with support for
# AddressSanitizer/UndefinedBehaviourSanitizer
# TODO: clean up compile options code and actually make this compile with asan
USE_ASAN = os.environ.get('USE_ASAN') == '1'
USE_UBSAN = os.environ.get('USE_UBSAN') == '1'

ext_modules = []

for name in ext_names:
extra = {
"define_macros": [],
"extra_link_args": [],
"extra_compile_args": [],
} # type: dict

if static:
extra = {'extra_link_args': ['-static-libstdc++', '-static-libgcc']}
else:
extra = {}
extra['extra_link_args'].extend(
['-static-libstdc++', '-static-libgcc'])

if name in ['pyspades.vxl', 'pyspades.world', 'pyspades.mapmaker']:
extra["extra_compile_args"] = ['-std=c++11']
if USE_ASAN:
extra["extra_link_args"].append("-lasan")
extra["extra_compile_args"].append("-fsanitize=address")

extra['define_macros'] = []
if USE_UBSAN:
extra["extra_link_args"].append("-lubsan")
extra["extra_compile_args"].append("-fsanitize=undefined")

if name in ['pyspades.vxl', 'pyspades.world', 'pyspades.mapmaker']:
extra["extra_compile_args"].append('-std=c++11')

if linetrace:
extra['define_macros'].append(('CYTHON_TRACE', '1'))
Expand Down

0 comments on commit ff738a3

Please sign in to comment.