1# Copyright 2021 Google LLC 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 15project( 16 'metrics-ipmi-blobs', 17 'cpp', 18 version: '0.1', 19 default_options: [ 20 'cpp_std=c++17', 21 ], 22) 23 24add_project_arguments( 25 '-Wno-unused-parameter', 26 language:'cpp') 27 28protoc = find_program('protoc', required: true) 29 30gen = generator(protoc, 31 output: [ 32 '@BASENAME@.pb.cc', '@BASENAME@.pb.h' 33 ], 34 arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@']) 35generated = gen.process(['metricblob.proto']) 36 37shared_library( 38 'metrics', 39 'main.cpp', 40 'handler.cpp', 41 'metric.cpp', 42 'util.cpp', 43 generated, 44 install: true, 45 install_dir: '/usr/lib/blob-ipmid/', 46 dependencies: [ 47 dependency('phosphor-logging'), 48 dependency('phosphor-ipmi-blobs'), 49 dependency('protobuf'), 50 ], 51 version: '0', 52) 53 54gtest_dep = dependency('gtest') 55text_executable = executable('testprog', [ 56 'test/util_test.cpp', 'util.cpp'], 57 dependencies: [ gtest_dep, dependency('phosphor-logging') ]) 58test('gtest test', text_executable) 59