summaryrefslogtreecommitdiffstats
path: root/platform_methods.py
diff options
context:
space:
mode:
authorYevhen Babiichuk (DustDFG) <dfgdust@gmail.com>2024-09-27 21:36:52 +0300
committerYevhen Babiichuk (DustDFG) <dfgdust@gmail.com>2024-10-06 07:50:49 +0300
commit7aacdaa07110db073777070262aaacb7e8a4a775 (patch)
treea683363a25b027554bd78f87d5d14af66e42db46 /platform_methods.py
parentdb66bd35af704fe0d83ba9348b8c50a48e51b2ba (diff)
downloadredot-engine-7aacdaa07110db073777070262aaacb7e8a4a775.tar.gz
Build System: Extract `validate_arch` helper function
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
Diffstat (limited to 'platform_methods.py')
-rw-r--r--platform_methods.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform_methods.py b/platform_methods.py
index 2b157da22b..2c4eb0d1dd 100644
--- a/platform_methods.py
+++ b/platform_methods.py
@@ -1,6 +1,7 @@
import os
import platform
import subprocess
+import sys
import methods
@@ -40,6 +41,15 @@ def detect_arch():
return "x86_64"
+def validate_arch(arch, platform_name, supported_arches):
+ if arch not in supported_arches:
+ methods.print_error(
+ 'Unsupported CPU architecture "%s" for %s. Supported architectures are: %s.'
+ % (arch, platform_name, ", ".join(supported_arches))
+ )
+ sys.exit(255)
+
+
def get_build_version(short):
import version