Subject: [PATCH 2/4] gnu: spdlog: Build with '-fpic'.

From: John Kehayias <[email-masked]>
Date: Tue, 04 Jan 2022 22:24:33 +0000

Empty Message

From 79f30cf17e88ca50fd8444f1ad34ceb795b1d255 Mon Sep 17 00:00:00 2001
From: John Kehayias <[email-masked]>
Date: Tue, 4 Jan 2022 16:41:48 -0500
Subject: [PATCH 2/4] gnu: spdlog: Build with '-fpic'.

* gnu/packages/logging.scm (spdlog)[arguments]: Add "-DCMAKE_CXX_FLAGS=-fpic"
to #:configure-flags.
---
 gnu/packages/logging.scm | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/logging.scm b/gnu/packages/logging.scm
index be144e2daa..3c8f67b3ce 100644
--- a/gnu/packages/logging.scm
+++ b/gnu/packages/logging.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2019 Meiyo Peng <[email-masked]>
 ;;; Copyright © 2020 Marius Bakke <[email-masked]>
 ;;; Copyright © 2021 Guillaume Le Vaillant <[email-masked]>
+;;; Copyright © 2022 John Kehayias <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -207,7 +208,11 @@ (define-public spdlog
     ;; (gnu packages benchmark) forms a dependency cycle
     (arguments
      '(#:configure-flags
-       (list "-DSPDLOG_BUILD_BENCH=OFF"
+       ;; Typically this library is meant to be compiled statically, see
+       ;; https://github.com/gabime/spdlog/wiki/How-to-use-spdlog-in-DLLs
+       ;; So build with -fpic to allow linking in shared libraries.
+       (list "-DCMAKE_CXX_FLAGS=-fpic"
+             "-DSPDLOG_BUILD_BENCH=OFF"
              "-DSPDLOG_BUILD_TESTS=ON")))
     (home-page "https://github.com/gabime/spdlog")
     (synopsis "Fast C++ logging library")
-- 
2.34.0