aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJamie Madill <jmadill@chromium.org>2017-12-15 15:54:05 -0500
committerTobin Ehlis <tobine@google.com>2017-12-15 16:40:00 -0700
commita90a166fc7ce9600adb2a81b0d6c16d648ac71bd (patch)
tree8fe996610864fad060412da23fb690178881bf18 /scripts
parentd047d96e3399ba0e8ec668feebc968729215c491 (diff)
downloadusermoji-a90a166fc7ce9600adb2a81b0d6c16d648ac71bd.tar.xz
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.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/parameter_validation_generator.py4
1 files changed, 4 insertions, 0 deletions
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):