[llvm] [cmake] Serialize native builds for Make generator (PR #121021)

Chris B via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 16:41:23 PST 2025


================
@@ -9,7 +9,11 @@ function(llvm_ExternalProject_BuildCmd out_var target bin_dir)
   endif()
   if (CMAKE_GENERATOR MATCHES "Make")
     # Use special command for Makefiles to support parallelism.
-    set(${out_var} "$(MAKE)" "-C" "${bin_dir}" "${target}" PARENT_SCOPE)
+    set(make_cmd "$(MAKE)" "-C" "${bin_dir}" "${target}")
+    set(file_lock_script "${LLVM_CMAKE_DIR}/FileLock.cmake")
+    set(${out_var} ${CMAKE_COMMAND} "-DLOCK_FILE_PATH=${bin_dir}/cmake.lock"
----------------
llvm-beanz wrote:

I would make `llvm_ExternalProject_BuildCmd` take in an extra argument for the `STAMP_DIR` and put the lock into the stamp dir instead of the bin dir. That avoids any conflicts with files that could be generated during the external project (heaven forbid someone adds a `cmake.lock` file to LLVM's build process).

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


More information about the llvm-commits mailing list