Repository navigation
Expand file tree
/
Copy pathMODULE.bazel
More file actions
91 lines (79 loc) · 3.13 KB
/
Copy pathMODULE.bazel
File metadata and controls
91 lines (79 loc) · 3.13 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"""OpenBimRL-Engine-Native Bazel module.
Owns the rules_foreign_cc cmake packaging of OpenBIMRL_Native and the
vendored nlohmann/json source used by CMake (OPENBIMRL_JSON_SOURCE_DIR).
Consumed by openbimrl_engine via bazel_dep + local_path_override (submodule
checkout at Engine/src/main/cpp). Standalone: bazel build //:openbimrl_native
from this directory.
"""
module(
name = "openbimrl_native",
version = "0.1.0",
)
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
bazel_dep(name = "rules_cc", version = "0.2.17")
bazel_dep(name = "rules_java", version = "9.3.0")
bazel_dep(name = "platforms", version = "1.0.0")
# jni-bind pulls JNI headers from local_jdk via @jni-bind//:jni_bind → :jni_dep.
java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains")
use_repo(java_toolchains, "local_jdk")
register_toolchains(
"@local_jdk//:runtime_toolchain_definition",
"@local_jdk//:bootstrap_runtime_toolchain_definition",
)
# Prefer host cmake/ninja/make/pkg-config over foreign_cc built-from-source
# toolchains (those bootstrap with Bazel's CC; Engine/native .bazelrc pin
# system clang so host tools stay off ROCm clang when it is first on PATH).
register_toolchains(
"@rules_foreign_cc//toolchains:preinstalled_cmake_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_ninja_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_make_toolchain",
"@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain",
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# gtest via http_archive + BUILD overlay (BCR googletest still uses bare
# cc_library, which Bazel 9 rejects). Same release as CMake FetchContent.
http_archive(
name = "googletest",
build_file = "//third_party:googletest.BUILD",
sha256 = "1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4",
strip_prefix = "googletest-1.14.0",
urls = [
"https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip",
],
)
# nlohmann/json for CMake (avoids FetchContent network during cmake configure).
http_archive(
name = "nlohmann_json_src",
build_file = "//third_party:nlohmann_json.BUILD",
sha256 = "d6c65aca6b1ed68e7a182f4757257b107ae403032760ed6ef121c9d55e81757d",
strip_prefix = "json",
urls = [
"https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz",
],
)
# Official jni-bind (Release-1.5.1). Depend on @jni-bind//:jni_bind and
# #include "jni_bind.h" — not the flattened jni_bind_release.h vendored header.
http_archive(
name = "jni-bind",
patch_cmds = [
# Expose jni_bind.h for $(execpath) and full tree for rules_foreign_cc.
"""cat >> BUILD <<'EOF'
exports_files(["jni_bind.h"])
filegroup(
name = "all_srcs",
srcs = glob(
["**"],
exclude = [
".git/**",
],
),
visibility = ["//visibility:public"],
)
EOF""",
],
sha256 = "35d30d8dd5eede097f76973bd0e48acc766565cefe62b00e711053a577d31a0c",
strip_prefix = "jni-bind-Release-1.5.1",
urls = [
"https://github.com/google/jni-bind/archive/refs/tags/Release-1.5.1.zip",
],
)