Added cppdap recipe.

This commit is contained in:
Patrick 2025-04-03 16:32:07 +02:00
parent b69c748ae2
commit fb841092a7

29
recipes/cppdap/recipe.py Normal file
View File

@ -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': {}
}
)