[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

Qiongsi Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 11 05:43:12 PDT 2022


qiongsiwu1 created this revision.
qiongsiwu1 added reviewers: jsji, daltenty, nemanjai.
qiongsiwu1 added a project: clang.
Herald added subscribers: steven.zhang, pengfei, mgorny, dschuff.
Herald added a project: All.
qiongsiwu1 requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.

The goal of this patch is to improve distribution build's flexibility to include only applicable header files.

Currently, the `clang-resource-headers` target contains nearly all the files in clang/lib/Headers. Most of these files are platform specific (e.g. `immintrin.h` is x86 specific). A distribution build will have to either include all the headers for all the platforms, or not include any headers. For example, if a distribution build for `powerpc` includes the `clang-resource-headers` target, it will include all the `x86` specific headers, even-though the `x86` specific headers cannot be used.

This patch breaks up the `clang-resource-headers` list to a core list and platform specific lists. With the patch, a distribution build can now include the `ppc-resource-headers` to include the headers applicable to the `powerpc` platform.

Specifically, one can now have

  cmake ... LLVM_DISTRIBUTION_COMPONENTS="clang;ppc-resource-headers" ... ../llvm

`ninja install-distribution` then installs the powerpc headers.

Similarly, one can do

  cmake ... LLVM_DISTRIBUTION_COMPONENTS="clang;x86-resource-headers" ... ../llvm

to include headers applicable to the x86 platform in a distribution installation.

To implement this behaviour, the patch does two things

1. It breaks up the long files header file list to a core list and platform specific lists.
2. It adds numerous platform specific installation targets.

This may or may not be a good way to break up the long header list to add new targets, so I am all ears for suggestions/feedback! Also, we may need to add other reviewers. May I get some suggestions on that as well?

Thanks so much!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123498

Files:
  clang/lib/Headers/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123498.421886.patch
Type: text/x-patch
Size: 10572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220411/150c3589/attachment-0001.bin>


More information about the cfe-commits mailing list