Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1938,24 +1938,27 @@ def compatible_with_this_arch(self):
return True

def compatible_with_this_os(self):
if not self.compatible_with_this_arch():
return False

if hasattr(self, 'os'):
assert self.os in {'all', 'linux', 'win', 'macos'}
if self.os == 'all':
return True
if self.compatible_with_this_arch() and ((WINDOWS and 'win' in self.os) or (LINUX and ('linux' in self.os or 'unix' in self.os)) or (MACOS and ('macos' in self.os or 'unix' in self.os))):
return True
else:
return False
else:
if not any(hasattr(self, a) for a in ('macos_url', 'windows_url', 'unix_url', 'linux_url')):
if (WINDOWS and self.os == 'win') or (LINUX and (self.os in {'linux', 'unix'})) or (MACOS and (self.os in {'macos', 'unix'})):
return True
return False

if MACOS and hasattr(self, 'macos_url') and self.compatible_with_this_arch():
if not any(hasattr(self, a) for a in ('macos_url', 'windows_url', 'unix_url', 'linux_url')):
return True

if LINUX and hasattr(self, 'linux_url') and self.compatible_with_this_arch():
if MACOS and hasattr(self, 'macos_url'):
return True

if WINDOWS and hasattr(self, 'windows_url') and self.compatible_with_this_arch():
if LINUX and hasattr(self, 'linux_url'):
return True

if WINDOWS and hasattr(self, 'windows_url'):
return True

if UNIX and hasattr(self, 'unix_url'):
Expand Down