Skip to content

Commit c417008

Browse files
jhuber6yuxuanchen1997
authored andcommitted
[libc] Make the libc files always available to clang for the GPU (#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. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250688
1 parent 012c4b3 commit c417008

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

libc/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ foreach(config_path IN LISTS LIBC_CONFIG_JSON_FILE_LIST)
228228
load_libc_config(${config_path}/config.json ${cmd_line_conf})
229229
endforeach()
230230

231-
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND LIBC_ENABLE_USE_BY_CLANG)
231+
if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND (LIBC_ENABLE_USE_BY_CLANG OR LIBC_TARGET_OS_IS_GPU))
232232
set(LIBC_INCLUDE_DIR ${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE})
233233
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
234234
set(LIBC_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
@@ -244,9 +244,7 @@ else()
244244
set(LIBC_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
245245
endif()
246246
if(LIBC_TARGET_OS_IS_GPU)
247-
if(LLVM_RUNTIMES_TARGET)
248-
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_RUNTIMES_TARGET})
249-
elseif(LIBC_TARGET_TRIPLE)
247+
if(LIBC_TARGET_TRIPLE)
250248
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LIBC_TARGET_TRIPLE})
251249
else()
252250
set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})

0 commit comments

Comments
 (0)