[Build] xenia-build Android host OS detection

This commit is contained in:
Triang3l 2020-11-21 14:54:57 +03:00
parent 4786e93c96
commit 25606774e1
1 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,17 @@ __author__ = 'ben.vanik@gmail.com (Ben Vanik)'
self_path = os.path.dirname(os.path.abspath(__file__)) self_path = os.path.dirname(os.path.abspath(__file__))
# Detect if building on Android via Termux.
host_os_is_android = False
if sys.platform == 'linux':
try:
host_os_is_android = subprocess.Popen(
['uname', '-o'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
universal_newlines=True).communicate()[0] == 'Android\n'
except Exception:
pass
def main(): def main():
# Add self to the root search path. # Add self to the root search path.
sys.path.insert(0, self_path) sys.path.insert(0, self_path)