Made PCH work with cross compilation.

pull/15/head
Jussi Pakkanen 11 years ago
parent 5a377f6466
commit 0f35ac078d
  1. 5
      backends.py

@ -736,6 +736,9 @@ class NinjaBackend(Backend):
return (commands, dep, dst) return (commands, dep, dst)
def generate_pch(self, target, outfile): def generate_pch(self, target, outfile):
cstr = ''
if target.is_cross:
cstr = '_CROSS'
for lang in ['c', 'cpp']: for lang in ['c', 'cpp']:
pch = target.get_pch(lang) pch = target.get_pch(lang)
if len(pch) == 0: if len(pch) == 0:
@ -751,7 +754,7 @@ class NinjaBackend(Backend):
src = os.path.join(self.build_to_src, target.get_source_subdir(), pch[0]) src = os.path.join(self.build_to_src, target.get_source_subdir(), pch[0])
(commands, dep, dst) = self.generate_gcc_pch_command(target, compiler, pch[0]) (commands, dep, dst) = self.generate_gcc_pch_command(target, compiler, pch[0])
extradep = None extradep = None
rulename = compiler.get_language() + '_PCH' rulename = compiler.get_language() + cstr + '_PCH'
elem = NinjaBuildElement(dst, rulename, src) elem = NinjaBuildElement(dst, rulename, src)
if extradep is not None: if extradep is not None:
elem.add_dep(extradep) elem.add_dep(extradep)

Loading…
Cancel
Save