44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
|
|
|
|
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': {}
|
|
}
|
|
)
|