[runtimes] Fix not correctly searching target builtins directories (#103311)

Summary:
Enabling `compiler-rt` only worked previously if we had it in the
default target. This is because we didn't extract the path carefully.
This patch fixes that by getting the correct path and appending it,
instead of just the project name.
This commit is contained in:
Joseph Huber 2024-08-13 14:47:08 -05:00 committed by GitHub
parent 1ccd7ab8b6
commit ad6558c334
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,7 +19,12 @@ endforeach()
function(get_compiler_rt_path path)
set(all_runtimes ${runtimes})
foreach(name ${LLVM_RUNTIME_TARGETS})
list(APPEND all_runtimes ${RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES})
foreach(proj ${RUNTIMES_${name}_LLVM_ENABLE_RUNTIMES})
set(proj_dir "${CMAKE_CURRENT_SOURCE_DIR}/../../${proj}")
if(IS_DIRECTORY ${proj_dir} AND EXISTS ${proj_dir}/CMakeLists.txt)
list(APPEND all_runtimes ${proj_dir})
endif()
endforeach()
endforeach()
list(REMOVE_DUPLICATES all_runtimes)
foreach(entry ${all_runtimes})