1# Copyright (C) 2024 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15licenses(["notice"]) 16 17exports_files([ 18 "LICENSE", 19]) 20 21proto_library( 22 name = "dittosuite_generic_proto", 23 srcs = glob([ 24 "schema/*.proto", 25 ]), 26) 27 28# buildifier: disable=native-cc-proto 29cc_proto_library( 30 name = "dittosuite_cc_proto", 31 deps = [ 32 ":dittosuite_generic_proto", 33 ], 34) 35 36genrule( 37 name = "dittobench_gen_embedded_benchmarks", 38 srcs = glob(["example/**/*.ditto"]), 39 outs = ["generated/embedded_benchmarks.cpp"], 40 cmd = "./$(location ditto2cpp.py) -s $(SRCS) -o $@", 41 tools = ["ditto2cpp.py"], 42) 43 44cc_library( 45 name = "libditto", 46 srcs = glob([ 47 "src/*.cpp", 48 ]) + [":dittobench_gen_embedded_benchmarks"], 49 hdrs = glob([ 50 "include/ditto/*.h", 51 ]), 52 includes = [ 53 "include", 54 "schema", 55 ], 56 deps = [ 57 ":dittosuite_cc_proto", 58 ], 59) 60 61cc_binary( 62 name = "dittobench", 63 srcs = [ 64 "dittobench.cpp", 65 ], 66 deps = [ 67 ":libditto", 68 ], 69) 70 71cc_test( 72 name = "dittobench_test", 73 srcs = glob([ 74 "test/*.cpp", 75 "test/include/*.h", 76 ]), 77 data = glob([ 78 "example/*", 79 ]), 80 deps = [ 81 "libditto", 82 "@googletest//:gtest_main", 83 ], 84) 85