diff --git a/backends.py b/backends.py index 559113987..577e1b8c2 100644 --- a/backends.py +++ b/backends.py @@ -241,7 +241,7 @@ class Backend(): 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: @@ -250,7 +250,7 @@ class Backend(): 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): diff --git a/environment.py b/environment.py index 6a56ac9a0..cf32d5e2d 100644 --- a/environment.py +++ b/environment.py @@ -187,8 +187,8 @@ class CCompiler(): 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'] @@ -552,8 +552,8 @@ class MonoCompiler(): 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 [] @@ -694,8 +694,8 @@ class JavaCompiler(): 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 [] @@ -1228,11 +1228,11 @@ end program prog 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' diff --git a/ninjabackend.py b/ninjabackend.py index 08e43b44a..1ab107c25 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -1062,7 +1062,7 @@ rule FORTRAN_DEP_HACK 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: @@ -1100,10 +1100,10 @@ rule FORTRAN_DEP_HACK 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 = '' @@ -1121,7 +1121,7 @@ rule FORTRAN_DEP_HACK 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: