@@ -294,13 +294,18 @@ def fix_flags(cls, flags, **kwargs):
294294 parent class.
295295
296296 """
297- if ((isinstance (flags , str ) # and ' ' in flags
298- and kwargs .get ('context' , None ) == 'flag' )):
299- if '"' in flags :
300- flags = flags .replace ('"' , '\\ "' )
301- flags = f'"{ flags } "'
302- print (f"CMakeConfigure FIX_FLAGS: { type (flags )} , { flags } " )
303- return super (CMakeConfigure , cls ).fix_flags (flags , ** kwargs )
297+ # if ((isinstance(flags, str) # and ' ' in flags
298+ # and kwargs.get('context', None) == 'flag')):
299+ # if '"' in flags:
300+ # flags = flags.replace('"', '\\"')
301+ # flags = f'"{flags}"'
302+ out = super (CMakeConfigure , cls ).fix_flags (flags , ** kwargs )
303+ print (f"CMakeConfigure FIX_FLAGS: { type (flags )} , { flags } , { out } " )
304+ if ((isinstance (flags , str ) and ' ' in flags
305+ and kwargs .get ('context' , None ) == 'cmd' )):
306+ out = cls .fix_path (out , actions = ['doublequote' ])
307+ print (f"CMakeConfigure FIX_FLAGS OUT: { out } " )
308+ return out
304309
305310 @classmethod
306311 def fix_path (cls , path , ** kwargs ):
@@ -325,8 +330,11 @@ def fix_path(cls, path, **kwargs):
325330 elif kwargs .get ('context' , None ) == 'flag' :
326331 default_actions = ['forwardslash' ]
327332 if ' ' in path :
328- default_actions . append ( 'doublequote' )
333+ default_actions += [ 'doublequote' ]
329334 kwargs .setdefault ('actions' , default_actions )
335+ # elif kwargs.get('context', None) == 'cmd':
336+ # if ' ' in path:
337+ # kwargs.setdefault('actions', ['doublequote'])
330338 return super (CMakeConfigure , cls ).fix_path (path , ** kwargs )
331339
332340
0 commit comments