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

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 12:47:12 PDT 2024


Author: Joseph Huber
Date: 2024-08-13T14:47:08-05:00
New Revision: ad6558c334e5f6cd4b5c7e6d3ffe8d5158c540b0

URL: https://github.com/llvm/llvm-project/commit/ad6558c334e5f6cd4b5c7e6d3ffe8d5158c540b0
DIFF: https://github.com/llvm/llvm-project/commit/ad6558c334e5f6cd4b5c7e6d3ffe8d5158c540b0.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/runtimes/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 5a4435bc96e0c8..187c44fb9d04d2 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -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})


        


More information about the llvm-commits mailing list