[libc-commits] [PATCH] D139348: [libc] Fix wrappergen_test.cpp on runtimes build
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Dec 5 10:49:04 PST 2022
jhuber6 created this revision.
jhuber6 added reviewers: sivachandra, lntue, michaelrj.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139348
Files:
libc/test/utils/tools/CMakeLists.txt
libc/test/utils/tools/WrapperGen/CMakeLists.txt
Index: libc/test/utils/tools/WrapperGen/CMakeLists.txt
===================================================================
--- libc/test/utils/tools/WrapperGen/CMakeLists.txt
+++ 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
)
Index: libc/test/utils/tools/CMakeLists.txt
===================================================================
--- libc/test/utils/tools/CMakeLists.txt
+++ 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139348.480161.patch
Type: text/x-patch
Size: 1094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20221205/34fc0056/attachment.bin>
More information about the libc-commits
mailing list