From patchwork Fri Jul 1 21:56:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 643289 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rh9HF3nyZz9sCY for ; Sat, 2 Jul 2016 07:56:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=WrV4n0tK; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4CEC3B9207F; Fri, 1 Jul 2016 23:56:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Fri, 1 Jul 2016 23:56:47 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D871AB92073 for ; Fri, 1 Jul 2016 23:56:44 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .gmail. - helo: .mail-pa0-f68.google. - helo-domain: .google.) FROM/MX_MATCHES_HELO(DOMAIN)=-2; rate: -7 Received: from mail-pa0-f68.google.com (mail-pa0-f68.google.com [209.85.220.68]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 1 Jul 2016 23:56:43 +0200 (CEST) Received: by mail-pa0-f68.google.com with SMTP id us13so10552943pab.1 for ; Fri, 01 Jul 2016 14:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=n3n5ZO8QJSwClLEywbcvBo4dmA1ct2jOPdHo+ozEN3s=; b=WrV4n0tK32akCA2nLa9A9uFiPjw9gARM5y/E0Tgc7jfAuO7fPIv5SlmwmRwB6qnD3m HuJFT+T5BpMIG6N5Rl6PmHQ4BXUGSwkGW828DeUslYJ5s+M5br+jCF1AcEzqrvQzVHc6 ZFwGOSjXUnONAYICq8U/WHt77rmO7WKBpBrhlzAXhCC0O5j0LaAAt6gsx0Q2PdkKDIVg 9/DVBETiRzvpfzt1kBA/x8Aea5gT70b+4MWnksJFiM7p/vT4D5HRgYRRTlelg916nTns FRlUmoYJugCkzGX2jzPij62L5ceNBJl2JddqMW8+W/5mRgZfAmwffLm0dCc6gQPFwU88 imiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=n3n5ZO8QJSwClLEywbcvBo4dmA1ct2jOPdHo+ozEN3s=; b=e6h64UudFXexjktxAsJJ4xQM7gd67I4u1k6v2YjnT7hWLkY/Ca3af7XuIw5MOZQJT8 R1g9V9LfAJgJ9X2L3KiQNoIEy/Y+8ozxIq0i8gf4sxfVX9+XOSKjlTZO9OAWLbQJOLIh Pu2oJA+oiZbjSXOAQXeI5DXylj+Lo5w1cw3zlVdXrb48NFB6bDGIHE+R7Li848StNrWT NoFJ67eDlkTelHC4JzS14R+s31SEBkR8NM4vMrpLiCziHuuYELCSuOE6o1CoVuv6dOYM tMBvYnqrs+2BAPeE4u7jMAFHvRG9ZoRYV6+8JLDNySWteoiQjmDWlTfStnySahXsfb/u CHwg== X-Gm-Message-State: ALyK8tLRGKbCzyWEfdiR7jibrZJ+f03unDfwvk7QtQ/tjvsS9VlrAsFBWZ/zA2f0CZCZOQ== X-Received: by 10.66.76.226 with SMTP id n2mr759904paw.17.1467410201682; Fri, 01 Jul 2016 14:56:41 -0700 (PDT) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by smtp.gmail.com with ESMTPSA id b186sm190195pfa.61.2016.07.01.14.56.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jul 2016 14:56:40 -0700 (PDT) From: Florian Fainelli To: lede-dev@lede-project.org Date: Fri, 1 Jul 2016 14:56:38 -0700 Message-Id: <1467410198-24118-1-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 2.7.4 Subject: [OpenWrt-Devel] [PATCH ubus] cmake: Fix find_library for ubusd and examples/server X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: openwrt-devel@lists.openwrt.org MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Both ubusd and cli TARGET_LINK_LIBRARIES reference ${json} which is obtained via find_library(), but since the find_library() is searched after the TARGET_LINK_LIBRARIES for ubusd, ubusd always gets an empty ${json} variable. examples/server also links against libjson-c, but we were not setting TARGET_LINK_LIBRARIES accordingly, so do that too with ${json} appended. This was causing linking errors for ubusd and then examples/server using an external toolchain (stbgcc-4.8-1.x). Fixes: 9f52d1769b762 ("cli: use the new json-c library name") Signed-off-by: Florian Fainelli --- CMakeLists.txt | 3 ++- examples/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70a0de6536d9..7123096a0f93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,10 +32,11 @@ INCLUDE_DIRECTORIES(${ubox_include_dir}) ADD_LIBRARY(ubus SHARED libubus.c libubus-io.c libubus-obj.c libubus-sub.c libubus-req.c libubus-acl.c) TARGET_LINK_LIBRARIES(ubus ${ubox_library}) +find_library(json NAMES json-c json) + ADD_EXECUTABLE(ubusd ubusd.c ubusd_id.c ubusd_obj.c ubusd_proto.c ubusd_event.c ubusd_acl.c ubusd_monitor.c) TARGET_LINK_LIBRARIES(ubusd ${ubox_library} ${blob_library} ${json}) -find_library(json NAMES json-c json) ADD_EXECUTABLE(cli cli.c) SET_TARGET_PROPERTIES(cli PROPERTIES OUTPUT_NAME ubus) TARGET_LINK_LIBRARIES(cli ubus ${ubox_library} ${blob_library} ${json}) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 006dac42a27c..81f999752950 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..) IF (BUILD_EXAMPLES) ADD_EXECUTABLE(server server.c count.c) - TARGET_LINK_LIBRARIES(server ubus ${ubox_library} ${blob_library}) + TARGET_LINK_LIBRARIES(server ubus ${ubox_library} ${blob_library} ${json}) ADD_EXECUTABLE(client client.c count.c) TARGET_LINK_LIBRARIES(client ubus ${ubox_library})