diff options
| author | Jamie Madill <jmadill@chromium.org> | 2017-12-20 14:45:11 -0500 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-12-21 09:20:17 -0700 |
| commit | 43131b7521d3f95b9b0ba84fdd60ca4d12036dc1 (patch) | |
| tree | 071aceea2e9a642a9a2e8ef730f0d2440cc64334 /scripts/object_tracker_generator.py | |
| parent | 58db2d7cc94023ae63d4c1c98eb5df74c0b62f0d (diff) | |
| download | usermoji-43131b7521d3f95b9b0ba84fdd60ca4d12036dc1.tar.xz | |
scripts: Scan CWD in object tracker generator.
This makes it more easy to locate a 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.
This is similar to the change to the parameter validation generator.
Diffstat (limited to 'scripts/object_tracker_generator.py')
| -rw-r--r-- | scripts/object_tracker_generator.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/object_tracker_generator.py b/scripts/object_tracker_generator.py index 9bcfb8bb..e9109e5b 100644 --- a/scripts/object_tracker_generator.py +++ b/scripts/object_tracker_generator.py @@ -238,6 +238,9 @@ class ObjectTrackerOutputGenerator(OutputGenerator): self.valid_vuids = set() # Set of all valid VUIDs 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', @@ -251,6 +254,7 @@ class ObjectTrackerOutputGenerator(OutputGenerator): if self.vuid_file == None: print("Error: Could not find vk_validation_error_messages.h") sys.exit(1) + os.chdir(previous_dir) # # Check if the parameter passed in is optional def paramIsOptional(self, param): |
