diff --git a/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake b/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake --- a/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake +++ b/libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake @@ -5,10 +5,6 @@ # Initialize ALL_CPU_FEATURES as empty list. set(ALL_CPU_FEATURES "") -if(LIBC_TARGET_ARCHITECTURE_IS_GPU) - return() -endif() - if(${LIBC_TARGET_ARCHITECTURE_IS_X86}) set(ALL_CPU_FEATURES SSE2 SSE4_2 AVX AVX2 AVX512F AVX512BW FMA) set(LIBC_COMPILE_OPTIONS_NATIVE -march=native) @@ -48,6 +44,10 @@ set(${output_var} ${tmp} PARENT_SCOPE) endfunction() +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + return() +endif() + set(AVAILABLE_CPU_FEATURES "") if(LIBC_CROSSBUILD) # If we are doing a cross build, we will just assume that all CPU features diff --git a/libc/test/CMakeLists.txt b/libc/test/CMakeLists.txt --- a/libc/test/CMakeLists.txt +++ b/libc/test/CMakeLists.txt @@ -22,7 +22,7 @@ return() endif() -if(NOT LIBC_TARGET_ARCHITECTURE_IS_GPU) +if(NOT LIBC_GPU_TARGET_ARCHITECTURE_IS_NVPTX) add_subdirectory(src) add_subdirectory(utils) endif() diff --git a/libc/test/src/CMakeLists.txt b/libc/test/src/CMakeLists.txt --- a/libc/test/src/CMakeLists.txt +++ b/libc/test/src/CMakeLists.txt @@ -9,7 +9,7 @@ if(MATH_UNITTEST_NEED_MPFR) if(NOT LIBC_TESTS_CAN_USE_MPFR) - message("WARNING: Math test ${name} will be skipped as MPFR library is not available.") + message(VERBOSE "Math test ${name} will be skipped as MPFR library is not available.") return() endif() endif() diff --git a/libc/test/src/__support/CMakeLists.txt b/libc/test/src/__support/CMakeLists.txt --- a/libc/test/src/__support/CMakeLists.txt +++ b/libc/test/src/__support/CMakeLists.txt @@ -1,3 +1,7 @@ +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + return() +endif() + add_custom_target(libc_support_unittests) add_libc_unittest( diff --git a/libc/test/src/errno/CMakeLists.txt b/libc/test/src/errno/CMakeLists.txt --- a/libc/test/src/errno/CMakeLists.txt +++ b/libc/test/src/errno/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT LLVM_LIBC_FULL_BUILD) +if(NOT LLVM_LIBC_FULL_BUILD OR LIBC_TARGET_ARCHITECTURE_IS_GPU) return() endif() diff --git a/libc/test/src/stdio/CMakeLists.txt b/libc/test/src/stdio/CMakeLists.txt --- a/libc/test/src/stdio/CMakeLists.txt +++ b/libc/test/src/stdio/CMakeLists.txt @@ -1,3 +1,7 @@ +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + return() +endif() + add_custom_target(libc_stdio_unittests) add_libc_unittest( diff --git a/libc/test/src/stdlib/CMakeLists.txt b/libc/test/src/stdlib/CMakeLists.txt --- a/libc/test/src/stdlib/CMakeLists.txt +++ b/libc/test/src/stdlib/CMakeLists.txt @@ -1,3 +1,7 @@ +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + return() +endif() + add_custom_target(libc_stdlib_unittests) add_libc_unittest( diff --git a/libc/test/src/string/CMakeLists.txt b/libc/test/src/string/CMakeLists.txt --- a/libc/test/src/string/CMakeLists.txt +++ b/libc/test/src/string/CMakeLists.txt @@ -1,3 +1,7 @@ +if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + return() +endif() + add_custom_target(libc_string_unittests) add_subdirectory(memory_utils)