@@ -18,13 +18,13 @@ def enabled_defines(filepath):
18
18
Each entry is a dictionary with a 'name' and a 'section' key. We end up with:
19
19
{ MOTHERBOARD: { name: "MOTHERBOARD", section: "hardware" }, ... }
20
20
21
- The 'name' key might get dropped as redundant, but it's useful for debugging.
21
+ TODO: Drop the 'name' key as redundant. For now it's useful for debugging.
22
22
23
- Because the option names are the keys, only the last occurrence is retained.
24
- Use the Schema class for a more complete list of options, soon with full parsing.
23
+ This list is only used to filter config-defined options from those defined elsewhere.
25
24
26
- This list is used to filter what is actually a config-defined option versus
27
- defines from elsewhere.
25
+ Because the option names are the keys, only the last occurrence is retained.
26
+ This means the actual used value might not be reflected by this function.
27
+ The Schema class does more complete parsing for a more accurate list of options.
28
28
29
29
While the Schema class parses the configurations on its own, this script will
30
30
get the preprocessor output and get the intersection of the enabled options from
@@ -44,13 +44,10 @@ def enabled_defines(filepath):
44
44
# This will avoid false positives from #defines in comments
45
45
f = re .sub (r'/\*.*?\*/' , '' , '\n ' .join (f ), flags = re .DOTALL ).split ("\n " )
46
46
47
- a = []
48
47
for line in f :
49
48
sline = line .strip ()
50
49
m = re .match (spatt , sline ) # @section ...
51
- if m :
52
- section = m .group (1 ).strip ()
53
- continue
50
+ if m : section = m .group (1 ).strip () ; continue
54
51
if sline [:7 ] == "#define" :
55
52
# Extract the key here (we don't care about the value)
56
53
kv = sline [8 :].strip ().split ()
@@ -79,6 +76,7 @@ def compute_build_signature(env):
79
76
Compute the build signature by extracting all configuration settings and
80
77
building a unique reversible signature that can be included in the binary.
81
78
The signature can be reversed to get a 1:1 equivalent configuration file.
79
+ Used by common-dependencies.py after filtering build files by feature.
82
80
'''
83
81
if 'BUILD_SIGNATURE' in env : return
84
82
env .Append (BUILD_SIGNATURE = 1 )
0 commit comments