[PATCH] D54678: [gn build] Create abi-breaking.h, config.h, llvm-config.h, and add a build file for llvm/lib/Support.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 18 11:16:08 PST 2018


thakis created this revision.
thakis added a reviewer: phosek.
Herald added subscribers: jfb, hiraditya, mgorny.

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). This might be overkill; I'm not married to that part (but I kind of like it).

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).


https://reviews.llvm.org/D54678

Files:
  llvm/utils/gn/build/BUILD.gn
  llvm/utils/gn/build/enable_threads.gni
  llvm/utils/gn/build/libs/pthread/BUILD.gn
  llvm/utils/gn/build/libs/pthread/enable.gni
  llvm/utils/gn/build/libs/terminfo/BUILD.gn
  llvm/utils/gn/build/libs/terminfo/enable.gni
  llvm/utils/gn/build/libs/xml/BUILD.gn
  llvm/utils/gn/build/libs/xml/enable.gni
  llvm/utils/gn/build/libs/zlib/BUILD.gn
  llvm/utils/gn/build/libs/zlib/enable.gni
  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/targets.gni
  llvm/utils/gn/secondary/llvm/tools/llvm-undname/BUILD.gn
  llvm/utils/gn/secondary/llvm/triples.gni
  llvm/utils/gn/secondary/llvm/version.gni

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54678.174544.patch
Type: text/x-patch
Size: 24608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181118/f95d935d/attachment.bin>


More information about the llvm-commits mailing list