Skip to contentSkip to conversation

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

PATCH Superseded Philip Balister 2 participants 2 messages Nov 17, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb +5 -1
index 7d28fff5e..c5227a5e9 100644
@@ -12,10 +12,14 @@ 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
 
+do_configure_append() {
+	sed -i 's|// #define SPDLOG_FMT_EXTERNAL|#define SPDLOG_FMT_EXTERNAL|' ${S}/include/spdlog/tweakme.h
+}
+
 # Header-only library
 RDEPENDS_${PN}-dev = ""
 RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
Signature · 1 line
2.13.6
#1 lore raw
Quoted 18 lines · Philip Balister

* 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.

---
 meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb +0 -0
index 7d28fff5e..c5227a5e9 100644
@@ -12,10 +12,14 @@ S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native"

meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb S = "${WORKDIR}/git" · line 22

Quoted 10 lines
meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb +5 -1
 # 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
 
+do_configure_append() {
+       sed -i 's|// #define SPDLOG_FMT_EXTERNAL|#define SPDLOG_FMT_EXTERNAL|' ${S}/include/spdlog/tweakme.h
+}
+

This should be a static patch instead

Quoted 9 lines
meta-oe/recipes-support/spdlog/spdlog_1.8.1.bb +0 -1
 # Header-only library
 RDEPENDS_${PN}-dev = ""
 RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
--

2.13.6