Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
64 lines (54 loc) · 2.59 KB
/
Copy pathMODULE.bazel
File metadata and controls
64 lines (54 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module(
name = "cppjit",
version = "0.1.0",
)
bazel_dep(name = "cppjit_bazel", version = "0.1.0")
local_path_override(
module_name = "cppjit_bazel",
path = "bazel",
)
bazel_dep(name = "cppinterop", version = "0.1.0")
# Fetch the same CppInterOp commit the CMake build pins (CPPINTEROP_GIT_TAG in
# CMakeLists.txt), so both builds compile the same backend sources and no
# sibling checkout is needed. Keep the two pins in step. Exception: the CMake
# pin predates the Bazel fix for the generated BakedArgs.h (CppInterOp #1162),
# so this pin is that commit until the CMake pin catches up.
# The patch only renames the shared Bazel module (cppyy_bazel -> cppjit_bazel)
# in the fetched tree; drop it once the pinned commit carries the rename.
# To build a fork or a newer commit, swap urls/integrity/strip_prefix together.
archive_override(
module_name = "cppinterop",
integrity = "sha256-GNb6eIl2bLSX1upznpD0Y4OnJcLVjarRvYQ/kqqXka4=",
patch_strip = 1,
patches = ["//:bazel-support/cppinterop-cppjit-bazel-module.patch"],
strip_prefix = "CppInterOp-f8f0689a9a97fe8e64651e7980a2d2c7e45101b5",
urls = ["https://github.com/compiler-research/CppInterOp/archive/f8f0689a9a97fe8e64651e7980a2d2c7e45101b5.tar.gz"],
)
# Dev loop: build a sibling CppInterOp checkout instead of the pinned archive
# (the Bazel equivalent of CMake's CPPINTEROP_SOURCE_DIR). Bazel allows one
# override per module, so comment out the archive_override above when you
# enable this. Keep it commented out in a commit: an enabled override makes
# the build depend on a checkout outside the repo, which nobody else has.
# local_path_override(
# module_name = "cppinterop",
# path = "../CppInterOp",
# )
bazel_dep(name = "rules_python", version = "1.8.5")
# @llvm comes from the local LLVM/Clang tree selected by LLVM_DIR.
llvm = use_extension("@cppjit_bazel//:llvm.bzl", "llvm")
# Match the CMake build's CMAKE_CXX_STANDARD. A mixed standard across the
# libcppjit / libclangCppInterOp boundary silently changes inline bodies.
llvm.config(cxx_std = "c++20")
use_repo(llvm, llvm = "cppjit_llvm")
# Opt in to the centralized clang toolchain from cppjit_bazel (standalone build).
register_toolchains("@llvm//:cc_toolchain")
# Match the primary CI matrix cell in ci.yml.
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = "3.14")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "cppjit_test_deps",
python_version = "3.14",
requirements_lock = "//:requirements_bazel.txt",
)
use_repo(pip, "cppjit_test_deps")