From a90a166fc7ce9600adb2a81b0d6c16d648ac71bd Mon Sep 17 00:00:00 2001 From: Jamie Madill Date: Fri, 15 Dec 2017 15:54:05 -0500 Subject: scripts: Scan CWD in parameter validation script. This makes it more easy to locate the header in configs which have the CWD set to something less obvious. In Chrome's case the build directory is completely separated from the script directory. Also reset the CWD after the header is found to keep the build intact. --- scripts/parameter_validation_generator.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/parameter_validation_generator.py') diff --git a/scripts/parameter_validation_generator.py b/scripts/parameter_validation_generator.py index ba825e28..4a9ec4ea 100644 --- a/scripts/parameter_validation_generator.py +++ b/scripts/parameter_validation_generator.py @@ -193,6 +193,9 @@ class ParameterValidationOutputGenerator(OutputGenerator): self.vuid_file = None # Cover cases where file is built from scripts directory, Lin/Win, or Android build structure + # Set cwd to the script directory to more easily locate the header. + previous_dir = os.getcwd() + os.chdir(os.path.dirname(sys.argv[0])) vuid_filename_locations = [ './vk_validation_error_messages.h', '../layers/vk_validation_error_messages.h', @@ -206,6 +209,7 @@ class ParameterValidationOutputGenerator(OutputGenerator): if self.vuid_file == None: print("Error: Could not find vk_validation_error_messages.h") sys.exit(1) + os.chdir(previous_dir) # # Generate Copyright comment block for file def GenerateCopyright(self): -- cgit v1.2.3