[libc++] Support per-target __config_site in per-target runtime build
authorPetr Hosek <phosek@google.com>
Wed, 15 Jul 2020 21:10:56 +0000 (14:10 -0700)
committerPetr Hosek <phosek@google.com>
Wed, 28 Apr 2021 21:27:16 +0000 (14:27 -0700)
commitea12d779bc238c387511fe7462020f4ecf4a8246
tree41dc713dfebd3b28e58bcd801560c967c5015655
parentabd7529625a73f405e40a63dcc446c41d51a219e
[libc++] Support per-target __config_site in per-target runtime build

When using the per-target runtime build, it may be desirable to have
different __config_site headers for each target where all targets cannot
share a single configuration.

The layout used for libc++ headers after this change is:

```
include/
  c++/
    v1/
      <libc++ headers except for __config_site>
  <target1>/
    c++/
      v1/
        __config_site
  <target2>/
    c++/
      v1/
        __config_site
  <other targets>
```

This is the most optimal layout since it avoids duplication, the only
headers that's per-target is __config_site, all other headers are
shared across targets. This also means that we no need two
-isystem flags: one for the target-agnostic headers and one for
the target specific headers.

Differential Revision: https://reviews.llvm.org/D89013
15 files changed:
clang/lib/Driver/ToolChains/Fuchsia.cpp
clang/lib/Driver/ToolChains/Gnu.cpp
clang/test/Driver/Inputs/basic_fuchsia_tree/include/aarch64-unknown-fuchsia/c++/v1/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/basic_fuchsia_tree/include/riscv64-unknown-fuchsia/c++/v1/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/basic_fuchsia_tree/include/x86_64-unknown-fuchsia/c++/v1/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/basic_linux_libcxx_tree/usr/include/x86_64-unknown-linux-gnu/c++/v1/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/basic_linux_libcxxv2_tree/usr/include/x86_64-unknown-linux-gnu/c++/v2/.keep [new file with mode: 0644]
clang/test/Driver/Inputs/basic_linux_libstdcxx_libcxxv2_tree/usr/include/x86_64-unknown-linux-gnu/c++/v2/.keep [new file with mode: 0644]
clang/test/Driver/fuchsia.cpp
clang/test/Driver/linux-header-search.cpp
libcxx/CMakeLists.txt
libcxx/benchmarks/CMakeLists.txt
libcxx/include/CMakeLists.txt
libcxx/utils/libcxx/test/config.py
libcxxabi/test/libcxxabi/test/config.py