set(PlatformsPS4_SRCS
    AdditionalContent.cpp
    AdditionalContent.hpp
    AudioClock.cpp
    AudioClock.hpp
    AudioDecoder.cpp
    AudioDecoder.hpp
    AudioOutputStream.cpp
    AudioRenderer.cpp
    AudioRenderer.hpp
    AudioSample.cpp
    AudioSample.hpp
    AudioResampler.hpp
    AudioResampler.cpp
    AudioSystem.cpp
    AudioSystem.hpp
    FrameBufferPool.cpp
    FrameBufferPool.hpp
    Http.cpp
    Http.hpp
    Net.cpp
    Net.hpp
    Playercore.cpp
    PS4Errors.inl
    PS4Platform.cpp
    ProcessClock.cpp
    ProcessClock.hpp
    ResourceLoader.hpp
    RingBuffer.cpp
    RingBuffer.hpp
    Stream.hpp
    VideoDecoder.cpp
    VideoDecoder.hpp
    VideoFrame.cpp
    VideoFrame.hpp
    VideoFrameBuffer.cpp
    VideoFrameBuffer.hpp
    VideoRenderer.cpp
    VideoRenderer.hpp
    VideoSample.cpp
    VideoSample.hpp
    ${PLAYER_LIB_INC}/platform/ps4/Configuration.hpp
    ${PLAYER_LIB_INC}/platform/ps4/PlayerCore.hpp
    ${PLAYER_LIB_INC}/platform/ps4/PS4Platform.hpp
    ${PLAYER_LIB_INC}/platform/ps4/VideoFrame.hpp
)

if (ENABLE_PLATFORM_CONCURRENCY_PRIMITIVES)
    set(PlatformsPS4_SRCS ${PlatformsPS4_SRCS} Concurrency.cpp Concurrency.hpp)
endif()

prepend_file_paths("../" Platforms_SRCS)

set(Platforms_SRCS ${Platforms_SRCS} ${PlatformsPS4_SRCS})

set(Platforms_Libraries
    SceAppContent_stub_weak
    SceAudiodec_stub_weak
    SceAudioOut_stub_weak
    SceHttp_stub_weak
    SceNet_stub_weak
    ScePosix_stub_weak
    SceSsl_stub_weak
    SceSysmodule_stub_weak
    SceVideodec2_stub_weak
)

add_submodule(platforms
  SOURCES
    ${Platforms_SRCS}
  LINK_LIBRARIES
    json11
    mediaplayer
    ${Platforms_Libraries}
)

if(BUILD_UNIFIED_LIB)
  target_include_directories(platforms_obj SYSTEM PRIVATE ${PS4_SDK_INCLUDE_DIR})
  target_include_directories(platforms_obj PRIVATE ${PLAYER_LIB_INC})
  set_target_properties(platforms_obj PROPERTIES LINKER_LANGUAGE CXX)
else()
endif()

target_include_directories(platforms SYSTEM PRIVATE ${PS4_SDK_INCLUDE_DIR})
target_include_directories(platforms PRIVATE ${PLAYER_LIB_INC})
set_target_properties(platforms PROPERTIES LINKER_LANGUAGE CXX)

target_include_directories(platforms PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
