Added recipes for Glslang and GLM.

This commit is contained in:
2023-11-04 19:34:16 +01:00
parent 93dd09e324
commit 7050ec5e43
3 changed files with 35 additions and 0 deletions

23
recipes/glslang/recipe.py Normal file
View File

@@ -0,0 +1,23 @@
from SCons.Script import *
import os
import subprocess
import sys
def cook(env: Environment, remote: str = 'github', git_ref: str = '') -> dict:
if remote == 'mewin':
repo = env.Cook('GitBranch', repo_name = 'glslang_mewin', remote_url = 'https://git.mewin.de/mewin/glslang.git', git_ref = git_ref or 'master')
else:
repo = env.Cook('GitBranch', repo_name = 'glslang', remote_url = 'https://github.com/KhronosGroup/glslang.git', git_ref = git_ref or 'main')
checkout_root = repo['checkout_root']
# TODO: windows?
subprocess.run(('/usr/bin/env', 'python3', 'update_glslang_sources.py'), cwd=checkout_root, stdout=sys.stdout, stderr=sys.stderr, check=True)
build_result = env.Cook('CMakeProject', project_root=checkout_root, generate_args = ['-DBUILD_TESTING=OFF'])
return {
'LIBPATH': [os.path.join(build_result['install_dir'], 'glslang')],
'CPPPATH': build_result['CPPPATH'],
'LIBS': ['glslang', 'glslang-default-resource-limits', 'MachineIndependent']
}