File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616from colcon_core .task import TaskExtensionPoint
1717# meson
1818from mesonbuild import coredata
19+ from mesonbuild .build import OptionKey
1920from mesonbuild .mesonmain import CommandLineParser
2021
22+
2123logger = colcon_logger .getChild (__name__ )
2224
2325
@@ -70,7 +72,18 @@ def format_args(args):
7072 Returns:
7173 dict: converted arguments as key-value pairs
7274 """
73- return {arg .name : args .cmd_line_options [arg ] for arg in args .cmd_line_options }
75+ cli_params = {}
76+ for param in args .cmd_line_options :
77+ v = args .cmd_line_options [param ]
78+ if isinstance (param , OptionKey ):
79+ # meson <= 1.7
80+ cli_params [param .name ] = v
81+ elif isinstance (param , str ):
82+ # meson >= 1.8
83+ cli_params [param ] = v
84+ else :
85+ raise AttributeError (f'Unsupported CLI option key type { type (param ).__name__ } ' )
86+ return cli_params
7487
7588
7689class MesonBuildTask (TaskExtensionPoint ):
You can’t perform that action at this time.
0 commit comments