private function findTargetCompiler($target, $mode): CompilationTarget
    {
        /** @var CompilationTarget $targetCompiler */
        foreach ($this->compilationTargets as $targetCompiler) {
            if ($targetCompiler->supports($target, $mode)) {
                return $targetCompiler;
            }
        }

        throw new TargetUnsupportedException('The given target is not supported.');
    }