summaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorAngelo Mantellini <manangel@cisco.com>2019-05-14 16:05:53 +0200
committerAngelo Mantellini <manangel@cisco.com>2019-05-16 13:48:23 +0200
commit5c9b2cd16e76b7d731bd31422b4a555dbeff1541 (patch)
tree1ab57c1e0eb10374879803ef9aee36724ad875ef /libtransport
parent8a4273ffe83b46bc018da58135427d40012282b8 (diff)
[HICN-195] Generate static libs for android
Change-Id: Ib78e0ba5108713c6fac0e422eb7bb6f7ba10abc7 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/CMakeLists.txt19
-rw-r--r--libtransport/src/hicn/transport/CMakeLists.txt37
2 files changed, 38 insertions, 18 deletions
diff --git a/libtransport/CMakeLists.txt b/libtransport/CMakeLists.txt
index 757521574..d70a837b9 100644
--- a/libtransport/CMakeLists.txt
+++ b/libtransport/CMakeLists.txt
@@ -82,11 +82,18 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
endif()
set(LIBTRANSPORT hicntransport)
else()
- set(HICN_LIBRARIES ${LIBHICN_SHARED})
- list(APPEND DEPENDENCIES
- ${LIBHICN}
- ${LIBHICN_SHARED}
- )
+ if (ANDROID_API)
+ set(HICN_LIBRARIES ${LIBHICN})
+ list(APPEND DEPENDENCIES
+ ${LIBHICN}
+ )
+ else ()
+ set(HICN_LIBRARIES ${LIBHICN_SHARED})
+ list(APPEND DEPENDENCIES
+ ${LIBHICN}
+ ${LIBHICN_SHARED}
+ )
+ endif ()
if (__vpp__)
list(APPEND DEPENDENCIES
@@ -108,7 +115,7 @@ if (${COMPILE_TESTS})
endif()
if(ANDROID_API)
-find_package(OpenSSL REQUIRED)
+ find_package(OpenSSL REQUIRED)
endif ()
list(APPEND LIBRARIES
diff --git a/libtransport/src/hicn/transport/CMakeLists.txt b/libtransport/src/hicn/transport/CMakeLists.txt
index 4c0982c58..b6be3f77a 100644
--- a/libtransport/src/hicn/transport/CMakeLists.txt
+++ b/libtransport/src/hicn/transport/CMakeLists.txt
@@ -48,18 +48,31 @@ endif ()
if (ANDROID_API)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -isystem -lm")
endif()
-
-build_library(${LIBTRANSPORT}
- STATIC SHARED
- SOURCES ${SOURCE_FILES} ${HEADER_FILES}
- INSTALL_HEADERS ${HEADER_FILES}
- LINK_LIBRARIES ${LIBRARIES}
- DEPENDS ${DEPENDENCIES}
- COMPONENT lib${LIBTRANSPORT}
- INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS}
- INSTALL_ROOT_DIR hicn/transport
- DEFINITIONS ${COMPILER_DEFINITIONS}
-)
+if (ANDROID_API)
+ build_library(${LIBTRANSPORT}
+ STATIC
+ SOURCES ${SOURCE_FILES} ${HEADER_FILES}
+ INSTALL_HEADERS ${HEADER_FILES}
+ LINK_LIBRARIES ${LIBRARIES}
+ DEPENDS ${DEPENDENCIES}
+ COMPONENT lib${LIBTRANSPORT}
+ INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS}
+ INSTALL_ROOT_DIR hicn/transport
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ )
+else ()
+ build_library(${LIBTRANSPORT}
+ STATIC SHARED
+ SOURCES ${SOURCE_FILES} ${HEADER_FILES}
+ INSTALL_HEADERS ${HEADER_FILES}
+ LINK_LIBRARIES ${LIBRARIES}
+ DEPENDS ${DEPENDENCIES}
+ COMPONENT lib${LIBTRANSPORT}
+ INCLUDE_DIRS ${LIBTRANSPORT_INCLUDE_DIRS}
+ INSTALL_ROOT_DIR hicn/transport
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ )
+endif ()
if (${COMPILE_TESTS})
add_subdirectory(core/test)