OSDN Git Service

[gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build file for...
authorNico Weber <nicolasweber@gmx.de>
Tue, 27 Nov 2018 05:19:17 +0000 (05:19 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 27 Nov 2018 05:19:17 +0000 (05:19 +0000)
commitcefe270ac5897c025b09679acd6893730d062639
tree614c820783932e5c784ac16b76d2ba2d464aba78
parentfd2bfc7842874a14e227fbe835ef604103773dd4
[gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build file for llvm/lib/Support.

The comments at the top of
llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn and
llvm/utils/gn/build/write_cmake_config.py should explain the main bits
happening in this patch. The main parts here are that these headers are
generated at build time, not gn time, and that currently they don't do any
actual feature checks but just hardcode most things based on the current OS,
which seems to work well enough. If this stops being enough, the feature checks
should each be their own action writing the result to somewhere, and the config
write step should depend on those checks (so that they can run in parallel and
as part of the build) -- utils/llvm/gn/README.rst already has some more words
on that in "Philosophy".

(write_cmake_config.py is also going to be used to write clang's
clang/include/clang/Config/config.h)

This also adds a few files for linking to system libraries in a consistent way
if needed in llvm/utils/gn/build/libs (and moves pthread to that model).0

I'm also adding llvm/utils/gn/secondary/llvm/lib/Target/targets.gni in this
patch because $native_arch is needed for writing llvm-config.h -- the rest of
it will be used later, when the build files for llvm/lib/Target get added. That
file describes how to select which archs to build.

As a demo, also add a build file for llvm-undname and make it the default build
target (it depends on everything that can currently be built).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347636 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
utils/gn/README.rst
utils/gn/build/BUILD.gn
utils/gn/build/libs/pthread/BUILD.gn [new file with mode: 0644]
utils/gn/build/libs/terminfo/BUILD.gn [new file with mode: 0644]
utils/gn/build/libs/terminfo/enable.gni [new file with mode: 0644]
utils/gn/build/libs/xml/BUILD.gn [new file with mode: 0644]
utils/gn/build/libs/xml/enable.gni [new file with mode: 0644]
utils/gn/build/libs/zlib/BUILD.gn [new file with mode: 0644]
utils/gn/build/libs/zlib/enable.gni [new file with mode: 0644]
utils/gn/build/toolchain/BUILD.gn
utils/gn/build/write_cmake_config.py [new file with mode: 0644]
utils/gn/secondary/BUILD.gn
utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn [new file with mode: 0644]
utils/gn/secondary/llvm/lib/Support/BUILD.gn [new file with mode: 0644]
utils/gn/secondary/llvm/lib/Target/targets.gni [new file with mode: 0644]
utils/gn/secondary/llvm/tools/llvm-undname/BUILD.gn [new file with mode: 0644]
utils/gn/secondary/llvm/triples.gni [new file with mode: 0644]
utils/gn/secondary/llvm/version.gni [new file with mode: 0644]