set(PlatformsWindows_SRCS
    AudioDecoder.cpp
    AudioDecoder.hpp
    AudioRenderer.cpp
    AudioRenderer.hpp
    AudioSample.cpp
    AudioSample.hpp
    CoInitialize.cpp
    CoInitialize.hpp
    EventNames.inl
    HttpClient.cpp
    HttpClient.hpp
    HttpRequest.cpp
    HttpRequest.hpp
    HttpTimer.cpp
    HttpTimer.hpp
    MediaFoundation.cpp
    MediaFoundation.hpp
    MediaSample.cpp
    MediaSample.hpp
    Log.cpp
    Log.hpp
    pch.cpp
    pch.h
    Playercore.cpp
    ${PLAYER_LIB_INC}/platform/windows/PlayerCore.hpp
    Semaphore.cpp
    Semaphore.hpp
    targetver.h
    Transform.cpp
    Transform.hpp
    WindowsPlatform.cpp
    ${PLAYER_LIB_INC}/platform/windows/WindowsPlatform.hpp
    VideoDecoder.cpp
    VideoDecoder.hpp
    VideoRenderer.cpp
    VideoRenderer.hpp
    VideoSample.cpp
    VideoSample.hpp
)

prepend_file_paths("../" Platforms_SRCS)

set(Platforms_SRCS ${Platforms_SRCS} ${PlatformsWindows_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(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})
  target_include_directories(platforms PRIVATE ${PLAYER_LIB_INC})
endif()
