diff --git a/recipes/spdlog/recipe.py b/recipes/spdlog/recipe.py new file mode 100644 index 0000000..0f5c50f --- /dev/null +++ b/recipes/spdlog/recipe.py @@ -0,0 +1,16 @@ + +from SCons.Script import * + +def cook(env: Environment, git_ref: str = 'v1.x') -> 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') + return { + 'LIBPATH': build_result['LIBPATH'], + 'CPPPATH': build_result['CPPPATH'], + 'LIBS': [lib_name] + }