114fe6698SNan Zhou# Copyright 2021 Google LLC
214fe6698SNan Zhou#
314fe6698SNan Zhou# Licensed under the Apache License, Version 2.0 (the "License");
414fe6698SNan Zhou# you may not use this file except in compliance with the License.
514fe6698SNan Zhou# You may obtain a copy of the License at
614fe6698SNan Zhou#
714fe6698SNan Zhou#      http://www.apache.org/licenses/LICENSE-2.0
814fe6698SNan Zhou#
914fe6698SNan Zhou# Unless required by applicable law or agreed to in writing, software
1014fe6698SNan Zhou# distributed under the License is distributed on an "AS IS" BASIS,
1114fe6698SNan Zhou# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214fe6698SNan Zhou# See the License for the specific language governing permissions and
1314fe6698SNan Zhou# limitations under the License.
1414fe6698SNan Zhou
1514fe6698SNan Zhouproject(
1614fe6698SNan Zhou  'nemora-postd',
1714fe6698SNan Zhou  'cpp',
1814fe6698SNan Zhou  version: '0.1',
1914fe6698SNan Zhou  default_options: [
2014fe6698SNan Zhou    'warning_level=3',
2114fe6698SNan Zhou    'werror=true',
221dfe24eaSPatrick Williams    'cpp_std=c++23'
2314fe6698SNan Zhou  ],
2414fe6698SNan Zhou)
2514fe6698SNan Zhou
2614fe6698SNan Zhouprotobuf = dependency('protobuf')
2714fe6698SNan Zhouphosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
2814fe6698SNan Zhousdbusplus = dependency('sdbusplus')
2914fe6698SNan Zhouthreads = dependency('threads')
3014fe6698SNan Zhoulogging = dependency('phosphor-logging')
3114fe6698SNan Zhou
3214fe6698SNan Zhouprotoc = find_program('protoc', native: true)
3314fe6698SNan Zhou
3414fe6698SNan Zhouproto = custom_target(
3514fe6698SNan Zhou  'event_message_proto',
3614fe6698SNan Zhou  command: [
3714fe6698SNan Zhou    find_program('protoc', native: true),
3814fe6698SNan Zhou    '--proto_path=@CURRENT_SOURCE_DIR@',
3914fe6698SNan Zhou    '--cpp_out=@OUTDIR@',
4014fe6698SNan Zhou    '@INPUT@'
4114fe6698SNan Zhou  ],
4214fe6698SNan Zhou  output: [
4314fe6698SNan Zhou    'event_message.pb.cc',
4414fe6698SNan Zhou    'event_message.pb.h',
4514fe6698SNan Zhou  ],
4614fe6698SNan Zhou  input: 'event_message.proto')
4714fe6698SNan Zhou
4814fe6698SNan Zhouexecutable(
4914fe6698SNan Zhou  'nemora-postd',
5014fe6698SNan Zhou  'nemorad.cpp',
5114fe6698SNan Zhou  'src/host_manager.cpp',
5214fe6698SNan Zhou  'src/nemora.cpp',
5314fe6698SNan Zhou  'src/socket_manager.cpp',
5414fe6698SNan Zhou  'src/serializer.cpp',
5514fe6698SNan Zhou  proto,
5614fe6698SNan Zhou  include_directories: include_directories('.'),
57*bb53161dSWilly Tu  dependencies: [protobuf, phosphor_dbus_interfaces, sdbusplus, threads, logging],
5814fe6698SNan Zhou  install: true
5914fe6698SNan Zhou)
6014fe6698SNan Zhou
6114fe6698SNan Zhou
62