Only test benchmark tools if benchmarking is enabled
There are two reasons to do this:
- Benchmark optimization barriers use nonstandard constructs which, although widely portable, are not portable to every C++ compiler. The only known example is that MSVC doesn't like them. That was part of the rationale for putting benchmarks behind their own CMake flag, but this measure unfortunately falls apart if benchmarks come back through the unit test backdoor.
- Benchmark tools use
std::is_invokable_v
in a way which triggers an LLVM 7.0 bug, and that breaks the builds of all of our Mac users who haven't upgraded to XCode 11 yet. We don't want to introduce code workarounds for old compilers, but requesting a compiler upgrade just because of this component is arguably a bit much when it isn't even used.
Edited by Hadrien Benjamin Grasland