This is an archive of the discontinued LLVM Phabricator instance.

gn build: s/root_out_dir/root_build_dir/g in llvm/utils/gn/build/write_cmake_config.gni.
ClosedPublic

Authored by pcc on Jan 7 2019, 7:59 PM.

Details

Summary

This makes the generated files go to the right place when using a non-default toolchain.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Jan 7 2019, 7:59 PM
thakis added a comment.Jan 9 2019, 6:07 AM

There are many many references to root_out_dir, cmd-f root_out_dir on the lhs in D56487 for example. Does it make sense to change them all at once? Or should we land D56487 fist and at least change all the write_cmake_config ones at once?

pcc added a comment.Jan 10 2019, 2:22 PM

There are many many references to root_out_dir, cmd-f root_out_dir on the lhs in D56487 for example. Does it make sense to change them all at once? Or should we land D56487 fist and at least change all the write_cmake_config ones at once?

Let's land your change first.

(landed my change; thanks for the review!)

pcc updated this revision to Diff 181191.Jan 10 2019, 5:12 PM
pcc retitled this revision from gn build: s/root_out_dir/root_build_dir/g in include/llvm/Config/BUILD.gn. to gn build: s/root_out_dir/root_build_dir/g in llvm/utils/gn/build/write_cmake_config.gni..

Update gni file

thakis accepted this revision.Jan 11 2019, 6:25 AM

lgtm. What about the rest of git grep root_out_dir llvm/utils/?

This revision is now accepted and ready to land.Jan 11 2019, 6:25 AM

Are all the generated files independent of the target toolchain? The most idiomatic from GN point of view would be to use root_gen_dir for all generated files.

pcc added a comment.Jan 11 2019, 11:52 AM

lgtm. What about the rest of git grep root_out_dir llvm/utils/?

Most of it seems correct, but I haven't verified it. Everything in llvm/utils/gn/secondary/clang/include/clang ought to be fixed though (and if I do that I can build a clang binary for Android with my other patches, which isn't all that useful for what I'm doing but it does at least serve to validate the mechanism). I'll send out a patch that does that.

Are all the generated files independent of the target toolchain? The most idiomatic from GN point of view would be to use root_gen_dir for all generated files.

The second argument to rebase_path is the path that the result should be relative to (normally root_build_dir when creating arguments for an action). The output path itself is already inside root_gen_dir.

This revision was automatically updated to reflect the committed changes.