diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-11-22 11:55:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-11-22 11:55:46 +0000 |
commit | 4d593c09d9cc1496788f7953de25832193064103 (patch) | |
tree | f066cb1cc2d5910ed1f84613f652e27bf6fc7a6c /ctrl/libhicnctrl/src/CMakeLists.txt | |
parent | 7efe8c9372615d0333d1aa045de5d0c4a171a978 (diff) | |
parent | 4eb89ea4dcad4c01664b5331745f4e9a38facbd2 (diff) |
Merge "[HICN-394] Add route commands add, list, del for the hicn-plugin"
Diffstat (limited to 'ctrl/libhicnctrl/src/CMakeLists.txt')
-rw-r--r-- | ctrl/libhicnctrl/src/CMakeLists.txt | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/ctrl/libhicnctrl/src/CMakeLists.txt b/ctrl/libhicnctrl/src/CMakeLists.txt index ea63217dd..14c204dda 100644 --- a/ctrl/libhicnctrl/src/CMakeLists.txt +++ b/ctrl/libhicnctrl/src/CMakeLists.txt @@ -26,11 +26,22 @@ set(UTIL_HEADER_FILES ) set(SOURCE_FILES - api.c face.c route.c ) +if(BUILD_CTRL_HICNPLUGIN) + set(SOURCE_FILES + ${SOURCE_FILES} + hicn_plugin_api.c + ) +else () + set(SOURCE_FILES + ${SOURCE_FILES} + api.c + ) +endif() + set(LIBRARIES m ${HICN_LIBRARIES} @@ -42,43 +53,37 @@ set(INCLUDE_DIRS ${HICN_INCLUDE_DIRS} ) +# Android requires static libraries if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - set(HICN_LIBRARIES ${LIBHICN_STATIC} log) - build_library(${LIBHICNCTRL} - STATIC - SOURCES ${SOURCE_FILES} - INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES} - LINK_LIBRARIES ${LIBRARIES} - DEPENDS ${LIBHICN_STATIC} - COMPONENT ${LIBHICNCTRL_COMPONENT} - DEPENDS ${LIBHICN_STATIC} - INCLUDE_DIRS ${INCLUDE_DIRS} - INSTALL_ROOT_DIR hicn - DEFINITIONS ${COMPILER_DEFINITIONS} - ) + set(LIBRARIES ${LIBRARIES} ${LIBHICN_STATIC}) + set(LINK_TYPE STATIC) else () - build_library(${LIBHICNCTRL} - SHARED STATIC - SOURCES ${SOURCE_FILES} - INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES} - LINK_LIBRARIES ${LIBRARIES} - DEPENDS ${LIBHICN_SHARED} - COMPONENT ${LIBHICNCTRL_COMPONENT} - DEPENDS ${LIBHICN_SHARED} - INCLUDE_DIRS ${INCLUDE_DIRS} - INSTALL_ROOT_DIR hicn - DEFINITIONS ${COMPILER_DEFINITIONS} - ) + set(LINK_TYPE SHARED STATIC) endif () +build_library(${LIBHICNCTRL} + ${LINK_TYPE} + SOURCES ${SOURCE_FILES} + INSTALL_HEADERS ${TO_INSTALL_HEADER_FILES} + LINK_LIBRARIES ${LIBRARIES} + DEPENDS ${DEPENDENCIES} + COMPONENT ${LIBHICNCTRL_COMPONENT} + INCLUDE_DIRS ${INCLUDE_DIRS} + INSTALL_ROOT_DIR hicn + DEFINITIONS ${COMPILER_DEFINITIONS} +) + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Android" AND NOT COMPILE_FOR_IOS) + set(LIBRARIES ${LIBRARIES} ${LIBHICN_SHARED} ${LIBHICNCTRL_SHARED}) + list(APPEND DAEMON_SRC cli.c ) + build_executable(${HICNCTRL} SOURCES ${DAEMON_SRC} - LINK_LIBRARIES ${LIBHICNCTRL_SHARED} ${LIBHICN_SHARED} - DEPENDS ${LIBHICNCTRL_SHARED} ${LIBHICN_SHARED} + LINK_LIBRARIES ${LIBRARIES} + DEPENDS ${LIBHICNCTRL_SHARED} COMPONENT ${LIBHICNCTRL_COMPONENT} INCLUDE_DIRS ${INCLUDE_DIRS} DEFINITIONS ${COMPILER_DEFINITIONS} |