set(PlatformsUwp_SRCS
    ../windows/AudioDecoder.cpp
    ../windows/AudioDecoder.hpp
    AudioRenderer.cpp
    AudioRenderer.hpp
    ../windows/AudioSample.cpp
    ../windows/AudioSample.hpp
    ../windows/CoInitialize.cpp
    ../windows/CoInitialize.hpp
    HttpClient.cpp
    HttpClient.hpp
    HttpRequest.cpp
    HttpRequest.hpp
    ../windows/HttpTimer.cpp
    ../windows/HttpTimer.hpp
    ../windows/Log.cpp
    ../windows/Log.hpp
    ../windows/MediaFoundation.cpp
    ../windows/MediaFoundation.hpp
    ../windows/MediaSample.cpp
    ../windows/MediaSample.hpp
    ../windows/pch.cpp
    ../windows/pch.h
    ../windows/PlayerCore.cpp
    ${PLAYER_LIB_INC}/platform/windows/PlayerCore.hpp
    ../windows/Semaphore.cpp
    ../windows/Semaphore.hpp
    StringUtil.cpp
    StringUtil.hpp
    ../windows/VideoDecoder.cpp
    ../windows/VideoDecoder.hpp
    ../windows/VideoRenderer.cpp
    ../windows/VideoRenderer.hpp
    ../windows/VideoSample.cpp
    ../windows/VideoSample.hpp
    ../windows/WindowsPlatform.cpp
    ${PLAYER_LIB_INC}/platform/windows/WindowsPlatform.hpp
    XAudioBuffer.cpp
    XAudioBuffer.hpp
    XAudioMonitor.cpp
    XAudioMonitor.hpp
    XMasterVoice.cpp
    XMasterVoice.hpp
    XSourceVoice.cpp
    XSourceVoice.hpp
    XVoiceCallback.cpp
    XVoiceCallback.hpp
)

prepend_file_paths("../" Platforms_SRCS)

set(Platforms_SRCS ${Platforms_SRCS} ${PlatformsUwp_SRCS})

# https://msdn.microsoft.com/en-us/library/windows/desktop/ee663600(v=vs.85).aspx
set(Platforms_Libraries
    d2d1.lib
    d3d11.lib
    windowscodecs.lib
    dwrite.lib
    evr.lib
    mf.lib
    mfplat.lib
    mfplay.lib
    mfreadwrite.lib
    mfuuid.lib
)

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

set_target_properties(platforms_obj PROPERTIES COMPILE_FLAGS "/Yupch.h")
set_source_files_properties(../windows/pch.cpp PROPERTIES COMPILE_FLAGS "/Ycpch.h")

# FIXME(CVP-1663): platforms should link the mediaplayer library to transitively
#   include its headers and add it as a dependency
if(BUILD_UNIFIED_LIB)
  add_dependencies(platforms_obj mediaplayer)
  target_include_directories(platforms_obj PRIVATE ${PLAYER_LIB_INC} ../windows)
  target_include_directories(platforms PRIVATE ${PLAYER_LIB_INC} ../windows)
endif()
