From 896b003cc8ac1827ae4f4678ca1bcaa2ce42f24e Mon Sep 17 00:00:00 2001
From: Thaddeus Crews <repiteo@outlook.com>
Date: Sun, 19 May 2024 09:41:03 -0500
Subject: SCons: Convert platform `get_flags` to dictionary

---
 SConstruct | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'SConstruct')

diff --git a/SConstruct b/SConstruct
index 7e51ef4fc4..6fa3e00325 100644
--- a/SConstruct
+++ b/SConstruct
@@ -122,6 +122,8 @@ for x in sorted(glob.glob("platform/*")):
         platform_list += [x]
         platform_opts[x] = detect.get_opts()
         platform_flags[x] = detect.get_flags()
+        if isinstance(platform_flags[x], list):  # backwards compatibility
+            platform_flags[x] = {flag[0]: flag[1] for flag in platform_flags[x]}
     sys.path.remove(tmppath)
     sys.modules.pop("detect")
 
@@ -569,9 +571,9 @@ if env["build_profile"] != "":
 # Platform specific flags.
 # These can sometimes override default options.
 flag_list = platform_flags[env["platform"]]
-for f in flag_list:
-    if f[0] not in ARGUMENTS or ARGUMENTS[f[0]] == "auto":  # Allow command line to override platform flags
-        env[f[0]] = f[1]
+for key, value in flag_list.items():
+    if key not in ARGUMENTS or ARGUMENTS[key] == "auto":  # Allow command line to override platform flags
+        env[key] = value
 
 # 'dev_mode' and 'production' are aliases to set default options if they haven't been
 # set manually by the user.
-- 
cgit v1.2.3