@@ -193,7 +193,7 @@ def generate(self, capture: bool = False, vslite_ctx: T.Optional[dict] = None) -
193193 'Some other Meson process is already using this build directory. Exiting.' ):
194194 return self ._generate (env , capture , vslite_ctx )
195195
196- def check_unused_options (self , coredata : 'coredata.CoreData' , cmd_line_options : T .Any , all_subprojects : T .Mapping [str , object ]) -> None :
196+ def check_unused_options (self , coredata : 'coredata.CoreData' , cmd_line_options : T .Dict [ OptionKey , str ] , all_subprojects : T .Mapping [str , object ]) -> None :
197197 pending = coredata .optstore .pending_options
198198 errlist : T .List [str ] = []
199199 known_subprojects = all_subprojects .keys ()
@@ -202,9 +202,8 @@ def check_unused_options(self, coredata: 'coredata.CoreData', cmd_line_options:
202202 # because they might be used in future reconfigurations
203203 if coredata .optstore .accept_as_pending_option (opt , known_subprojects ):
204204 continue
205- keystr = str (opt )
206- if keystr in cmd_line_options :
207- errlist .append (f'"{ keystr } "' )
205+ if opt in cmd_line_options :
206+ errlist .append (f'"{ opt } "' )
208207 if errlist :
209208 errstr = ', ' .join (errlist )
210209 raise MesonException (f'Unknown options: { errstr } ' )
@@ -348,17 +347,18 @@ def run_genvslite_setup(options: CMDOptions) -> None:
348347 # invoke the appropriate 'meson compile ...' build commands upon the normal visual studio build/rebuild/clean actions, instead of using
349348 # the native VS/msbuild system.
350349 builddir_prefix = options .builddir
351- genvsliteval = options .cmd_line_options .pop ('genvslite' ) # type: ignore [call-overload]
350+ k_genvslite = OptionKey ('genvslite' )
351+ genvsliteval = options .cmd_line_options .pop (k_genvslite )
352352 # The command line may specify a '--backend' option, which doesn't make sense in conjunction with
353353 # '--genvslite', where we always want to use a ninja back end -
354- k_backend = 'backend'
354+ k_backend = OptionKey ( 'backend' )
355355 if k_backend in options .cmd_line_options .keys ():
356- if options .cmd_line_options [k_backend ] != 'ninja' : # type: ignore [index]
356+ if options .cmd_line_options [k_backend ] != 'ninja' :
357357 raise MesonException ('Explicitly specifying a backend option with \' genvslite\' is not necessary '
358358 '(the ninja backend is always used) but specifying a non-ninja backend '
359359 'conflicts with a \' genvslite\' setup' )
360360 else :
361- options .cmd_line_options [k_backend ] = 'ninja' # type: ignore [index]
361+ options .cmd_line_options [k_backend ] = 'ninja'
362362 buildtypes_list = coredata .get_genvs_default_buildtype_list ()
363363 vslite_ctx = {}
364364
@@ -369,7 +369,7 @@ def run_genvslite_setup(options: CMDOptions) -> None:
369369 vslite_ctx [buildtypestr ] = app .generate (capture = True )
370370 #Now for generating the 'lite' solution and project files, which will use these builds we've just set up, above.
371371 options .builddir = f'{ builddir_prefix } _vs'
372- options .cmd_line_options [OptionKey ( 'genvslite' ) ] = genvsliteval
372+ options .cmd_line_options [k_genvslite ] = genvsliteval
373373 app = MesonApp (options )
374374 app .generate (capture = False , vslite_ctx = vslite_ctx )
375375
@@ -385,7 +385,7 @@ def run(options: T.Union[CMDOptions, T.List[str]]) -> int:
385385 # lie
386386 options .pager = False
387387
388- if 'genvslite' in options .cmd_line_options .keys ():
388+ if OptionKey ( 'genvslite' ) in options .cmd_line_options .keys ():
389389 run_genvslite_setup (options )
390390 else :
391391 app = MesonApp (options )
0 commit comments