This is an archive of the discontinued LLVM Phabricator instance.

[DeviceRTL] Fix incremental build
ClosedPublic

Authored by ye-luo on Oct 27 2022, 7:48 PM.

Details

Summary

Need both add_custom_command to resolve file-level dependency and add_custom_target to resolve target-level dependency.
From CMake add_custom_command doc:
Do not list the output in more than one independent target that may build in parallel or the two 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).

${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} is used by multiple targets and thus requires a custom target to avoid racing.

Diff Detail

Event Timeline

ye-luo created this revision.Oct 27 2022, 7:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 7:48 PM
ye-luo requested review of this revision.Oct 27 2022, 7:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2022, 7:48 PM
jhuber6 added inline comments.Oct 27 2022, 8:00 PM
openmp/libomptarget/DeviceRTL/CMakeLists.txt
230

Should this be EXTRACT_TOOL?

jhuber6 accepted this revision.Oct 27 2022, 8:05 PM

LG if the previous comment is addressed, thanks for fixing this.

This revision is now accepted and ready to land.Oct 27 2022, 8:05 PM
ye-luo added inline comments.Oct 27 2022, 8:18 PM
openmp/libomptarget/DeviceRTL/CMakeLists.txt
230

Good catch. Will fix it.

ye-luo updated this revision to Diff 471384.Oct 27 2022, 8:30 PM

Fix EXTRACT_TOOL

This revision was automatically updated to reflect the committed changes.