Added common recipe for building CMake projects. And added Catch2 recipe.
This commit is contained in:
21
recipes/Catch2/recipe.py
Normal file
21
recipes/Catch2/recipe.py
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
from SCons.Script import *
|
||||
|
||||
def cook(env: Environment, git_ref: str = 'master', own_main: bool = False) -> dict:
|
||||
repo = env.Cook('GitBranch', repo_name = 'catch2', remote_url = 'https://github.com/catchorg/Catch2.git', git_ref = git_ref)
|
||||
checkout_root = repo['checkout_root']
|
||||
build_result = env.Cook('CMakeProject', project_root=checkout_root)
|
||||
|
||||
lib_name = {
|
||||
'debug': 'Catch2d'
|
||||
}.get(env['BUILD_TYPE'], 'Catch2')
|
||||
libs = [lib_name]
|
||||
if not own_main:
|
||||
libs.append({
|
||||
'debug': 'Catch2Maind'
|
||||
}.get(env['BUILD_TYPE'], 'Catch2Main'))
|
||||
return {
|
||||
'LIBPATH': build_result['LIBPATH'],
|
||||
'CPPPATH': build_result['CPPPATH'],
|
||||
'LIBS': libs
|
||||
}
|
||||
Reference in New Issue
Block a user