summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-05-28 18:17:14 +0300
committerAndrii Doroshenko (Xrayez) <xrayez@gmail.com>2020-05-28 18:17:49 +0300
commit17938fd54727901688d464f4f92fb8db68cc17b5 (patch)
treeb0cfcd547c8a1548739cd85bf273f09983c965b8 /SConstruct
parentbfac9b35385eddd3e3034674ae3fbd309ee64843 (diff)
SCons: use `OrderedDict` to ensure insertion order of modules
The insertion order for dictionaries is only a language feature for Python 3.6/3.7+ implementations, and not prior to that. This ensures that the engine won't be rebuilt if the order of detected modules changes in any way, as the `OrderedDict` should guarantee inerstion order.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct7
1 files changed, 4 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 515cad57d0..908e5fe7c3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -8,6 +8,7 @@ import glob
import os
import pickle
import sys
+from collections import OrderedDict
# Local
import methods
@@ -181,7 +182,7 @@ for k in platform_opts.keys():
opts.Add(o)
# Detect modules.
-modules_detected = {}
+modules_detected = OrderedDict()
module_search_paths = ["modules"] # Built-in path.
if ARGUMENTS.get("custom_modules"):
@@ -523,11 +524,11 @@ if selected_platform in platform_list:
sys.path.remove(tmppath)
sys.modules.pop("detect")
- modules_enabled = {}
+ modules_enabled = OrderedDict()
env.module_icons_paths = []
env.doc_class_path = {}
- for name, path in sorted(modules_detected.items()):
+ for name, path in modules_detected.items():
if not env["module_" + name + "_enabled"]:
continue
sys.path.insert(0, path)