Jamie Madill | 0448ec8 | 2016-12-23 13:41:47 -0500 | [diff] [blame] | 1 | #!/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 | |
| 10 | import os, sys |
| 11 | |
| 12 | if len(sys.argv) < 4: |
| 13 | print("Usage: " + sys.argv[0] + " <layers_source_path> <output_file> <default_vk_layers_path>") |
| 14 | sys.exit(1) |
| 15 | |
| 16 | layers_source_path = sys.argv[1] |
| 17 | output_file = sys.argv[2] |
| 18 | default_vk_layers_path = sys.argv[3].rstrip("\"") |
| 19 | |
| 20 | def fixpath(inpath): |
| 21 | return os.path.relpath(inpath).replace('\\', '/') |
| 22 | |
| 23 | def all_paths(inpath): |
| 24 | return fixpath(inpath) + ";" + fixpath(os.path.join("..", fixpath(inpath))) |
| 25 | |
| 26 | with 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") |