File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717# meson
1818from mesonbuild import coredata
1919from mesonbuild .mesonmain import CommandLineParser
20+ from mesonbuild .options import OptionKey
2021
2122logger = colcon_logger .getChild (__name__ )
2223
@@ -70,7 +71,18 @@ def format_args(args):
7071 Returns:
7172 dict: converted arguments as key-value pairs
7273 """
73- return {arg .name : args .cmd_line_options [arg ] for arg in args .cmd_line_options }
74+ cli_params = {}
75+ for param in args .cmd_line_options :
76+ v = args .cmd_line_options [param ]
77+ if isinstance (param , OptionKey ):
78+ # meson <= 1.7
79+ cli_params [param .name ] = v
80+ elif isinstance (param , str ):
81+ # meson >= 1.8
82+ cli_params [param ] = v
83+ else :
84+ raise AttributeError (f'Unsupported CLI option key type { type (param ).__name__ } ' )
85+ return cli_params
7486
7587
7688class MesonBuildTask (TaskExtensionPoint ):
You can’t perform that action at this time.
0 commit comments