From fb841092a79a998ded8cecd28accf01c0b207b52 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Thu, 3 Apr 2025 16:32:07 +0200 Subject: [PATCH] Added cppdap recipe. --- recipes/cppdap/recipe.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 recipes/cppdap/recipe.py diff --git a/recipes/cppdap/recipe.py b/recipes/cppdap/recipe.py new file mode 100644 index 0000000..4d3f071 --- /dev/null +++ b/recipes/cppdap/recipe.py @@ -0,0 +1,29 @@ + + +import re +from SCons.Script import * + + +def _git_cook(env: Environment, repo: dict) -> dict: + lib_json = env.Cook('json') + checkout_root = repo['checkout_root'] + build_result = env.CMakeProject(checkout_root, generate_args=['-DCPPDAP_USE_EXTERNAL_NLOHMANN_JSON_PACKAGE=ON'], dependencies = [lib_json]) + + lib_name = 'cppdap' + return { + 'CPPPATH': build_result['CPPPATH'], + 'LIBS': [env.FindLib(lib_name, paths=build_result['LIBPATH'])] + } + + +env.GitRecipe( + globals = globals(), + repo_name = 'cppdap', + repo_url = 'https://github.com/google/cppdap.git', + tag_pattern = re.compile(r'^([0-9]+)\.([0-9]+)\.([0-9]+)$'), # cppdap doesn't have any (recent) version tags, so this is kind of useless anyway' + tag_fn = lambda version: f'{version[0]}.{version[1]}.{version[2]}', + cook_fn = _git_cook, + dependencies = { + 'json': {} + } +)