diff mbox

[LEDE-DEV,fstools] cmake: Make blockd link against libjson-c

Message ID 20170328001057.12124-1-f.fainelli@gmail.com
State Accepted
Delegated to: John Crispin
Headers show

Commit Message

Florian Fainelli March 28, 2017, 12:10 a.m. UTC
Similar to commit 35aa20c51995 ("cmake: Link against libjson-c"), blockd
uses libblob_msg which needs libjson-c.

Fixes: 98bbb5a068d6 ("blockd: add automounting support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

David Lang March 28, 2017, 12:14 a.m. UTC | #1
Just a note in case you were not aware, json-c is not thread-safe (the rsyslog 
project forked it to libfastjson to fix the thread safety and drastically 
improve speed)

On Mon, 27 Mar 2017, Florian Fainelli wrote:

> Date: Mon, 27 Mar 2017 17:10:57 -0700
> From: Florian Fainelli <f.fainelli@gmail.com>
> To: lede-dev@lists.infradead.org
> Cc: Florian Fainelli <f.fainelli@gmail.com>, john@phrozen.org
> Subject: [LEDE-DEV] [PATCH fstools] cmake: Make blockd link against libjson-c
> 
> Similar to commit 35aa20c51995 ("cmake: Link against libjson-c"), blockd
> uses libblob_msg which needs libjson-c.
>
> Fixes: 98bbb5a068d6 ("blockd: add automounting support")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> CMakeLists.txt | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 08d277f92513..a828244db109 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -54,12 +54,12 @@ ADD_EXECUTABLE(mount_root mount_root.c)
> TARGET_LINK_LIBRARIES(mount_root fstools)
> INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
>
> +find_library(json NAMES json-c json)
> +
> ADD_EXECUTABLE(blockd blockd.c)
> -TARGET_LINK_LIBRARIES(blockd fstools ubus blobmsg_json)
> +TARGET_LINK_LIBRARIES(blockd fstools ubus blobmsg_json ${json})
> INSTALL(TARGETS blockd RUNTIME DESTINATION sbin)
>
> -find_library(json NAMES json-c json)
> -
> ADD_EXECUTABLE(block block.c probe.c probe-libblkid.c)
> IF(DEFINED CMAKE_UBIFS_EXTROOT)
> 	ADD_DEFINITIONS(-DUBIFS_EXTROOT)
>
diff mbox

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08d277f92513..a828244db109 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,12 +54,12 @@  ADD_EXECUTABLE(mount_root mount_root.c)
 TARGET_LINK_LIBRARIES(mount_root fstools)
 INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin)
 
+find_library(json NAMES json-c json)
+
 ADD_EXECUTABLE(blockd blockd.c)
-TARGET_LINK_LIBRARIES(blockd fstools ubus blobmsg_json)
+TARGET_LINK_LIBRARIES(blockd fstools ubus blobmsg_json ${json})
 INSTALL(TARGETS blockd RUNTIME DESTINATION sbin)
 
-find_library(json NAMES json-c json)
-
 ADD_EXECUTABLE(block block.c probe.c probe-libblkid.c)
 IF(DEFINED CMAKE_UBIFS_EXTROOT)
 	ADD_DEFINITIONS(-DUBIFS_EXTROOT)