# Copyright 2026 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) # Generate a include/lttng/ust-version.h file with the version information. genrule( name = "generate_ust_version_h", outs = ["include/lttng/ust-version.h"], cmd = """ echo ' #ifndef _LTTNG_UST_VERSION_H #define _LTTNG_UST_VERSION_H #define LTTNG_UST_MAJOR_VERSION 2 #define LTTNG_UST_MINOR_VERSION 14 #define LTTNG_UST_PATCHLEVEL_VERSION 0 #define LTTNG_UST_VERSION "2.14.0" #define LTTNG_UST_LIB_SONAME_MAJOR 1 #define LTTNG_UST_CTL_LIB_SONAME_MAJOR 6 #endif /* _LTTNG_UST_VERSION_H */' > $(location include/lttng/ust-version.h)""", ) # Generate an include/lttng/ust-config.h file with the version information. genrule( name = "generate_ust_config_h", outs = ["include/lttng/ust-config.h"], cmd = """ echo ' #ifndef _LTTNG_UST_CONFIG_H #define _LTTNG_UST_CONFIG_H #endif /* _LTTNG_UST_CONFIG_H */' > $(location include/lttng/ust-config.h)""", ) cc_library( name = "lttng-ust", srcs = glob( [ "src/common/**/*.h", "src/common/**/*.c", "src/lib/lttng-ust-common/**/*.c", "src/lib/lttng-ust-common/**/*.h", "src/lib/lttng-ust-tracepoint/**/*.c", "src/lib/lttng-ust-tracepoint/**/*.h", "src/lib/lttng-ust/**/*.c", "src/lib/lttng-ust/**/*.h", ], exclude = [ "src/lib/lttng-ust/lttng-context-perf-counters.c", ], ), hdrs = glob([ "include/**/*.h", ]) + [ ":generate_ust_config_h", ":generate_ust_version_h", ], copts = [ "-Wno-stringop-overread", ], includes = [ "include", "src", "src/lib/lttng-ust", ], local_defines = [ "_GNU_SOURCE", "LTTNG_SYSTEM_RUNDIR=\\\"/var/run/lttng\\\"", ], deps = [ "@userspace_rcu", ], )