X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffstools.git;a=blobdiff_plain;f=CMakeLists.txt;h=04d9470e32ac7a4b44e5386a744a72bdd82f8572;hp=a6002e5fe9e0b2a390d59d38ce75b8cffeaa8122;hb=a19f2b3c212888734c007e9f57b4e3c470620594;hpb=0f4571b9e484f3b3504b872afd3a11be98571c03 diff --git a/CMakeLists.txt b/CMakeLists.txt index a6002e5..04d9470 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 2.6) PROJECT(fs-tools C) -ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations) +ADD_DEFINITIONS(-Os -ggdb -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-error=format-truncation) SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") @@ -13,6 +13,7 @@ ADD_LIBRARY(fstools SHARED libfstools/mtd.c libfstools/mount.c libfstools/ubi.c + libfstools/rootdisk.c libfstools/find.c) TARGET_LINK_LIBRARIES(fstools ubox) INSTALL(TARGETS fstools LIBRARY DESTINATION lib) @@ -38,6 +39,9 @@ ADD_LIBRARY(ubi-utils STATIC libubi/ubiutils-common.c) INSTALL(TARGETS ubi-utils ARCHIVE DESTINATION lib) +FIND_PATH(ubox_include_dir libubox/ulog.h) +INCLUDE_DIRECTORIES(${ubox_include_dir}) + SET_TARGET_PROPERTIES(ubi-utils PROPERTIES COMPILE_FLAGS "-ffunction-sections -fdata-sections") @@ -50,12 +54,18 @@ ADD_EXECUTABLE(mount_root mount_root.c) TARGET_LINK_LIBRARIES(mount_root fstools) INSTALL(TARGETS mount_root RUNTIME DESTINATION sbin) -ADD_EXECUTABLE(block block.c) +find_library(json NAMES json-c json) + +ADD_EXECUTABLE(blockd blockd.c) +TARGET_LINK_LIBRARIES(blockd fstools ubus blobmsg_json ${json}) +INSTALL(TARGETS blockd RUNTIME DESTINATION sbin) + +ADD_EXECUTABLE(block block.c probe.c probe-libblkid.c) IF(DEFINED CMAKE_UBIFS_EXTROOT) ADD_DEFINITIONS(-DUBIFS_EXTROOT) - TARGET_LINK_LIBRARIES(block blkid-tiny uci ubox blobmsg_json ubi-utils) + TARGET_LINK_LIBRARIES(block blkid-tiny dl uci ubox ubus blobmsg_json ubi-utils ${json}) ELSE(DEFINED CMAKE_UBIFS_EXTROOT) - TARGET_LINK_LIBRARIES(block blkid-tiny uci ubox blobmsg_json) + TARGET_LINK_LIBRARIES(block blkid-tiny dl uci ubox ubus blobmsg_json ${json}) ENDIF(DEFINED CMAKE_UBIFS_EXTROOT) INSTALL(TARGETS block RUNTIME DESTINATION sbin)