set(inc "inc")
set(privdeps gfx sfx net)

if(PS1_BUILD)
    set(src "ps1/src/init.c")
    set(inc ${inc} "ps1/inc")
    set(privdeps ${privdeps} PSXSDK::PSXSDK)
elseif(SDL1_2_BUILD)
    set(src "sdl-1.2/src/system.c")
    set(inc ${inc} "sdl-1.2/inc")
    set(privinc ${privinc} "sdl-1.2/privinc")
    set(privdeps ${privdeps} SDL::SDL)
    set(privdefs ${privdefs} "PROJECT_NAME=\"${PROJECT_NAME}\"")

    if(WIN9X_BUILD)
        set(src ${src} "win9x/src/system.c")
    else()
        set(src ${src} "sdl-1.2/src/stubs.c")
    endif()
elseif(ESP32_BUILD)
    set(src "esp32/src/system.c")
    set(inc ${inc} "esp32/inc")
    set(privinc ${privinc} "esp32/privinc")
    set(privdeps ${privdeps} Geekbit::Geekbit)
endif()

add_library(system ${src})
target_include_directories(system PUBLIC ${inc} PRIVATE ${privinc})
target_link_libraries(system PRIVATE ${privdeps})
target_compile_definitions(system PRIVATE ${privdefs})
