Update to new recipe system (S++ 2.0).
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
|
||||
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
def cook(env: Environment, git_ref: str = "master") -> dict:
|
||||
repo = env.GitBranch(repo_name = 'yaml-cpp', remote_url = 'https://github.com/jbeder/yaml-cpp', git_ref = git_ref)
|
||||
|
||||
def _git_cook(env: Environment, repo: dict) -> dict:
|
||||
checkout_root = repo['checkout_root']
|
||||
build_result = env.CMakeProject(project_root=checkout_root)
|
||||
lib_name = {
|
||||
'debug': 'yaml-cppd'
|
||||
}.get(env['BUILD_TYPE'], 'yaml-cpp')
|
||||
return {
|
||||
'LIBPATH': build_result['LIBPATH'],
|
||||
'CPPPATH': build_result['CPPPATH'],
|
||||
'LIBS': [lib_name]
|
||||
'LIBS': [env.FindLib(lib_name, paths=build_result['LIBPATH'])]
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'yaml-cpp',
|
||||
repo_url = 'https://github.com/jbeder/yaml-cpp',
|
||||
tag_pattern = re.compile(r'^yaml-cpp-([0-9]+)\.([0-9]+)\.([0-9]+)$'),
|
||||
tag_fn = lambda version: f'yaml-cpp-{version[0]}.{version[1]}.{version[2]}',
|
||||
cook_fn = _git_cook
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user