[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 20 18:07:32 PDT 2025


================
@@ -132,6 +124,33 @@ function(link_bc)
   )
 endfunction()
 
+# Create a custom target for each bitcode file, which is the output of a custom
+# command. This is required for parallel compilation of the custom commands that
+# generate the bitcode files when using the CMake MSVC generator on Windows.
+#
+# Arguments:
+#  * compile_tgts
+#      Output list of compile targets
+#  * ARCH_SUFFIX <string>
+#      libclc architecture/triple suffix
+#  * FILES <string> ...
+#     List of bitcode files
+function(create_compile_targets compile_tgts)
+  cmake_parse_arguments( ARG "" "ARCH_SUFFIX" "FILES" ${ARGN} )
----------------
wenju-he wrote:

there is already such check at https://github.com/llvm/llvm-project/blob/8cb6bfe05a26e40dee21d6107655baacc03540a9/libclc/cmake/modules/AddLibclc.cmake#L272-L274, which is before create_compile_targets is called.

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


More information about the cfe-commits mailing list