llvm-project/libc/test/CMakeLists.txt
Nick Desaulniers acd04c2e18
[libc][cmake] disable include tests in overlay mode (#114566)
This avoids -Wmacro-redefinition diagnostics observed when building the
libc_include_tests ninja target.

For example, the signbit_test will attempt to include BOTH our math-macros.h
(via math-function-macros.h), and the system's math.h (via hdr/math_macros.h).

While it's nice that we can get some coverage of the headers we will provide to
end users of fullbuilds in CI of overlay builds, it's not worth chasing each
individual conflict and disabling some include tests as conflicts arise.

Disable the include tests unless `-DLLVM_LIBC_FULL_BUILD=ON` is specified.
2024-11-01 15:01:11 -07:00

38 lines
944 B
CMake

add_custom_target(check-libc)
add_custom_target(libc-unit-tests)
add_custom_target(libc-hermetic-tests)
add_dependencies(check-libc libc-unit-tests libc-hermetic-tests)
add_custom_target(exhaustive-check-libc)
add_custom_target(libc-long-running-tests)
add_subdirectory(UnitTest)
if(LIBC_TARGET_OS_IS_GPU)
if(NOT TARGET libc.utils.gpu.loader)
message(WARNING "Cannot build libc GPU tests, missing loader.")
return()
elseif(LIBC_GPU_TESTS_DISABLED)
message(WARNING "Cannot build libc GPU tests, missing target architecture.")
return()
endif()
endif()
add_subdirectory(src)
add_subdirectory(utils)
if(NOT LLVM_LIBC_FULL_BUILD)
return()
endif()
add_subdirectory(include)
if(NOT ${LIBC_TARGET_OS} STREQUAL "linux" AND
NOT ${LIBC_TARGET_OS} STREQUAL "gpu")
# Integration tests are currently only available for linux and the GPU.
return()
endif()
add_subdirectory(IntegrationTest)
add_subdirectory(integration)