Currently there's a large amount of CMake logic duplication for compiling sanitizer tests.
If we add more sanitizers, the duplication will get even worse.
This change factors out common compilation commands into a macro available to all sanitizers.
NB: I haven't figured out how to run msan/xray tests.
There are no ninja check-msan or ninja check-xray commands, which is also inconsistent with lib/tsan/check_cmake.sh.
I'm currently running ninja check-all to test that.
This looks unusual
Can you avoid using ";" and keep style as before?