[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn
authorNico Weber <nicolasweber@gmx.de>
Thu, 6 Dec 2018 17:42:35 +0000 (17:42 +0000)
committerNico Weber <nicolasweber@gmx.de>
Thu, 6 Dec 2018 17:42:35 +0000 (17:42 +0000)
commit1be23a901fed410309bd4a7182f00c7721fddb7d
tree5360e004acd410453d22204ce4c3d01fdb3b6bc8
parent96f696370826ea5dc867789ef81e56f2027218c6
[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn

Tweak write_cmake_config.py to also handle variable references looking @FOO@
(matching CMake's configure_file() function), and make it replace '\' 'n' in
values with a newline literal since there's no good portable way of passing a
real newline literal on a command line.

Use that to process all the .def.in files in llvm/include/Config and add
llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes
them.

Differential Revision: https://reviews.llvm.org/D55184

llvm-svn: 348503
llvm/utils/gn/build/write_cmake_config.py
llvm/utils/gn/secondary/BUILD.gn
llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Target/BUILD.gn [new file with mode: 0644]