summaryrefslogtreecommitdiffstats
path: root/lib/src
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 /lib/src
parent8a4273ffe83b46bc018da58135427d40012282b8 (diff)
[HICN-195] Generate static libs for android
Change-Id: Ib78e0ba5108713c6fac0e422eb7bb6f7ba10abc7 Signed-off-by: Angelo Mantellini <manangel@cisco.com>
Diffstat (limited to 'lib/src')
-rw-r--r--lib/src/CMakeLists.txt34
1 files changed, 23 insertions, 11 deletions
diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt
index d7c39831a..29fc5d865 100644
--- a/lib/src/CMakeLists.txt
+++ b/lib/src/CMakeLists.txt
@@ -55,17 +55,29 @@ set (COMPILER_DEFINITIONS "-DWITH_MAPME -DWITH_MAPME_FIXES")
include(BuildMacros)
include(WindowsMacros)
-build_library(${LIBHICN}
- SHARED STATIC
- SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL}
- COMPONENT lib${LIBHICN}
- INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..
- DEFINITIONS ${COMPILER_DEFINITIONS}
- INSTALL_ROOT_DIR hicn
- INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL}
- LINK_LIBRARIES ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY}
-)
-
+if (ANDROID_API)
+ build_library(${LIBHICN}
+ STATIC
+ SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL}
+ COMPONENT lib${LIBHICN}
+ INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ INSTALL_ROOT_DIR hicn
+ INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL}
+ LINK_LIBRARIES ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY}
+ )
+else ()
+ build_library(${LIBHICN}
+ SHARED STATIC
+ SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL}
+ COMPONENT lib${LIBHICN}
+ INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/..
+ DEFINITIONS ${COMPILER_DEFINITIONS}
+ INSTALL_ROOT_DIR hicn
+ INSTALL_HEADERS ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL}
+ LINK_LIBRARIES ${WSOCK32_LIBRARY} ${WS2_32_LIBRARY}
+ )
+endif ()
add_custom_command(TARGET hicn PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_BINARY_DIR}/hicn
)