set(CMAKE_CXX_STANDARD 20)

include(gtest)

# Helper function to create a gtest executable with common properties
function(add_ck_builder_test test_name)
    add_executable(${test_name} ${ARGN})
    target_include_directories(${test_name} PRIVATE
        "${PROJECT_SOURCE_DIR}/experimental/builder/include"
        "${PROJECT_SOURCE_DIR}/include"
    )
    target_compile_options(${test_name} PRIVATE
        -Wno-global-constructors
        -Wno-c++20-compat
        -Wno-error=missing-include-dirs
    )
    target_link_libraries(${test_name} PRIVATE GTest::gtest GTest::gtest_main GTest::gmock)
endfunction()

add_ck_builder_test(test_conv_builder
    test_conv_builder.cpp
    test_conv_description.cpp
    test_conv_grp_fwd_2d.cpp
    test_conv_grp_fwd_3d.cpp
    test_conv_grp_bwd_2d.cpp
    test_conv_fwd_instances.cpp
    test_conv_bwd_instances.cpp
    testing_utils.cpp)

add_ck_builder_test(test_builder_utils test_builder_utils.cpp)