[libc-commits] [PATCH] D149216: [libc] Add path to include generated headers for hermetic tests

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Apr 26 04:33:35 PDT 2023


jhuber6 updated this revision to Diff 517122.
jhuber6 added a comment.

Update


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149216/new/

https://reviews.llvm.org/D149216

Files:
  libc/test/UnitTest/CMakeLists.txt


Index: libc/test/UnitTest/CMakeLists.txt
===================================================================
--- libc/test/UnitTest/CMakeLists.txt
+++ libc/test/UnitTest/CMakeLists.txt
@@ -26,6 +26,10 @@
 
 foreach(lib LibcUnitTest LibcHermeticTest)
   target_include_directories(${lib} PUBLIC ${LIBC_SOURCE_DIR})
+  if(LLVM_LIBC_FULL_BUILD)
+    # If we are in full build mode, then we should use our own public headers.
+    target_include_directories(${lib} PRIVATE ${LIBC_BUILD_DIR}/include)
+  endif()
   target_compile_options(${lib} PRIVATE ${LIBC_HERMETIC_TEST_COMPILE_OPTIONS}
                          -fno-exceptions -fno-rtti)
   add_dependencies(${lib}
@@ -44,6 +48,11 @@
   LibcTestMain.cpp
 )
 
+if(LLVM_LIBC_FULL_BUILD)
+  target_include_directories(LibcTestMain PRIVATE ${LIBC_BUILD_DIR}/include)
+  target_compile_options(LibcTestMain PRIVATE ${LIBC_HERMETIC_TEST_COMPILE_OPTIONS}
+                         -fno-exceptions -fno-rtti)
+endif()
 target_include_directories(LibcTestMain PUBLIC ${LIBC_SOURCE_DIR})
 target_compile_options(LibcTestMain PRIVATE -fno-exceptions -fno-rtti)
 add_dependencies(LibcTestMain LibcUnitTest)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149216.517122.patch
Type: text/x-patch
Size: 1146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230426/624456a6/attachment-0001.bin>


More information about the libc-commits mailing list