예제 #1
0
파일: peachpy.py 프로젝트: jyoung15/confu
    def compile(self, source_path, include_dirs):
        variables = dict()
        if include_dirs:
            variables["includes"] = "$includes " + " ".join(
                "-I" + include_dir for include_dir in include_dirs)

        from confu.results import CompilationResult
        return CompilationResult(source_path,
                                 self.target,
                                 rule="peachpy",
                                 variables=variables)
예제 #2
0
 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)