Update to new recipe system (S++ 2.0).
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
|
||||
import re
|
||||
from SCons.Script import *
|
||||
|
||||
def cook(env: Environment, git_ref: str = 'master', own_main: bool = False) -> dict:
|
||||
repo = env.GitBranch(repo_name = 'catch2', remote_url = 'https://github.com/catchorg/Catch2.git', git_ref = git_ref)
|
||||
def _git_cook(env: Environment, repo) -> dict:
|
||||
checkout_root = repo['checkout_root']
|
||||
build_result = env.CMakeProject(project_root=checkout_root)
|
||||
|
||||
@@ -10,12 +10,21 @@ def cook(env: Environment, git_ref: str = 'master', own_main: bool = False) -> d
|
||||
'debug': 'Catch2d'
|
||||
}.get(env['BUILD_TYPE'], 'Catch2')
|
||||
libs = [lib_name]
|
||||
if not own_main:
|
||||
if not env.get('CATCH2_OWN_MAIN'):
|
||||
libs.append({
|
||||
'debug': 'Catch2Maind'
|
||||
}.get(env['BUILD_TYPE'], 'Catch2Main'))
|
||||
return {
|
||||
'LIBPATH': build_result['LIBPATH'],
|
||||
'CPPPATH': build_result['CPPPATH'],
|
||||
'LIBS': libs
|
||||
'LIBS': [env.FindLib(lib, paths=build_result['LIBPATH']) for lib in libs]
|
||||
}
|
||||
|
||||
|
||||
env.GitRecipe(
|
||||
globals = globals(),
|
||||
repo_name = 'Catch2',
|
||||
repo_url = 'https://github.com/catchorg/Catch2.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
|
||||
)
|
||||
Reference in New Issue
Block a user