[OpenWrt-Devel] [PATCH] uqmi: Added CMake option BUILD_STATIC for a static uqmi build
John Crispin
blogic at openwrt.org
Wed Sep 9 03:58:55 EDT 2015
On 09/09/2015 09:35, Bachtin, Dmitri wrote:
> Signed-off-by: Dmitri Bachtin <dbachtin at init-ka.de>
Hi,
it is always nice if a patch has a short description that goes beyond
the subject. in this case it would be nice if you could explain why you
need to build a static version of uqmi
John
> ---
> CMakeLists.txt | 16 ++++++++++++++--
> 1 files changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 3f67652..4a11544 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -1,14 +1,26 @@
> cmake_minimum_required(VERSION 2.6)
>
> PROJECT(uqmi C)
> +
> +OPTION(BUILD_STATIC OFF)
> +
> ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-enum-conversion)
>
> SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
>
> SET(SOURCES main.c dev.c commands.c qmi-message.c)
>
> -FIND_LIBRARY(json json-c json)
> -SET(LIBS ubox blobmsg_json ${json})
> +IF(BUILD_STATIC)
> + FIND_LIBRARY(json NAMES libjson.a libjson-c.a)
> + FIND_LIBRARY(blobmsg_json NAMES libblobmsg_json.a)
> + FIND_LIBRARY(ubox NAMES libubox.a)
> +ELSE(BUILD_STATIC)
> + FIND_LIBRARY(json NAMES json-c json)
> + FIND_LIBRARY(blobmsg_json NAMES blobmsg_json)
> + FIND_LIBRARY(ubox NAMES ubox)
> +ENDIF(BUILD_STATIC)
> +
> +SET(LIBS ${ubox} ${blobmsg_json} ${json})
>
> IF(DEBUG_PACKET)
> ADD_DEFINITIONS(-DDEBUG_PACKET)
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list