[PATCH] D135578: [CMake] Add option LLVM_FORCE_CREATE_SYMLINKS

Tobias Hieta via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 00:22:52 PDT 2022


thieta updated this revision to Diff 466713.
thieta added a comment.

Changed the option to LLVM_USE_SYMLINKS


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135578/new/

https://reviews.llvm.org/D135578

Files:
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -2081,6 +2081,11 @@
   endif()
 endfunction()
 
+# By default we use symlinks on Unix platforms and copy binaries on Windows
+# If you have the correct setup on Windows you can use this option to enable
+# symlinks and save a lot of diskspace.
+option(LLVM_USE_SYMLINKS ${CMAKE_HOST_UNIX} "Use symlinks instead of copying binaries")
+
 function(llvm_add_tool_symlink project link_name target)
   cmake_parse_arguments(ARG "ALWAYS_GENERATE" "OUTPUT_DIR" "" ${ARGN})
 
@@ -2101,7 +2106,7 @@
   if(NOT ARG_OUTPUT_DIR)
     # If you're not overriding the OUTPUT_DIR, we can make the link relative in
     # the same directory.
-    if(CMAKE_HOST_UNIX)
+    if(LLVM_USE_SYMLINKS)
       set(dest_binary "$<TARGET_FILE_NAME:${target}>")
     endif()
     if(CMAKE_CONFIGURATION_TYPES)
@@ -2127,7 +2132,7 @@
     endif()
   endif()
 
-  if(CMAKE_HOST_UNIX)
+  if(LLVM_USE_SYMLINKS)
     set(LLVM_LINK_OR_COPY create_symlink)
   else()
     set(LLVM_LINK_OR_COPY copy)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135578.466713.patch
Type: text/x-patch
Size: 1146 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221011/3a762e2a/attachment.bin>


More information about the llvm-commits mailing list