[libclc] [libclc] Use a response file when building on Windows (PR #89756)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 23 05:59:17 PDT 2024


================
@@ -88,10 +88,25 @@ function(link_bc)
     ${ARGN}
   )
 
+  set( LINK_INPUT_ARG ${ARG_INPUTS} )
+  if( WIN32 OR CYGWIN )
+    # Create a response file in case the number of inputs exceeds command-line
+    # character limits on certain platforms.
+    file( TO_CMAKE_PATH ${LIBCLC_ARCH_OBJFILE_DIR}/${ARG_TARGET}.rsp RSP_FILE )
+    # Turn it into a space-separate list of input files
+    list( JOIN ARG_INPUTS " " RSP_INPUT )
+    file( WRITE ${RSP_FILE} ${RSP_INPUT} )
+    # Ensure that if this file is removed, we re-run CMake
+    set_property( DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
+      ${RSP_FILE}
+    )
----------------
arsenm wrote:

rocm device-libs seems to achieve this by using configure_file with a temporary rsp input file 

https://github.com/llvm/llvm-project/pull/89756


More information about the cfe-commits mailing list