cmake_minimum_required(VERSION 3.22)
project(MahoyoSteamAndroidPort LANGUAGES CXX)
include(CTest)
add_subdirectory(runtime)
if(BUILD_TESTING)
    file(GLOB RUNTIME_TESTS CONFIGURE_DEPENDS tests/*_tests.cpp)
    foreach(source IN LISTS RUNTIME_TESTS)
        get_filename_component(name "${source}" NAME_WE)
        if(name STREQUAL "vm_tests")
            continue() # runtime/vm registers this test.
        endif()
        add_executable(mahoyo_${name} "${source}")
        target_link_libraries(mahoyo_${name} PRIVATE woh_runtime)
        if(NOT name STREQUAL "asset_codecs_tests")
            add_test(NAME mahoyo_${name} COMMAND mahoyo_${name})
        endif()
    endforeach()
endif()
