Geoffrey Martin-Noble 4aeb2e60df Introduce a Bazel build configuration
This patch introduces configuration for a Bazel BUILD in a side
directory in the monorepo.

This is following the approval of
https://github.com/llvm/llvm-www/blob/main/proposals/LP0002-BazelBuildConfiguration.md

As detailed in the README, the Bazel BUILD is not supported
by the community in general, and is maintained only by interested
parties. It follows the requirements of the LLVM peripheral tier:
https://llvm.org/docs/SupportPolicy.html#peripheral-tier.

This is largely copied from https://github.com/google/llvm-bazel,
with a few filepath tweaks and the addition of the README.

Reviewed By: echristo, keith, dblaikie, kuhar

Differential Revision: https://reviews.llvm.org/D90352
2021-06-22 12:47:43 -07:00

30 lines
1.1 KiB
Python

# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# We perform diff testing here to avoid any in-tree BUILD files depending on
# bazel_sklyib. These diff tests ensure that the current Bazel configuration
# does not drift from the configuration in the .cmake files, since we don't
# alway use them directly (and even if we did we wouldn't necessarily pick up
# changes there). These are literal change-detector tests.
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
diff_test(
name = "diff_config.h.cmake",
file1 = "@llvm-project//llvm:include/llvm/Config/config.h.cmake",
file2 = "config.h.cmake",
)
diff_test(
name = "diff_llvm-config.h.cmake",
file1 = "@llvm-project//llvm:include/llvm/Config/llvm-config.h.cmake",
file2 = "llvm-config.h.cmake",
)
diff_test(
name = "diff_abi-breaking.h.cmake",
file1 = "@llvm-project//llvm:include/llvm/Config/abi-breaking.h.cmake",
file2 = "abi-breaking.h.cmake",
)