diff --git a/recipes/CMakeProject/recipe.py b/recipes/CMakeProject/recipe.py index e2e30e4..80d5823 100644 --- a/recipes/CMakeProject/recipe.py +++ b/recipes/CMakeProject/recipe.py @@ -27,6 +27,7 @@ def cook(env: Environment, project_root: str, generate_args: 'list[str]' = [], b pathlib.Path(install_dir, _BUILT_STAMPFILE).touch() return { + 'install_dir': install_dir, 'LIBPATH': [os.path.join(install_dir, 'lib')], 'CPPPATH': [os.path.join(install_dir, 'include')] } diff --git a/recipes/glm/recipe.py b/recipes/glm/recipe.py new file mode 100644 index 0000000..b8e8bcf --- /dev/null +++ b/recipes/glm/recipe.py @@ -0,0 +1,11 @@ + +import os +from SCons.Script import * + +def cook(env: Environment, git_ref: str = "master") -> dict: + repo = env.Cook('GitBranch', repo_name = 'glm', remote_url = 'https://github.com/g-truc/glm.git', git_ref = git_ref) + checkout_root = repo['checkout_root'] + + return { + 'CPPPATH': [checkout_root], + } diff --git a/recipes/glslang/recipe.py b/recipes/glslang/recipe.py new file mode 100644 index 0000000..610eebf --- /dev/null +++ b/recipes/glslang/recipe.py @@ -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'] + }