cmake_minimum_required(VERSION 3.4.1)
enable_language(C ASM)
SET(ASM_OPTIONS "-x assembler-with-cpp")
SET(CMAKE_ASM_FLAGS "${CFLAGS} ${ASM_OPTIONS}" )
#set(BOOST_ROOT C:/lib/boost_1_63_0S)
set(BOOST_ROOT C:/lib/boost_1_62_0)

add_library(hello-jni SHARED
            hello-jni.cpp
            boostTest.cpp
            ${BOOST_ROOT}/libs/system/src/error_code.cpp

            ${BOOST_ROOT}/libs/context/src/execution_context.cpp
            ${BOOST_ROOT}/libs/context/src/posix/stack_traits.cpp

            ${BOOST_ROOT}/libs/context/src/asm/jump_i386_sysv_elf_gas.S
            ${BOOST_ROOT}/libs/context/src/asm/make_i386_sysv_elf_gas.S
            ${BOOST_ROOT}/libs/context/src/asm/ontop_i386_sysv_elf_gas.S

            ${BOOST_ROOT}/libs/thread/src/pthread/once.cpp
            ${BOOST_ROOT}/libs/thread/src/pthread/thread.cpp

            )

# Include libraries needed for hello-jni lib
target_link_libraries(hello-jni
                      android
                      log)

include_directories(${BOOST_ROOT})

target_compile_options(hello-jni PRIVATE
    -fexceptions
    -std=c++14
    -DBOOST_NO_TYPEID
    -DBOOST_EXECUTION_CONTEXT=1
    -fno-rtti
)

set_target_properties(hello-jni PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")

