This is an archive of the discontinued LLVM Phabricator instance.

lldb: repair the standalone build for Windows
Needs RevisionPublic

Authored by compnerd on Jan 21 2021, 4:30 PM.

Details

Summary

The previous code path only happened to work incidentally. The
file(MAKE_DIRECTORY) is executed early, without the generator
expression being evaluated. The result is that the literal value is
being treated as a path. However, on Windows : is not a valid
character for a file name. This would cause the operation to fail. The
subsequent commands are delayed until runtime, and the operations will
expand the value at generation time yielding the correct result.

Diff Detail

Event Timeline

compnerd created this revision.Jan 21 2021, 4:30 PM
compnerd requested review of this revision.Jan 21 2021, 4:30 PM
JDevlieghere accepted this revision.Jan 21 2021, 5:20 PM
JDevlieghere added a reviewer: teemperor.

LGTM but I'd like @teemperor to have a look too as he authored the original change.

This revision is now accepted and ready to land.Jan 21 2021, 5:21 PM
teemperor requested changes to this revision.Feb 10 2021, 11:54 PM

(I'm very sorry for the delay, that slipped out of my review queue.)

Wouldn't changing this logic to an explicit get_target_property call break the multi-config projects (where there are multiple possible paths)?

I actually think the easiest solution is to just delete the file(MAKE_DIRECTORY ... line. As you described it's not doing what it should and as we create the directory in the custom command below it is redundant. I believe this line is only a remnant from when I tried to get this working in non-multi-config generator setups.

This revision now requires changes to proceed.Feb 10 2021, 11:54 PM