This follows the same pattern for cuda and rocm to allow disabling the build even when we detect the dependent libraries