23 lines
737 B
Python
23 lines
737 B
Python
|
|
from SCons.Script import *
|
|
|
|
def cook(env: Environment, git_ref: str = 'v1.x', use_external_libfmt = False) -> dict:
|
|
repo = env.Cook('GitBranch', repo_name = 'spdlog', remote_url = 'https://github.com/gabime/spdlog.git', git_ref = git_ref)
|
|
checkout_root = repo['checkout_root']
|
|
build_result = env.Cook('CMakeProject', project_root=checkout_root)
|
|
|
|
lib_name = {
|
|
'debug': 'spdlogd'
|
|
}.get(env['BUILD_TYPE'], 'spdlog')
|
|
|
|
cppdefines = ['SPDLOG_COMPILE_LIB=1']
|
|
if use_external_libfmt:
|
|
cppdefines.append('SPDLOG_FMT_EXTERNAL=1')
|
|
|
|
return {
|
|
'LIBPATH': build_result['LIBPATH'],
|
|
'CPPPATH': build_result['CPPPATH'],
|
|
'CPPDEFINES': cppdefines,
|
|
'LIBS': [lib_name]
|
|
}
|