cmake_minimum_required(VERSION 3.22)
project(starfox_streamline_probe LANGUAGES CXX)
if(NOT WIN32)
    message(FATAL_ERROR "This isolated Streamline capability probe requires Windows")
endif()
set(STREAMLINE_SDK "" CACHE PATH "User-approved official Streamline SDK directory")
if(NOT EXISTS "${STREAMLINE_SDK}/include/sl_security.h")
    message(FATAL_ERROR "Set STREAMLINE_SDK to the extracted official SDK; nothing is downloaded automatically")
endif()
add_executable(starfox_streamline_probe main.cpp evaluate.cpp)
add_library(starfox_dlss_native SHARED native_evaluator.cpp native_lifecycle.cpp)
set_property(TARGET starfox_dlss_native PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
target_link_libraries(starfox_dlss_native PRIVATE wintrust)
target_compile_features(starfox_dlss_native PRIVATE cxx_std_20)
target_include_directories(starfox_dlss_native PRIVATE ../../include "${STREAMLINE_SDK}/include")
target_compile_definitions(starfox_dlss_native PRIVATE NOMINMAX STARFOX_DLSS_EXPORTS)
target_include_directories(starfox_streamline_probe PRIVATE ../../include)
target_link_libraries(starfox_streamline_probe PRIVATE starfox_dlss_native)
target_compile_features(starfox_streamline_probe PRIVATE cxx_std_20)
target_include_directories(starfox_streamline_probe SYSTEM PRIVATE "${STREAMLINE_SDK}/include")
target_compile_definitions(starfox_streamline_probe PRIVATE NOMINMAX)
target_link_libraries(starfox_streamline_probe PRIVATE dxgi d3d12 wintrust user32)
if(NOT MSVC)
    message(FATAL_ERROR "Use MSVC with the Windows SDK: the supplied NVIDIA signature helper requires its WinTrust declarations")
endif()
