# target sources
add_executable(
    legacy_samples

    conv_sample.cpp
    test_list.cpp
    fp16_emu.cpp
    helpers.cpp
    fusion_sample.cpp
    fp8_sample.cpp
    norm_samples.cpp
    fused_mha_sample.cpp
    f16_flash_mha_sample.cpp
    fp8_flash_mha_sample.cpp
)

# target flags
if(MSVC)
    target_compile_options(
        legacy_samples PRIVATE
        /W4 /WX # warning level 3 and all warnings as errors
        /wd4100 # allow unused parameters
        /wd4458 # local hides class member (currently a problem for all inline setters)
        /wd4505 # unreferenced function with internal linkage has been removed
        /wd4101 /wd4189 # unreferenced local
        /bigobj # increase number of sections in .Obj file
    )
else()
    target_compile_options(
        legacy_samples PRIVATE
        -Wall
        -Wextra
        -Werror
        -Wno-unused-function
    )
endif()

# target links
target_link_libraries(
    legacy_samples PRIVATE
    Threads::Threads
    Catch2::Catch2WithMain
    cudnn_frontend
    _cudnn_frontend_pch
    CUDNN::cudnn

    CUDA::cublasLt
    CUDA::cudart
    CUDA::nvrtc
)

# target cmake properties
set_target_properties(
    legacy_samples PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
)
