diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt --- a/libc/include/CMakeLists.txt +++ b/libc/include/CMakeLists.txt @@ -511,6 +511,11 @@ endif() file(RELATIVE_PATH relative_path ${LIBC_INCLUDE_BINARY_DIR} ${header_file}) get_filename_component(nested_dir ${relative_path} DIRECTORY) + # The GPU headers are installed to 'gpu-none-llvm/' to prevent shadowing the + # system headers. + if(LIBC_TARGET_ARCHITECTURE_IS_GPU) + set(nested_dir gpu-none-llvm/${nested_dir}) + endif() install(FILES ${header_file} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${nested_dir} COMPONENT libc-headers)