File: 0002-Prefer-shared-library-for-namespaced-target.patch

package info (click to toggle)
libjsoncpp 1.9.6-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,852 kB
  • sloc: cpp: 9,483; python: 1,118; ansic: 215; makefile: 44; sh: 30; perl: 5
file content (29 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Tue, 11 Nov 2025 08:41:55 +0100
Subject: Prefer shared library for namespaced target

Forwarded: not-needed
---
 jsoncpp-namespaced-targets.cmake | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/jsoncpp-namespaced-targets.cmake b/jsoncpp-namespaced-targets.cmake
index 70a79ee..323eeab 100644
--- a/jsoncpp-namespaced-targets.cmake
+++ b/jsoncpp-namespaced-targets.cmake
@@ -1,9 +1,11 @@
 if (NOT TARGET JsonCpp::JsonCpp)
-    if (TARGET jsoncpp_static)
-        add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
-        set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
-    elseif (TARGET jsoncpp_lib)
+    # Prefer shared library over static library.
+    # This diverges from upstream but makes more sense in Debian
+    if (TARGET jsoncpp_lib)
         add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
         set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
+    elseif (TARGET jsoncpp_static)
+        add_library(JsonCpp::JsonCpp INTERFACE IMPORTED)
+        set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
     endif ()
 endif ()