def checkout(self, path): """Checkout a specific header file from SWIG""" out = self._output_file(path) if os.path.exists(out): os.remove(out) if self._skip_checkout(path): open(out, "w") elif self.version() == 103024: shutil.copy(build_path_join(self.swig_libdir, path), out) else: run("%s -o %s -co %s" % (self.swig_path, out, path)) # Fix generated SWIG files to never use "long long", which is not portable if path == "python/python.swg": python_swg = open(out).read() file = open(out, "w") file.write(""" %fragment("SWIG_AsVal_" {long long},"header") { } %fragment("SWIG_Check_" {long long},"header") { } %fragment("SWIG_From_" {long long},"header") { }\n""") file.write(python_swg) file.close()
def checkout(self, path): """Checkout a specific header file from SWIG""" out = self._output_file(path) if os.path.exists(out): os.remove(out) if self._skip_checkout(path): open(out, "w") elif self.version() == (1, 3, 24): shutil.copy(build_path_join(self.swig_libdir, path), out) else: run("%s -o %s -co %s" % (self.swig_path, out, path))