With this patch:
- FLANG_BUILD_NEW_DRIVER is set to On by default (i.e. the new driver is enabled)
- Clang is automatically added to the list of dependencies.
By setting FLANG_BUILD_NEW_DRIVER to Off, the new driver will be
disabled and Clang will be removed from the list of dependencies.
I tried implementing this logic in Flang's top CMake script, but that's
too late for updating LLVM_ENABLE_PROJECTS (which is used to
enable/disable Clang).
Could you move the option into the if ("flang" IN_LIST LLVM_ENABLE_PROJECTS) condition so at least it does not appear unless flang is enabled?