function(SetupVulkan TARGET)
    if (APPLE)
        find_package(MoltenVK REQUIRED)
        target_link_libraries(${TARGET} PRIVATE ${MoltenVK_LIBRARIES})
    else ()
        find_package(Vulkan REQUIRED)
        target_link_libraries(${TARGET} PRIVATE Vulkan::Vulkan)
        if (OPENVULKANO_ENABLE_SHADERC)
            find_package(Vulkan OPTIONAL_COMPONENTS shaderc_combined)
            if (Vulkan_shaderc_combined_FOUND)
                target_link_libraries(${TARGET} PRIVATE Vulkan::shaderc_combined)
                target_compile_definitions(${TARGET} PRIVATE HAS_SHADERC)
            endif ()
        endif ()
    endif ()
    target_include_directories(${TARGET} PUBLIC ${Vulkan_INCLUDE_DIR})

    if (ANDROID)
        add_definitions(-DVK_USE_PLATFORM_ANDROID_KHR)
    elseif (WIN32)
        add_definitions(-DVK_USE_PLATFORM_WIN32_KHR)
    elseif (LINUX)
        add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
        find_package(XCB REQUIRED)
        target_link_libraries(${TARGET} PRIVATE ${XCB_LIBRARIES})
    endif()
endfunction()

