blob: 2e6a0c51656345bff99abdedddb7d3c4836e60ce [file] [log] [blame]
Jamie Madill0448ec82016-12-23 13:41:47 -05001#!/usr/bin/python
2#
3# Copyright 2016 The ANGLE Project Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6#
7# generate_vulkan_header.py:
8# Workaround problems with Windows and GYP and the Vulkan loader paths.
9
10import os, sys
11
12if len(sys.argv) < 4:
13 print("Usage: " + sys.argv[0] + " <layers_source_path> <output_file> <default_vk_layers_path>")
14 sys.exit(1)
15
16layers_source_path = sys.argv[1]
17output_file = sys.argv[2]
18default_vk_layers_path = sys.argv[3].rstrip("\"")
19
20def fixpath(inpath):
21 return os.path.relpath(inpath).replace('\\', '/')
22
23def all_paths(inpath):
24 return fixpath(inpath) + ";" + fixpath(os.path.join("..", fixpath(inpath)))
25
26with open(output_file, "w") as outfile:
27 outfile.write("#define LAYERS_SOURCE_PATH \"" + all_paths(layers_source_path) + "\"\n")
28 outfile.write("#define DEFAULT_VK_LAYERS_PATH \"" + all_paths(default_vk_layers_path) + "\"\n")