diff --git a/recipes/imgui-node-editor/recipe.py b/recipes/imgui-node-editor/recipe.py new file mode 100644 index 0000000..f5c99a3 --- /dev/null +++ b/recipes/imgui-node-editor/recipe.py @@ -0,0 +1,46 @@ + + +import re +from SCons.Script import * + + +def _git_cook(env: Environment, repo: dict) -> dict: + ine_source_files = [ + os.path.join(repo['checkout_root'], 'crude_json.cpp'), + os.path.join(repo['checkout_root'], 'imgui_canvas.cpp'), + os.path.join(repo['checkout_root'], 'imgui_node_editor.cpp'), + os.path.join(repo['checkout_root'], 'imgui_node_editor_api.cpp') + ] + + + ccflags = list(env['CCFLAGS']) + if env['COMPILER_FAMILY'] == 'cl': + ccflags.append('/wd4100') + lib_ine = env.StaticLibrary( + CPPPATH = [repo['checkout_root']], + CCFLAGS = ccflags, + target = env['LIB_DIR'] + '/imgui_node_editor', + source = ine_source_files, + dependencies = { + 'imgui': { + 'min': (1, 72, 0) + } + } + ) + return { + 'CPPPATH': [repo['checkout_root']], + 'LIBS': [lib_ine] + } + + +env.GitRecipe( + globals = globals(), + repo_name = 'imgui-node-editor', + repo_url = 'https://github.com/thedmd/imgui-node-editor.git', + tag_pattern = re.compile(r'^v([0-9]+)\.([0-9]+)\.([0-9]+)$'), + tag_fn = lambda version: f'v{version[0]}.{version[1]}.{version[2]}', + cook_fn = _git_cook, + dependencies = { + 'imgui': {} + } +)