blob: 59ce2c43bde451201f0e3e2ebdaec2567d606000 [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:
Jamie Madilla66779f2017-01-06 10:43:44 -050013 print("Usage: " + sys.argv[0] + " <json_source_path> <output_file> <product_dir>")
Jamie Madill0448ec82016-12-23 13:41:47 -050014 sys.exit(1)
15
16layers_source_path = sys.argv[1]
17output_file = sys.argv[2]
Jamie Madilla66779f2017-01-06 10:43:44 -050018product_dir = sys.argv[3].rstrip("\"")
Jamie Madill0448ec82016-12-23 13:41:47 -050019
20def fixpath(inpath):
Jamie Madilla66779f2017-01-06 10:43:44 -050021 return os.path.relpath(inpath, product_dir).replace('\\', '/')
Jamie Madill0448ec82016-12-23 13:41:47 -050022
23with open(output_file, "w") as outfile:
Jamie Madilla66779f2017-01-06 10:43:44 -050024 outfile.write("#define LAYERS_SOURCE_PATH \"" + fixpath(layers_source_path) + "\"\n")
25 outfile.write("#define DEFAULT_VK_LAYERS_PATH \"" + fixpath(product_dir) + "\"\n")