17 lines
598 B
Python
17 lines
598 B
Python
|
|
from SCons.Script import *
|
|
|
|
def cook(env: Environment, git_ref: str = "main") -> dict:
|
|
repo = env.Cook('GitBranch', repo_name = 'SDL', remote_url = 'https://github.com/libsdl-org/SDL.git', git_ref = git_ref)
|
|
checkout_root = repo['checkout_root']
|
|
build_result = env.Cook('CMakeProject', project_root=checkout_root, generate_args = ['-DSDL_STATIC=ON', '-DSDL_SHARED=OFF'])
|
|
lib_name = {
|
|
'debug': 'SDL2d'
|
|
}.get(env['BUILD_TYPE'], 'SDL2')
|
|
return {
|
|
'LIBPATH': build_result['LIBPATH'],
|
|
'CPPPATH': build_result['CPPPATH'],
|
|
'LIBS': [lib_name]
|
|
}
|
|
|