Ejemplo n.º 1
0
 def __collect_files_by_extension(self, filenames=set()):
     for file_path in self.files():
         filename = os.path.basename(file_path)
         if check_extensions(file_path, self.__header_exts):
             self._headers.add(file_path)
         if check_extensions(file_path, self.__src_exts):
             file_excluded = False
             if self.__excluded_sources:
                 for exc_src in self.__excluded_sources:
                     if exc_src in file_path:
                         file_excluded = True
                         break
             if file_excluded:
                 continue
             if self.__included_sources:
                 for inc_src in self.__included_sources:
                     if os.path.basename(inc_src) == filename:
                         if self.__check_duplicates(filename, filenames):
                             sys.exit(1)
                         self._sources.add(file_path)
                         break
             else:
                 if self.__check_duplicates(filename, filenames):
                     return
                 self._sources.add(file_path)
Ejemplo n.º 2
0
 def __collect_files_by_extension(self, filenames=set()):
     for file_path in self.files():
         filename = os.path.basename(file_path)
         if check_extensions(file_path, self.__header_exts):
             self._headers.add(file_path)
         if check_extensions(file_path, self.__src_exts):
             file_excluded = False
             if self.__excluded_sources:
                 for exc_src in self.__excluded_sources:
                     if exc_src in file_path:
                         file_excluded = True
                         break
             if file_excluded:
                 continue
             if self.__included_sources:
                 for inc_src in self.__included_sources:
                     if os.path.basename(inc_src) == filename:
                         if self.__check_duplicates(filename, filenames):
                             sys.exit(1)
                         self._sources.add(file_path)
                         break
             else:
                 if self.__check_duplicates(filename, filenames):
                     return
                 self._sources.add(file_path)
Ejemplo n.º 3
0
 def compile_file(self, file_path, platform, cc, cflags):
     output_name = self.__output_name(file_path) 
     output = os.path.join(self.__obj_path, output_name)
     if (file_path not in self.__outdated_sources and
             not older(output, [file_path])):
         return
     if file_path in self.__src_to_header_map:
         self.__add_include_flags(file_path, cflags)
     call_str = cc + " -c " + file_path + " " + " -o " + output + " " + (' '.join(cflags))
     status = call([call_str], env=platform.var_env(), shell=True)
     if check_extensions(file_path, ['.cpp', '.cc', '.mm']):
         print ('\t  CXX\t' + file_path)
     else:
         print ('\t  CC\t' + file_path)
     if amigo_config.VERBOSE:
         print (call_str)
     if status != 0:
         failed_files.append(file_path)
Ejemplo n.º 4
0
 def compile_file(self, file_path, platform, cc, cflags):
     output_name = self.__output_name(file_path)
     output = os.path.join(self.__obj_path, output_name)
     if (file_path not in self.__outdated_sources
             and not older(output, [file_path])):
         return
     if file_path in self.__src_to_header_map:
         self.__add_include_flags(file_path, cflags)
     call_str = cc + " -c " + file_path + " " + " -o " + output + " " + (
         ' '.join(cflags))
     status = call([call_str], env=platform.var_env(), shell=True)
     if check_extensions(file_path, ['.cpp', '.cc', '.mm']):
         print('\t  CXX\t' + file_path)
     else:
         print('\t  CC\t' + file_path)
     if amigo_config.VERBOSE:
         print(call_str)
     if status != 0:
         failed_files.append(file_path)
Ejemplo n.º 5
0
 def __compile_file_path(self, platform, file_path):
     if check_extensions(file_path, ['.c', '.m']):
         self.__c_build(file_path, platform)
     if check_extensions(file_path, ['.cpp', '.cc', '.mm']):
         self.__cpp_build(file_path, platform)
Ejemplo n.º 6
0
 def __compile_file_path(self, platform, file_path):
     if check_extensions(file_path, ['.c', '.m']):
         self.__c_build(file_path, platform)
     if check_extensions(file_path, ['.cpp', '.cc', '.mm']):
         self.__cpp_build(file_path, platform)