From 407e4639387bc5ad23b7480794ccca3a3e0b26d4 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 30 Dec 2024 18:42:50 -0700 Subject: [PATCH] scripts/gen-license.py: Support subprojects --- scripts/gen-license.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/gen-license.py b/scripts/gen-license.py index 88733871ad..817b0b2ae3 100755 --- a/scripts/gen-license.py +++ b/scripts/gen-license.py @@ -146,6 +146,14 @@ class Submodule: @property def head(self): + if self.path.endswith(".wrap"): + with open(self.path, "r", encoding="utf-8") as file: + for line in file.readlines(): + revision_pfx = "revision=" + if line.startswith(revision_pfx): + return line[len(revision_pfx):].strip() + assert False, "revision not found for subproject" + try: return subprocess.run(['git', 'rev-parse', 'HEAD'], cwd=self.path, capture_output=True, @@ -234,7 +242,7 @@ Lib('nv2a_vsh_cpu', 'https://github.com/abaire/nv2a_vsh_cpu', Lib('volk', 'https://github.com/zeux/volk', mit, 'https://raw.githubusercontent.com/zeux/volk/master/LICENSE.md', ships_static=all_platforms, - submodule=Submodule('thirdparty/volk') + submodule=Submodule('subprojects/volk.wrap') ), Lib('VulkanMemoryAllocator', 'https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator',