diff options
| author | Charles Giessen <charles@lunarg.com> | 2025-09-16 20:54:55 -0500 |
|---|---|---|
| committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2025-09-17 10:30:12 -0600 |
| commit | 9213d6836e5564c6c3cdf0936e9a1150e4285079 (patch) | |
| tree | 7cdf40e93b3851d728d8f698a3cad84d0d350c7e /scripts | |
| parent | 83cded838a1a6e2dadfda6b114c8e12135194718 (diff) | |
| download | usermoji-9213d6836e5564c6c3cdf0936e9a1150e4285079.tar.xz | |
build: Put generated version in CMake project()
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/generate_source.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/generate_source.py b/scripts/generate_source.py index 8b1e3acf..336e5ffb 100755 --- a/scripts/generate_source.py +++ b/scripts/generate_source.py @@ -22,6 +22,7 @@ import argparse import filecmp import os +import re import json import shutil import subprocess @@ -151,6 +152,15 @@ def main(argv): print('update', repo_filename) shutil.copyfile(temp_filename, repo_filename) + # write out the header version used to generate the code to a checked in CMake file + if args.generated_version: + # Update the CMake project version + with open(common_codegen.repo_relative('CMakeLists.txt'), "r+") as f: + data = f.read() + f.seek(0) + f.write(re.sub("project.*VERSION.*", f"project(Vulkan-Tools VERSION {args.generated_version})", data)) + f.truncate() + return 0 if __name__ == '__main__': |
