From 3f415dadf0b31eba78858fb8c5f0a06acabdb01b Mon Sep 17 00:00:00 2001 From: odaki Date: Tue, 24 Mar 2020 00:50:59 +0900 Subject: [PATCH 1/2] add the define to enable if it was not found in the block --- configure-features.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure-features.py b/configure-features.py index 7e0ddf1f..dcf1fd64 100755 --- a/configure-features.py +++ b/configure-features.py @@ -136,6 +136,9 @@ def writeConfig(path, buf): def changeConfig(src, enabled, disabled, verbose=False): dst = "" + numEnabledDic = {} + for name in enabled: + numEnabledDic[name] = 0 regstart = re.compile(r'^\s*//\s*' + eyecatchBeginString) regend = re.compile(r'^\s*//\s*' + eyecatchEndString) state = 0; @@ -149,6 +152,10 @@ def changeConfig(src, enabled, disabled, verbose=False): # in the defines block to modify if regend.match(line): # end of block found + for name in enabled: + # add the define to enable if it was not found in the block + if numEnabledDic[name] == 0: + dst += "#define " + enablePrefix + name + '\n' state = 2 dst += line else: @@ -159,6 +166,7 @@ def changeConfig(src, enabled, disabled, verbose=False): m = re.match(r'^s*//\s*#define\s+(' + s + r'.*)$', line) if m: dstLine = "#define " + m.group(1) + '\n' + numEnabledDic[name] += 1 break if len(disabled) > 0: for name in disabled: From cc9c08cbce909d9a39ea0ccdf3cc9a7be4d963c5 Mon Sep 17 00:00:00 2001 From: odaki Date: Tue, 24 Mar 2020 21:25:45 +0900 Subject: [PATCH 2/2] Fix: the keyword comparison Fixed a bug in the keyword check that it was originally supposed to be case-sensitive, but it was not. --- configure-features.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure-features.py b/configure-features.py index dcf1fd64..e0b5e513 100755 --- a/configure-features.py +++ b/configure-features.py @@ -72,7 +72,7 @@ def parseArgs(defaultConfigPath): def isValidFeature(feature): if feature: - if feature.upper() in validFeatureList: + if feature in validFeatureList: return True #valid return False #invalid