[libc] Fix wrappergen_test.cpp on runtimes build
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 5 Dec 2022 18:44:54 +0000 (12:44 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Sun, 11 Dec 2022 22:43:06 +0000 (16:43 -0600)
commit1dfb0cd703fe1ada21681283fd75e6aba4b7f216
treecbee4feca580ae311062f7c6d001afdf77116e5d
parentbbcffb08f0fdc0be8c8cba48410f9cb556ea661d
[libc] Fix wrappergen_test.cpp on runtimes build

The `tools` directory depends on `llvm_gtest` which is not immediately
availible with a runtimes build. This patch builds the `llvm_gtest`
target if it isn't present. Additionally, we use the CMake binary
directory to find the tool binary, which is different when using a
runtimes build. Using the LLVM binary directory should match both build
conditions.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D139348
libc/test/utils/tools/CMakeLists.txt
libc/test/utils/tools/WrapperGen/CMakeLists.txt