[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.
This commit is contained in:
Nick Desaulniers
2024-11-01 15:01:11 -07:00
committed by GitHub
parent e549ec529c
commit acd04c2e18
2 changed files with 42 additions and 45 deletions

View File

@@ -18,7 +18,6 @@ if(LIBC_TARGET_OS_IS_GPU)
endif()
endif()
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(utils)
@@ -26,6 +25,8 @@ 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.

View File

@@ -36,9 +36,6 @@ add_libc_test(
-Wno-gnu-statement-expression-from-macro-expansion
)
# stdbit_test only tests our generated stdbit.h, which is not generated in
# overlay mode.
if(LLVM_LIBC_FULL_BUILD AND libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS)
add_libc_test(
stdbit_test
SUITE
@@ -79,7 +76,6 @@ if(LLVM_LIBC_FULL_BUILD AND libc.include.stdbit IN_LIST TARGET_PUBLIC_HEADERS)
# of the underlying functions which the type generic macros may dispatch
# to.
)
endif()
add_libc_test(
stdckdint_test