set(PlatformsAndroid_SRCS
        PlatformJNI.hpp
        PlatformJNI.cpp
        ATrace.hpp
        ATrace.cpp
        MediaDecoderJNI.hpp
        MediaDecoderJNI.cpp
        DrmSessionJNI.hpp
        DrmSessionJNI.cpp
        http_jni.hpp
        http_jni.cpp
        AttachThread.hpp
        AttachThread.cpp
        jni_ref.hpp
        jni_ref.cpp
        package.hpp
        package.cpp
        player_jni.hpp
        LogCat.hpp
        LogCat.cpp
        MediaRendererJNI.hpp
        MediaRendererJNI.cpp
        AudioRendererJNI.hpp
        AudioRendererJNI.cpp
        VideoRendererJNI.hpp
        VideoRendererJNI.cpp
        ${PLAYER_LIB_INC}/platform/android/AndroidPlatform.hpp
)
set(PlayerJNI_SRCS
    jni_load.cpp
    player_jni.cpp
)
add_compile_options(-Wno-unused-parameter)
if(STAGING_LIBRARY)
    add_definitions(-DANDROID_PLAYER_PACKAGE="tv/twitch/android/player/staging/")
else()
    add_definitions(-DANDROID_PLAYER_PACKAGE="tv/twitch/android/player/")
endif()
add_library(platform STATIC ${PlatformsAndroid_SRCS})
target_link_libraries(platform
    mediaplayer
    json11
)
target_include_directories(platform PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}
)
set(CMAKE_DEBUG_POSTFIX "")
if(STAGING_LIBRARY)
    set(CMAKE_RELEASE_POSTFIX "_staging")
endif()
add_library(playercore_static STATIC ${PlatformsAndroid_SRCS})
target_link_libraries(playercore_static
    log
    platform
)
target_include_directories(playercore_static PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}
)
set_target_properties(playercore_static PROPERTIES OUTPUT_NAME playercore)
add_library(playercore SHARED ${PlayerJNI_SRCS})
target_link_libraries(playercore
    playercore_static
)
target_include_directories(playercore PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}
)
