From 34b2bc1e5bebc076a8acb179d4112b32c175d19f Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Fri, 26 Jul 2024 23:29:45 +0200 Subject: [PATCH] Added missing define and use_external_libfmt option to spdlog recipe. --- recipes/spdlog/recipe.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes/spdlog/recipe.py b/recipes/spdlog/recipe.py index 0f5c50f..fdedb18 100644 --- a/recipes/spdlog/recipe.py +++ b/recipes/spdlog/recipe.py @@ -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] }