55def set_dawn_args_and_env(args, env, api, extra_tokens, skia_dir):
56 """Add to ``args`` and ``env`` the gn args and environment vars needed to
57 make a build targeting Dawn."""
58 args['skia_use_dawn'] = 'true'
59 args['skia_use_gl'] = 'false'
60
61 args['dawn_enable_d3d11'] = 'false'
62 args['dawn_enable_d3d12'] = 'false'
63 args['dawn_enable_metal'] = 'false'
64 args['dawn_enable_desktop_gl'] = 'false'
65 args['dawn_enable_opengles'] = 'false'
66 args['dawn_enable_vulkan'] = 'false'
67 if 'D3D11' in extra_tokens:
68 args['dawn_enable_d3d11'] = 'true'
69 if 'D3D12' in extra_tokens:
70 args['dawn_enable_d3d12'] = 'true'
71 if 'Metal' in extra_tokens:
72 args['dawn_enable_metal'] = 'true'
73 if 'Vulkan' in extra_tokens:
74 args['dawn_enable_vulkan'] = 'true'
75 env['PYTHONPATH'] = api.path.pathsep.join([
76 str(skia_dir.join('third_party', 'externals')), '%%(PYTHONPATH)s'])