diff --git a/libc/test/utils/tools/CMakeLists.txt b/libc/test/utils/tools/CMakeLists.txt --- a/libc/test/utils/tools/CMakeLists.txt +++ b/libc/test/utils/tools/CMakeLists.txt @@ -33,4 +33,10 @@ target_link_libraries(${target_name} PRIVATE LLVMSupport) endfunction() +# Build the gtest library needed for unittests if we do not have it already. +if (EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest AND NOT TARGET llvm_gtest) + include_directories(${LLVM_LIBC_INCLUDE_DIRS}) + add_subdirectory(${LLVM_THIRD_PARTY_DIR}/unittest third-party/unittest) +endif() + add_subdirectory(WrapperGen) diff --git a/libc/test/utils/tools/WrapperGen/CMakeLists.txt b/libc/test/utils/tools/WrapperGen/CMakeLists.txt --- a/libc/test/utils/tools/WrapperGen/CMakeLists.txt +++ b/libc/test/utils/tools/WrapperGen/CMakeLists.txt @@ -4,7 +4,7 @@ wrappergen_test.cpp ARGS --path=${LIBC_SOURCE_DIR} - --tool=${CMAKE_BINARY_DIR}/bin/libc-wrappergen + --tool=${LLVM_BINARY_DIR}/bin/libc-wrappergen --api=${LIBC_SOURCE_DIR}/test/utils/tools/WrapperGen/testapi.td )