Fixed recipe for VulkanHeaders and added recipes for SpirVHeaders and SpirVReflect.
This commit is contained in:
parent
9a00657560
commit
1875e6fff5
26
recipes/SpirVHeaders/recipe.py
Normal file
26
recipes/SpirVHeaders/recipe.py
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
|
||||
def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
vulkan_headers = env.Cook('VulkanHeaders')
|
||||
checkout_root = repo['checkout_root']
|
||||
|
||||
return {
|
||||
'CPPPATH': [f'{checkout_root}/include']
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'SpirVHeaders',
|
||||
repo_url = 'https://github.com/KhronosGroup/SPIRV-Headers.git',
|
||||
tag_pattern = re.compile(r'^vulkan-sdk-([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$'),
|
||||
tag_fn = lambda version: f'vulkan-sdk-{version[0]}.{version[1]}.{version[2]}.{version[3]}',
|
||||
cook_fn = _git_cook,
|
||||
dependencies = {
|
||||
'VulkanHeaders': {}
|
||||
}
|
||||
)
|
43
recipes/SpirVReflect/recipe.py
Normal file
43
recipes/SpirVReflect/recipe.py
Normal file
@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
|
||||
def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
checkout_root = repo['checkout_root']
|
||||
|
||||
source_files = [f'{checkout_root}/spirv_reflect.cpp']
|
||||
|
||||
additional_cxx_flags = []
|
||||
additional_cppdefines = ['SPIRV_REFLECT_USE_SYSTEM_SPIRV_H']
|
||||
if env['COMPILER_FAMILY'] == 'gcc':
|
||||
additional_cxx_flags.append('-Wno-overflow')
|
||||
lib_spirv_reflect = env.StaticLibrary(
|
||||
CCFLAGS = env['CCFLAGS'] + additional_cxx_flags,
|
||||
CPPPATH = [repo['checkout_root']],
|
||||
CPPDEFINES = list(env['CPPDEFINES']) + additional_cppdefines,
|
||||
target = env['LIB_DIR'] + '/spirv_reflect',
|
||||
source = source_files,
|
||||
dependencies = {
|
||||
'SpirVHeaders': {}
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
'CPPPATH': [repo['checkout_root']],
|
||||
'LIBS': [lib_spirv_reflect]
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'SpirVReflect',
|
||||
repo_url = 'https://github.com/KhronosGroup/SPIRV-Reflect.git',
|
||||
tag_pattern = re.compile(r'^vulkan-sdk-([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$'),
|
||||
tag_fn = lambda version: f'vulkan-sdk-{version[0]}.{version[1]}.{version[2]}.{version[3]}',
|
||||
cook_fn = _git_cook,
|
||||
dependencies = {
|
||||
'SpirVHeaders': {}
|
||||
}
|
||||
)
|
@ -40,6 +40,10 @@ def cook(env: Environment, version) -> dict:
|
||||
git_ref = f'refs/tags/v{version[0]}.{version[1]}.{version[2]}'
|
||||
repo = env.GitBranch(repo_name = _get_repo_name(env), remote_url = _get_repo_url(env), git_ref = git_ref)
|
||||
checkout_root = repo['checkout_root']
|
||||
include_dir = os.path.join(checkout_root, 'include')
|
||||
return {
|
||||
'CPPPATH': [os.path.join(checkout_root, 'include')]
|
||||
'CPPPATH': [include_dir],
|
||||
'CMAKE_VARS': {
|
||||
'Vulkan_INCLUDE_DIR': include_dir
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user