[flang] Harmonize standalone gtest support with other projects
authorMichał Górny <mgorny@gentoo.org>
Wed, 23 Nov 2022 15:07:03 +0000 (16:07 +0100)
committerMichał Górny <mgorny@gentoo.org>
Thu, 24 Nov 2022 02:29:15 +0000 (03:29 +0100)
commit02a2e18e60b94b05fe8918aa01f0104ef519bf0f
tree0cb2cb6116cfaf89f8bc3eca59657a128c0b372a
parent12ebfca621059bf6423a8ea0fcf6225dfe8018eb
[flang] Harmonize standalone gtest support with other projects

Use the CMake rules of unittest libraries via `add_subdirectory()`
when using standalone builds, similarly to how e.g. Clang does that.
Besides making things more consistent, I hope this also unblocks D137035
and effectively we'll be able to simplify things further and have LLVM
semi-automatically include gtest support for us in the future.

Differential Revision: https://reviews.llvm.org/D138573
flang/CMakeLists.txt