This is an archive of the discontinued LLVM Phabricator instance.

[DeviceRTL] CMake fix using target-level dependency
ClosedPublic

Authored by ye-luo on Oct 10 2022, 3:59 PM.

Details

Summary

File-level dependency should not be used on files generated during the build. The next command may execute before the generating command finishes writing the file. Use add_custom_target and use target-level dependency.

Diff Detail

Event Timeline

ye-luo created this revision.Oct 10 2022, 3:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 3:59 PM
ye-luo requested review of this revision.Oct 10 2022, 3:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2022, 3:59 PM
tianshilei1992 accepted this revision.Oct 10 2022, 4:20 PM

This looks like a better direction we want to stick with.

This revision is now accepted and ready to land.Oct 10 2022, 4:20 PM
ye-luo updated this revision to Diff 466683.Oct 10 2022, 6:52 PM

Fix ninja build.

jhuber6 accepted this revision.Oct 10 2022, 7:20 PM

LG, builds fine on my end now.

This revision was automatically updated to reflect the committed changes.

We also need dependencies to those tools for each target.

openmp/libomptarget/DeviceRTL/CMakeLists.txt
175

it occurs to me that, we also need to add ${LINK_TOOL} to dependencies.

ye-luo added inline comments.Oct 11 2022, 9:45 AM
openmp/libomptarget/DeviceRTL/CMakeLists.txt
175

Line 226. No?

tianshilei1992 added inline comments.Oct 11 2022, 9:50 AM
openmp/libomptarget/DeviceRTL/CMakeLists.txt
175

oh, I missed that. My bad.