# Copyright (C) 2024 The Android Open Source Project # # 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. licenses(["notice"]) exports_files([ "LICENSE", ]) proto_library( name = "dittosuite_generic_proto", srcs = glob([ "schema/*.proto", ]), ) # buildifier: disable=native-cc-proto cc_proto_library( name = "dittosuite_cc_proto", deps = [ ":dittosuite_generic_proto", ], ) genrule( name = "dittobench_gen_embedded_benchmarks", srcs = glob(["example/**/*.ditto"]), outs = ["generated/embedded_benchmarks.cpp"], cmd = "./$(location ditto2cpp.py) -s $(SRCS) -o $@", tools = ["ditto2cpp.py"], ) cc_library( name = "libditto", srcs = glob([ "src/*.cpp", ]) + [":dittobench_gen_embedded_benchmarks"], hdrs = glob([ "include/ditto/*.h", ]), includes = [ "include", "schema", ], deps = [ ":dittosuite_cc_proto", ], ) cc_binary( name = "dittobench", srcs = [ "dittobench.cpp", ], deps = [ ":libditto", ], ) cc_test( name = "dittobench_test", srcs = glob([ "test/*.cpp", "test/include/*.h", ]), data = glob([ "example/*", ]), deps = [ "libditto", "@googletest//:gtest_main", ], )