Added missing define and use_external_libfmt option to spdlog recipe.

This commit is contained in:
Patrick 2024-07-26 23:29:45 +02:00
parent 28c0feb619
commit 34b2bc1e5b

View File

@ -1,7 +1,7 @@
from SCons.Script import *
def cook(env: Environment, git_ref: str = 'v1.x') -> dict:
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)
@ -9,8 +9,14 @@ def cook(env: Environment, git_ref: str = 'v1.x') -> dict:
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]
}