Skip to content

Commit 4700966

Browse files
galpeteryichoi
authored andcommitted
Module analyzer should use the correct target os during build (#986)
The buildystem did not specified the target os for the module analyzer. IoT.js-DCO-1.0-Signed-off-by: Peter Gal [email protected]
1 parent 0eff55a commit 4700966

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cmake/iotjs.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ endif()
5555
execute_process(
5656
COMMAND python ${ROOT_DIR}/tools/module_analyzer.py
5757
--mode cmake-dump
58+
--target-os ${TARGET_OS}
5859
--iotjs-include-module "${IOTJS_INCLUDE_MODULE}"
5960
--iotjs-exclude-module "${IOTJS_EXCLUDE_MODULE}"
6061
${MODULE_ANALYZER_ARGS}

tools/module_analyzer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
from common_py.system.filesystem import FileSystem as fs
2222
from common_py.system.executor import Executor as ex
23+
from common_py.system.platform import Platform
2324
from common_py import path
2425

26+
platform = Platform()
2527

2628
def resolve_modules(options):
2729
""" Resolve include/exclude module lists based on command line arguments
@@ -144,6 +146,11 @@ def _load_options(argv):
144146
help='Specify iotjs modules which should be excluded '
145147
'(format: module_1,module_2,...)')
146148
},
149+
{'name': 'target-os',
150+
'args': dict(choices=['linux', 'darwin', 'nuttx', 'tizen', 'tizenrt'],
151+
default=platform.os, type=str.lower,
152+
help='Specify the target os: %(choices)s (default: %(default)s)')
153+
},
147154
{'name': 'mode',
148155
'args': dict(choices=['verbose', 'cmake-dump'],
149156
default='verbose',
@@ -192,7 +199,6 @@ def _load_options(argv):
192199

193200
options = parser.parse_args(loaded_argv)
194201
options.config = config
195-
options.target_os = config['build_option']['target-os']
196202

197203
return options
198204

0 commit comments

Comments
 (0)