[all-commits] [llvm/llvm-project] 647960: [CMake][libclc] Improve dependencies to avoid buil...

Tim Creech via All-commits all-commits at lists.llvm.org
Mon Jun 24 01:51:55 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 64796044f4152c49e4b3c797390a83dcfd33bd46
      https://github.com/llvm/llvm-project/commit/64796044f4152c49e4b3c797390a83dcfd33bd46
  Author: Tim Creech <timothy.m.creech at intel.com>
  Date:   2024-06-24 (Mon, 24 Jun 2024)

  Changed paths:
    M libclc/CMakeLists.txt
    M libclc/cmake/modules/AddLibclc.cmake

  Log Message:
  -----------
  [CMake][libclc] Improve dependencies to avoid build errors (#95018)

With the Makefile generator and particularly high build parallelism some
intermediate dependencies may be generated redundantly and concurrently,
leading to build failures.

To fix this, arrange for libclc's add_custom_commands to depend on
targets in addition to files.

This follows CMake documentation's[^1] guidance on add_custom_command:

> Do not list the output in more than one independent target that may
> build in parallel or the instances of the rule may conflict. Instead,
> use the add_custom_target() command to drive the command and make the
> other targets depend on that one.

Eliminating the redundant commands also improves build times.

[^1]: https://cmake.org/cmake/help/v3.29/command/add_custom_command.html



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list