# create a build target of "wolfssl-jni"
# library is a SHARED  (not STATIC), to be used with JNI
add_library(  wolfssl-jni 
              SHARED 
              jni/jni_fips.c
              jni/jni_native_struct.c
              jni/jni_aes.c
              jni/jni_des3.c
              jni/jni_md5.c
              jni/jni_sha.c
  #            jni/jni_hmac.c
              jni/jni_rng.c
              jni/jni_rsa.c
              jni/jni_dh.c
              jni/jni_ecc.c
              jni/jni_asn.c
              jni/jni_logging.c
              jni/jni_chacha.c
              jni/jni_curve25519.c
              jni/jni_ed25519.c
              jni/jni_error.c )

# add wolfssl library usage, link to the static library
add_library( wolfssl-oem
             STATIC
             IMPORTED )
set_target_properties( wolfssl-oem PROPERTIES IMPORTED_LOCATION
                       "${CMAKE_SOURCE_DIR}/libs/wolfssl-lib/${ANDROID_ABI}/libwolfssl.a")

# .h files are located at ./libs/wolfssl-lib/include
include_directories(  jni/include 
                      ${CMAKE_SOURCE_DIR}/libs/wolfssl-lib/include )

# set(distribution_DIR ${CMAKE_SOURCE_DIR}/dist)

# set_target_properties(  wolfssl-jni
#                         PROPERTIES
#                         ARCHIVE_OUTPUT_DIRECTORY
#                         "${CMAKE_SOURCE_DIR}/dist/wolfssl-jni/${ANDROID_ABI}" )

target_link_libraries( wolfssl-jni wolfssl-oem )