aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2021-10-31 03:19:20 +0000
committerChandler Carruth <chandlerc@gmail.com>2021-11-02 00:24:47 +0000
commitd1fdd745d510f40d8741d44ce39f5ae24ee7f91a (patch)
tree34478aab2de81c1cac9cf45a12bc2c946ea057aa /utils
parent8bf12445383b2f3149a9d095bfbc0f6d5b00dfaa (diff)
downloadllvm-d1fdd745d510f40d8741d44ce39f5ae24ee7f91a.zip
llvm-d1fdd745d510f40d8741d44ce39f5ae24ee7f91a.tar.gz
llvm-d1fdd745d510f40d8741d44ce39f5ae24ee7f91a.tar.bz2
Re-introduce `copts` hacks for lib/AST includes.
Sadly, these are necessary AFAICT. There is a file `lib/AST/CXXABI.h`. On case insensitive file systems like macOS this will collide with `cxxabi.h` on the system if we use the `includes` trick to allow file-relative `#include` of generated files. I've tested this on both Linux and Windows to make sure it remains reasonably portable. Differential Revision: https://reviews.llvm.org/D112883
Diffstat (limited to 'utils')
-rw-r--r--utils/bazel/llvm-project-overlay/clang/BUILD.bazel23
1 files changed, 16 insertions, 7 deletions
diff --git a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
index 488c23b..f2cf7da 100644
--- a/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang/BUILD.bazel
@@ -691,14 +691,25 @@ cc_library(
"lib/AST/*.h",
"lib/AST/Interp/*.cpp",
"lib/AST/Interp/*.h",
- ]),
+ ]) + [
+ "lib/AST/AttrDocTable.inc",
+ "lib/AST/Interp/Opcodes.inc",
+ ],
hdrs = glob([
"include/clang/AST/*.h",
]),
- includes = [
- "include",
- "lib/AST",
- "lib/AST/Interp",
+ copts = [
+ # FIXME: This is necessary to allow "file relative" include paths from
+ # non-generated `srcs` to find generated `srcs` above. Bazel should
+ # either make this work automatically by creating a unified tree of
+ # `srcs` or at least provide a `local_includes` that has the path
+ # translation logic of `includes` but is only used locally (similar to
+ # `local_defines` vs. `defines`). Until one of those lands, this is the
+ # least bad approach. Using `includes` is *specifically* problematic for
+ # this library because it contains files that collide easily with system
+ # headers such as `CXXABI.h`.
+ "-I$(GENDIR)/external/llvm-project/clang/lib/AST",
+ "-I$(GENDIR)/external/llvm-project/clang/lib/AST/Interp",
],
textual_hdrs = [
"include/clang/AST/AttrImpl.inc",
@@ -715,8 +726,6 @@ cc_library(
"include/clang/AST/DeclNodes.inc",
"include/clang/AST/StmtDataCollectors.inc",
"include/clang/AST/StmtNodes.inc",
- "lib/AST/AttrDocTable.inc",
- "lib/AST/Interp/Opcodes.inc",
] + glob([
"include/clang/AST/*.def",
]),