Skip to content

Commit

Permalink
Made include args always return arrays for consistency.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Sep 5, 2014
1 parent 3ed22fc commit d79b8a1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def determine_ext_objs(self, extobj, proj_dir_to_build_root=''):
def get_pch_include_args(self, compiler, target):
args = []
pchpath = self.get_target_private_dir(target)
includearg = compiler.get_include_arg(pchpath)
includeargs = compiler.get_include_args(pchpath)
for lang in ['c', 'cpp']:
p = target.get_pch(lang)
if len(p) == 0:
Expand All @@ -250,7 +250,7 @@ def get_pch_include_args(self, compiler, target):
header = p[0]
args += compiler.get_pch_use_args(pchpath, header)
if len(args) > 0:
args = [includearg] + args
args = includeargs + args
return args

def generate_basic_compiler_args(self, target, compiler):
Expand Down
20 changes: 10 additions & 10 deletions environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def get_werror_args(self):
def get_std_exe_link_args(self):
return []

def get_include_arg(self, path):
return '-I' + path
def get_include_args(self, path):
return ['-I' + path]

def get_std_shared_lib_link_args(self):
return ['-shared']
Expand Down Expand Up @@ -552,8 +552,8 @@ def get_coverage_link_args(self):
def get_std_exe_link_args(self):
return []

def get_include_arg(self, path):
return ''
def get_include_args(self, path):
return []

def get_std_shared_lib_link_args(self):
return []
Expand Down Expand Up @@ -694,8 +694,8 @@ def get_coverage_link_args(self):
def get_std_exe_link_args(self):
return []

def get_include_arg(self, path):
return ''
def get_include_args(self, path):
return []

def get_std_shared_lib_link_args(self):
return []
Expand Down Expand Up @@ -1228,11 +1228,11 @@ def can_compile(self, src):
return True
return False

def get_include_arg(self, path):
return '-I' + path
def get_include_args(self, path):
return ['-I' + path]

def get_module_outdir_arg(self, path):
return '-J' + path
def get_module_outdir_args(self, path):
return ['-J' + path]

def get_depfile_suffix(self):
return 'd'
Expand Down
12 changes: 6 additions & 6 deletions ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ def generate_single_compile(self, target, outfile, src, is_generated=False, head
extra_orderdeps = []
compiler = self.get_compiler_for_source(src)
commands = self.generate_basic_compiler_args(target, compiler)
commands.append(compiler.get_include_arg(self.get_target_private_dir(target)))
commands += compiler.get_include_args(self.get_target_private_dir(target))
if isinstance(src, RawFilename):
rel_src = src.fname
elif is_generated:
Expand Down Expand Up @@ -1100,10 +1100,10 @@ def generate_single_compile(self, target, outfile, src, is_generated=False, head
for d in i.get_incdirs():
expdir = os.path.join(basedir, d)
fulldir = os.path.join(self.environment.get_source_dir(), expdir)
barg = compiler.get_include_arg(expdir)
sarg = compiler.get_include_arg(fulldir)
commands.append(barg)
commands.append(sarg)
bargs = compiler.get_include_args(expdir)
sargs = compiler.get_include_args(fulldir)
commands += bargs
commands += sargs
if self.environment.coredata.use_pch:
commands += self.get_pch_include_args(compiler, target)
crstr = ''
Expand All @@ -1121,7 +1121,7 @@ def generate_single_compile(self, target, outfile, src, is_generated=False, head
if srcfile == src:
depelem = NinjaBuildElement(modfile, 'FORTRAN_DEP_HACK', rel_obj)
depelem.write(outfile)
commands.append(compiler.get_module_outdir_arg(os.path.join(self.get_target_dir(target), target.get_basename() + '.dir')))
commands += compiler.get_module_outdir_args(os.path.join(self.get_target_dir(target), target.get_basename() + '.dir'))

element = NinjaBuildElement(rel_obj, compiler_name, rel_src)
for d in header_deps:
Expand Down

0 comments on commit d79b8a1

Please sign in to comment.