diff --git a/libc/test/UnitTest/CMakeLists.txt b/libc/test/UnitTest/CMakeLists.txt --- a/libc/test/UnitTest/CMakeLists.txt +++ b/libc/test/UnitTest/CMakeLists.txt @@ -24,8 +24,12 @@ HermeticTestUtils.cpp ) -foreach(lib LibcUnitTest LibcHermeticTest) +foreach(lib LibcUnitTest LibcHermeticTest LibcTestMain) 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}