updated BUILD files and MODULE.bazel for bazel 9

This commit is contained in:
Lasan Mahaliyana
2026-02-06 23:28:25 +05:30
parent cdfe437831
commit 3fd04004d6
5 changed files with 38 additions and 5 deletions
+10 -5
View File
@@ -118,28 +118,33 @@ filegroup(
)
# Create a repo that exposes system-installed sdbus-c++ and libsystemd to Bazel.
#
# Important portability note:
# Avoid hardcoding distro-specific library directories (for example
# /usr/lib/x86_64-linux-gnu vs /usr/lib64). Instead, link by soname and let the
# system linker/search path resolve the actual shared object location.
new_local_repository = use_repo_rule(
"@bazel_tools//tools/build_defs/repo:local.bzl",
"new_local_repository",
)
# Fedora/RHEL layout (lib64); see Ubuntu/Debian variant below
new_local_repository(
name = "sdbus_cpp",
path = "/usr",
build_file_content = """
package(default_visibility = ["//visibility:public"])
cc_import(
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "sdbus_cpp",
shared_library = "lib/x86_64-linux-gnu/libsdbus-c++.so",
hdrs = glob(["include/sdbus-c++/**/*.h*"]),
includes = ["include"],
linkopts = ["-lsdbus-c++"],
)
cc_import(
cc_library(
name = "libsystemd",
shared_library = "lib/x86_64-linux-gnu/libsystemd.so",
linkopts = ["-lsystemd"],
)
""",
)
+2
View File
@@ -14,6 +14,8 @@
licenses(["notice"])
load("@rules_cc//cc:defs.bzl", "cc_binary")
cc_binary(
name = "file_share",
srcs = ["main.cc"],
@@ -16,6 +16,7 @@
licenses(["notice"])
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
#refresh_compile_commands(
# name = "refresh_compile_commands",
#
@@ -13,6 +13,7 @@
# limitations under the License.
licenses(["notice"])
load("@rules_cc//cc:defs.bzl", "cc_library")
cc_library(
name = "types",
textual_hdrs = glob(["**/*.h"]),
+24
View File
@@ -13,6 +13,30 @@
# limitations under the License.
licenses(["notice"])
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_binary")
cc_library(
name = "nearby_connections_service_linux",
srcs = ["nearby_connections_service_linux.cc"],
hdrs = [
"nearby_connections_service_linux.h",
"//sharing:nearby_connections_service.h",
],
visibility = ["//visibility:public"],
deps = [
"//connections:core",
"//connections:core_types",
"//internal/base:file_path",
"//internal/platform:base",
"//internal/platform:logging",
"//internal/platform:mac_address",
"//sharing:connection_types",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings:string_view",
"@com_google_absl//absl/time",
"@com_google_absl//absl/types:span",
],
)
cc_library(
name = "nearby_sharing_service_linux",