clang-tidy: use TemporaryDirectory

This patch changes clang-tidy build of cmake and meson to use
TemporaryDirectory. So that no need to explicitly delete the build
directory. There is no need to hardcode the name as well. I kept the
prefix of the temp folder to be "build". This is to make gitignore of
most repos still work.

Tested:
1. used phosphor-user-manager as a typical meson repo. Tested
   with/without clang-tidy. Both worked
2. used peci-pcie as a typical CMakeList repo. Tested with/without
   clang-tidy. Both worked (but the repo itself doesn't pass clang build
   bacause of its own reason)

Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Ic355e390db7349ded73ad3d17a03a40b83460249
1 file changed