Browse Source

dist: Add support for emscripten platform to FreezeTool.py

rdb 2 years ago
parent
commit
ed4d2a2280
1 changed files with 7 additions and 1 deletions
  1. 7 1
      direct/src/dist/FreezeTool.py

+ 7 - 1
direct/src/dist/FreezeTool.py

@@ -1232,7 +1232,7 @@ class Freezer:
         # sysconfigdata module on POSIX systems.
         missing = []
         if 'sysconfig' in self.mf.modules and \
-           ('linux' in self.platform or 'mac' in self.platform):
+           ('linux' in self.platform or 'mac' in self.platform or 'emscripten' in self.platform):
             modname = '_sysconfigdata'
             if sys.version_info >= (3, 6):
                 modname += '_'
@@ -1244,6 +1244,12 @@ class Freezer:
                     modname += '_linux_' + arch + '-linux-gnu'
                 elif 'mac' in self.platform:
                     modname += '_darwin_darwin'
+                elif 'emscripten' in self.platform:
+                    if '_' in self.platform:
+                        arch = self.platform.split('_', 1)[1]
+                    else:
+                        arch = 'wasm32'
+                    modname += '_emscripten_' + arch + '-emscripten'
 
             try:
                 self.__loadModule(self.ModuleDef(modname, implicit=True))