Compare commits
2 Commits
3261eb75d5
...
fb841092a7
Author | SHA1 | Date | |
---|---|---|---|
fb841092a7 | |||
b69c748ae2 |
29
recipes/cppdap/recipe.py
Normal file
29
recipes/cppdap/recipe.py
Normal 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': {}
|
||||||
|
}
|
||||||
|
)
|
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
from SCons.Script import *
|
from SCons.Script import *
|
||||||
|
|
||||||
@ -8,7 +9,8 @@ def _git_cook(env: Environment, repo: dict) -> dict:
|
|||||||
checkout_root = repo['checkout_root']
|
checkout_root = repo['checkout_root']
|
||||||
build_result = env.CMakeProject(project_root=checkout_root)
|
build_result = env.CMakeProject(project_root=checkout_root)
|
||||||
return {
|
return {
|
||||||
'CPPPATH': build_result['CPPPATH']
|
'CPPPATH': build_result['CPPPATH'],
|
||||||
|
'CMAKE_PREFIX_PATH': [build_result['install_dir']]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user