22 lines
		
	
	
		
			717 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			717 B
		
	
	
	
		
			Python
		
	
	
	
	
	
 | 
						|
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
 | 
						|
    }
 |