Commits

Armin Rigo committed 09417d7

Trying out a different fix for b366d0104c42... Hard to test

Comments (0)

Files changed (3)

rpython/translator/platform/__init__.py

         ofiles = self._compile_o_files(cfiles, eci, standalone)
         return self._finish_linking(ofiles, eci, outputfilename, standalone)
 
+    def _all_cfiles(self, cfiles, eci):
+        seen = set()
+        result = []
+        for cfile in list(cfiles) + list(eci.separate_module_files):
+            cfile = py.path.local(cfile)
+            if cfile not in seen:
+                seen.add(cfile)
+                result.append(cfile)
+        return result
+
     def _compile_o_files(self, cfiles, eci, standalone=True):
-        cfiles = [py.path.local(f) for f in cfiles]
-        cfiles += [py.path.local(f) for f in eci.separate_module_files]
+        cfiles = self._all_cfiles(cfiles, eci)
         compile_args = self._compile_args_from_eci(eci, standalone)
         ofiles = []
         for cfile in cfiles:

rpython/translator/platform/posix.py

 
     def gen_makefile(self, cfiles, eci, exe_name=None, path=None,
                      shared=False):
-        cfiles = [py.path.local(f) for f in cfiles]
-        cfiles += [py.path.local(f) for f in eci.separate_module_files]
+        cfiles = self._all_cfiles(cfiles, eci)
 
         if path is None:
             path = cfiles[0].dirpath()

rpython/translator/platform/windows.py

 
     def gen_makefile(self, cfiles, eci, exe_name=None, path=None,
                      shared=False):
-        cfiles = [py.path.local(f) for f in cfiles]
-        cfiles += [py.path.local(f) for f in eci.separate_module_files]
+        cfiles = self._all_cfiles(cfiles, eci)
 
         if path is None:
             path = cfiles[0].dirpath()