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 @@ -26,6 +26,9 @@ foreach(lib LibcUnitTest LibcHermeticTest) target_include_directories(${lib} PUBLIC ${LIBC_SOURCE_DIR}) + if(LIBC_ENABLE_HERMETIC_TESTS AND NOT LIBC_ENABLE_UNITTESTS) + 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} @@ -37,6 +40,7 @@ ) endforeach() +target_include_directories(LibcHermeticTest PRIVATE ${LIBC_BUILD_DIR}/include) target_compile_options(LibcHermeticTest PRIVATE -ffreestanding -nostdlib -nostdlib++) add_library(