Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling for multi-word C compilation commands like zig cc #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,12 @@ def add_internal_flags():
def validate_tools():
"""Check the compiler and linker are available."""
# Validate C compiler
if not shutil.which(gp['cc']):
if not shutil.which(gp['cc'].split()[0]):
log.error('ERROR: Compiler {cc} not found on path: exiting'.format(cc=gp["cc"]))
sys.exit(1)

# Validate linker
if not shutil.which(gp['ld']):
if not shutil.which(gp['ld'].split()[0]):
log.error('ERROR: Linker {ld} not found on path: exiting'.format(ld=gp["ld"]))
sys.exit(1)

Expand Down Expand Up @@ -446,7 +446,7 @@ def compile_file(f_root, srcdir, bindir, suffix='.c'):
abs_bin = os.path.join(bindir, '{root}.o'.format(root=f_root))

# Construct the argument list
arglist = [gp["cc"]]
arglist = gp["cc"].split()
arglist.extend(gp['cflags'])
arglist.extend(gp['cc_output_pattern'].format('{root}.o'.format(root=f_root)).split())
arglist.extend(gp['cc_input_pattern'].format(abs_src).split())
Expand Down Expand Up @@ -634,7 +634,7 @@ def create_link_binlist(abs_bd):
def create_link_arglist(bench, binlist):
"""Create the argument list for linking benchmark, "bench", from the binaries
in "binlist"."""
arglist = [gp['ld']]
arglist = gp['ld'].split()
arglist.extend(gp['ldflags'])
arglist.extend(gp['ld_output_pattern'].format(bench).split())
arglist.extend(binlist)
Expand Down