def peachpy(self, source_path): from confu.validators import validate_source_path source_path = validate_source_path(source_path, self.source_dir) include_dirs = sum( (dep.cpath for dep in self._deps if hasattr(dep, "cpath")), self.include_dirs) return self.tools.peachpy.compile(source_path, include_dirs=include_dirs)
def _compile(self, rule, source_path): from confu.validators import validate_source_path source_path = validate_source_path(source_path, self.source_dir) variables = dict() include_dirs = self.include_dirs for dep in self._deps: if hasattr(dep, "cpath"): include_dirs += dep.cpath if include_dirs: variables["includes"] = "$includes " + " ".join("-I" + include_dir for include_dir in include_dirs) if self._isa: variables["optflags"] = "$optflags " + " ".join(self._isa.get_flags(self.toolchain.cc)) if self._macros: from confu.utils import format_macro variables["macro"] = " ".join(format_macro(name, self._macros[name]) for name in sorted(self._macros)) return CompilationResult(source_path, self.target, rule=rule, variables=variables)