Skip to content

Commit 47650d2

Browse files
zherczegyichoi
authored andcommitted
Fix module include/exclude priority logic. (#991)
Command line include modules should have higher priority than default exclude modules. Fixes #924. IoT.js-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
1 parent c5a5f2b commit 47650d2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/module_analyzer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,21 @@ def resolve_modules(options):
3939
build_modules_excludes |= set(
4040
options.config['module']['exclude'][system_os])
4141

42+
# Build options has higher priority than defaults
43+
build_modules_excludes -= options.iotjs_include_module
44+
4245
# By default the target included modules are:
4346
# - always module set from the build config
4447
# - modules specified by the command line argument
45-
include_modules = set()
46-
include_modules |= build_modules_always
48+
include_modules = set() | build_modules_always
4749
include_modules |= options.iotjs_include_module
4850

4951
if not options.iotjs_minimal_profile:
5052
# Add the include set from the build config to
5153
# the target include modules set
5254
include_modules |= build_modules_includes
5355

54-
# Check if there is any modules which are not allowed to be excluded
56+
# Check if there are any modules which are not allowed to be excluded
5557
impossible_to_exclude = options.iotjs_exclude_module & build_modules_always
5658
if impossible_to_exclude:
5759
ex.fail('Cannot exclude modules which are always enabled: %s' %

0 commit comments

Comments
 (0)