Example #1
0
 def compile_shared_lib(self, outputfilename=None):
     self = self.convert_sources_to_files()
     if not self.separate_module_files:
         if sys.platform != 'win32':
             return self
         if not self.export_symbols:
             return self
         basepath = udir.join('module_cache')
     else:
         #basepath = py.path.local(self.separate_module_files[0]).dirpath()
         basepath = udir.join('shared_cache')
     if outputfilename is None:
         # find more or less unique name there
         pth = basepath.join('externmod').new(ext=host.so_ext)
         num = 0
         while pth.check():
             pth = basepath.join(
                 'externmod_%d' % (num,)).new(ext=host.so_ext)
             num += 1
         basepath.ensure(dir=1)
         outputfilename = str(pth.dirpath().join(pth.purebasename))
     lib = str(host.compile([], self, outputfilename=outputfilename,
                            standalone=False))
     d = self._copy_attributes()
     d['libraries'] += (lib,)
     d['separate_module_files'] = ()
     d['separate_module_sources'] = ()
     return ExternalCompilationInfo(**d)
Example #2
0
 def compile_shared_lib(self, outputfilename=None):
     self = self.convert_sources_to_files()
     if not self.separate_module_files:
         if sys.platform != 'win32':
             return self
         if not self.export_symbols:
             return self
         basepath = udir.join('module_cache')
     else:
         #basepath = py.path.local(self.separate_module_files[0]).dirpath()
         basepath = udir.join('shared_cache')
     if outputfilename is None:
         # find more or less unique name there
         pth = basepath.join('externmod').new(ext=host.so_ext)
         num = 0
         while pth.check():
             pth = basepath.join('externmod_%d' %
                                 (num, )).new(ext=host.so_ext)
             num += 1
         basepath.ensure(dir=1)
         outputfilename = str(pth.dirpath().join(pth.purebasename))
     lib = str(
         host.compile([],
                      self,
                      outputfilename=outputfilename,
                      standalone=False))
     d = self._copy_attributes()
     d['libraries'] += (lib, )
     d['separate_module_files'] = ()
     d['separate_module_sources'] = ()
     return ExternalCompilationInfo(**d)
Example #3
0
 def compile_shared_lib(self):
     self = self.convert_sources_to_files()
     if not self.separate_module_files:
         return self
     # find more or less unique name there
     basepath = py.path.local(self.separate_module_files[0]).dirpath()
     pth = basepath.join('externmod').new(ext=host.so_ext)
     num = 0
     while pth.check():
         pth = basepath.join('externmod_%d' % (num,)).new(ext=host.so_ext)
         num += 1
     lib = str(host.compile([], self, outputfilename=pth.purebasename,
                            standalone=False))
     d = self._copy_attributes()
     d['libraries'] += (lib,)
     d['separate_module_files'] = ()
     d['separate_module_sources'] = ()
     return ExternalCompilationInfo(**d)
Example #4
0
 def compile_shared_lib(self):
     self = self.convert_sources_to_files()
     if not self.separate_module_files:
         return self
     # find more or less unique name there
     basepath = py.path.local(self.separate_module_files[0]).dirpath()
     pth = basepath.join('externmod').new(ext=host.so_ext)
     num = 0
     while pth.check():
         pth = basepath.join('externmod_%d' % (num, )).new(ext=host.so_ext)
         num += 1
     lib = str(
         host.compile([],
                      self,
                      outputfilename=pth.purebasename,
                      standalone=False))
     d = self._copy_attributes()
     d['libraries'] += (lib, )
     d['separate_module_files'] = ()
     d['separate_module_sources'] = ()
     return ExternalCompilationInfo(**d)