[libc-commits] [PATCH] D142374: [libc][NFC] Reduce CMake configuration time

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jan 23 08:55:10 PST 2023


gchatelet created this revision.
gchatelet added a reviewer: sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
gchatelet requested review of this revision.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142374

Files:
  libc/cmake/modules/LLVMLibCLibraryRules.cmake


Index: libc/cmake/modules/LLVMLibCLibraryRules.cmake
===================================================================
--- libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -12,6 +12,7 @@
       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 @@
       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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142374.491404.patch
Type: text/x-patch
Size: 707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230123/aa72d3bd/attachment.bin>


More information about the libc-commits mailing list