Computing Lyapunov exponents of switching systems