import re from SCons.Script import * def _git_cook(env: Environment, repo: dict, options: dict) -> dict: implot_source_files = [ os.path.join(repo['checkout_root'], 'implot.cpp'), os.path.join(repo['checkout_root'], 'implot_items.cpp') ] lib_implot = env.StaticLibrary( CPPPATH = [repo['checkout_root']], target = env['LIB_DIR'] + '/implot', source = implot_source_files, dependencies = { 'imgui': {} } ) return { 'CPPPATH': [repo['checkout_root']], 'LIBS': [lib_implot] } env.GitRecipe( globals = globals(), repo_name = 'implot', repo_url = 'https://github.com/epezent/implot.git', tag_pattern = re.compile(r'^v([0-9]+)\.([0-9]+)$'), tag_fn = lambda version: f'v{version[0]}.{version[1]}', cook_fn = _git_cook, dependencies = { 'imgui': {} } )