[libc-commits] [libc] [libc] Make the libc files always available to clang for the GPU (PR #100396)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Wed Jul 24 07:47:01 PDT 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/100396
Summary:
The GPU build always wants these to be exported to `clang`. These will
be neccesary for setting up tests or using the `libc` from the clang
binary. This will cover the standard 'runtimes' build. If the user is
doing a direct compilation, we will just leave it as-is and assume they
know what they're doing.
>From 210b0b2c0961b9b56b6c46b418f0d1ba26647681 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Wed, 24 Jul 2024 09:43:38 -0500
Subject: [PATCH] [libc] Make the libc files always available to clang for the
GPU
Summary:
The GPU build always wants these to be exported to `clang`. These will
be neccesary for setting up tests or using the `libc` from the clang
binary. This will cover the standard 'runtimes' build. If the user is
doing a direct compilation, we will just leave it as-is and assume they
know what they're doing.
---
libc/CMakeLists.txt | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 6e0760724d963..1ce3bdf53b525 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -228,7 +228,7 @@ foreach(config_path IN LISTS LIBC_CONFIG_JSON_FILE_LIST)
load_libc_config(${config_path}/config.json ${cmd_line_conf})
endforeach()
-if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND LIBC_ENABLE_USE_BY_CLANG)
+if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND (LIBC_ENABLE_USE_BY_CLANG OR LIBC_TARGET_OS_IS_GPU))
set(LIBC_INCLUDE_DIR ${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE})
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
set(LIBC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
@@ -244,9 +244,7 @@ else()
set(LIBC_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
endif()
if(LIBC_TARGET_OS_IS_GPU)
- if(LLVM_RUNTIMES_TARGET)
- set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_RUNTIMES_TARGET})
- elseif(LIBC_TARGET_TRIPLE)
+ if(LIBC_TARGET_TRIPLE)
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LIBC_TARGET_TRIPLE})
else()
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
More information about the libc-commits
mailing list