cmake: Make blockd link against libjson-c
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 28 Mar 2017 00:10:57 +0000 (17:10 -0700)
committerJohn Crispin <john@phrozen.org>
Wed, 29 Mar 2017 07:10:16 +0000 (09:10 +0200)
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

index 08d277f925130b69e136f7273f2231f205bd97ca..a828244db1094c65663a1b2a29c92ca8db06855b 100644 (file)
@@ -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)