spdlog: Fix recipe so other recipes can use spdlog with external fmt.

* I enabled the shared library option to eliminate linker issues
   with a package that used spdlog.
 * Edited the tweak.h file so programs use the external fmt library
   headers, not the oners in spdlog.

Signed-off-by: Philip Balister <philip@opensdr.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Philip Balister 2020-12-03 15:24:48 -05:00 committed by Khem Raj
parent ca5977699e
commit 010cd128e7
2 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,26 @@
From 23ce2fe30e7485d48e2864bdd8276119fbb8cbd1 Mon Sep 17 00:00:00 2001
From: Philip Balister <philip@balister.org>
Date: Thu, 3 Dec 2020 09:22:50 -0500
Subject: [PATCH] Enable use of external fmt library.
Signed-off-by: Philip Balister <philip@balister.org>
---
include/spdlog/tweakme.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/spdlog/tweakme.h b/include/spdlog/tweakme.h
index 244bc3b3..2594a6fe 100644
--- a/include/spdlog/tweakme.h
+++ b/include/spdlog/tweakme.h
@@ -63,7 +63,7 @@
// In this case spdlog will try to include <fmt/format.h> so set your -I flag
// accordingly.
//
-// #define SPDLOG_FMT_EXTERNAL
+#define SPDLOG_FMT_EXTERNAL
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
--
2.28.0

View File

@ -4,7 +4,8 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRCREV = "cbe9448650176797739dbab13961ef4c07f4290f"
SRC_URI = "git://github.com/gabime/spdlog.git;protocol=git;branch=v1.x;"
SRC_URI = "git://github.com/gabime/spdlog.git;protocol=git;branch=v1.x; \
file://0001-Enable-use-of-external-fmt-library.patch"
DEPENDS += "fmt"
@ -12,7 +13,7 @@ S = "${WORKDIR}/git"
BBCLASSEXTEND = "native"
# no need to build example&text&benchmarks on pure yocto
EXTRA_OECMAKE += "-DSPDLOG_INSTALL=on -DSPDLOG_BUILD_EXAMPLES=off -DSPDLOG_BUILD_TESTS=off -DSPDLOG_BUILD_BENCH=off -DSPDLOG_FMT_EXTERNAL=on"
EXTRA_OECMAKE += "-DSPDLOG_INSTALL=on -DSPDLOG_BUILD_SHARED=on -DSPDLOG_BUILD_EXAMPLES=off -DSPDLOG_BUILD_TESTS=off -DSPDLOG_BUILD_BENCH=off -DSPDLOG_FMT_EXTERNAL=on"
inherit cmake