[libc-commits] [libc] fcef706 - [libc][NFC] Reduce CMake configuration time

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Mon Jan 23 09:02:42 PST 2023


Author: Guillaume Chatelet
Date: 2023-01-23T17:02:27Z
New Revision: fcef7063631e91e038c16952f47e4e97de1444e5

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

LOG: [libc][NFC] Reduce CMake configuration time

This patch reduces CMake configuration time drastically by removing a non-linear behavior.
Time to execute CMake configure step goes from 45s to 15s.

Differential Revision: https://reviews.llvm.org/D142374

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCLibraryRules.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index ba5ac33b1e7a4..279e15b82fa3f 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -12,6 +12,7 @@ function(collect_object_file_deps target result)
       collect_object_file_deps(${dep} dep_targets)
       list(APPEND all_deps ${dep_targets})
     endforeach(dep)
+    list(REMOVE_DUPLICATES all_deps)
     set(${result} ${all_deps} PARENT_SCOPE)
     return()
   endif()
@@ -33,6 +34,7 @@ function(collect_object_file_deps target result)
       collect_object_file_deps(${dep} dep_targets)
       list(APPEND all_deps ${dep_targets})
     endforeach(dep)
+    list(REMOVE_DUPLICATES all_deps)
     set(${result} ${all_deps} PARENT_SCOPE)
     return()
   endif()


        


More information about the libc-commits mailing list