blob: db5c9a2c1e5d92b2f4ca3b29167a2624680abbb3 [file] [log] [blame]
Dung Caofaf6a6a2020-12-28 04:44:45 +00001project('ssifbridge', 'cpp',
Patrick Williams16592b32023-07-12 11:15:51 -05002 meson_version: '>=1.1.1',
Dung Caofaf6a6a2020-12-28 04:44:45 +00003 default_options: [
4 'buildtype=debugoptimized',
5 'warning_level=3',
6 'werror=true',
Patrick Williams16592b32023-07-12 11:15:51 -05007 'cpp_std=c++23',
Konstantin Aladyshev0940a7c2024-04-03 19:11:12 +03008 'b_lto=true',
Dung Caofaf6a6a2020-12-28 04:44:45 +00009 ],
10 version: '1.0',
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000011)
12
Ed Tanous8e3f0ad2024-02-14 08:58:32 -080013add_project_arguments(
14 [
15 '-Wno-psabi',
16 '-DBOOST_ASIO_DISABLE_THREADS',
17 '-DBOOST_ASIO_NO_DEPRECATED',
18 ],
19 language: 'cpp'
20)
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000021
Ed Tanous4f143282024-02-14 08:55:54 -080022sdbusplus = dependency('sdbusplus')
23cli11 = dependency('CLI11')
24phosphor_logging = dependency('phosphor-logging')
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000025
Ed Tanous4f143282024-02-14 08:55:54 -080026boost = dependency(
27 'boost',
28 version : '>=1.83.0',
29 required : false,
30)
31
32if not boost.found()
33 cmake = import('cmake')
34 opt = cmake.subproject_options()
35 opt.add_cmake_defines({
36 'BOOST_INCLUDE_LIBRARIES': 'asio'
37 })
38 boost_cmake = cmake.subproject('boost', required: true, options: opt)
39 boost_asio = boost_cmake.dependency('boost_asio').as_system()
40 boost = [boost_asio]
41endif
Dung Caofaf6a6a2020-12-28 04:44:45 +000042
Dung Caof6249412021-01-14 03:41:56 +000043# Configure and install systemd unit files
44systemd = dependency('systemd')
Patrick Williams6f25d7b2023-04-12 08:05:49 -050045systemd_system_unit_dir = systemd.get_variable(
Dung Caof6249412021-01-14 03:41:56 +000046 'systemdsystemunitdir',
Patrick Williams6f25d7b2023-04-12 08:05:49 -050047 pkgconfig_define: ['prefix', get_option('prefix')])
Dung Caof6249412021-01-14 03:41:56 +000048
George Liud122cff2023-08-16 16:04:49 +080049fs = import('fs')
50fs.copyfile(
51 'ssifbridge.service',
Dung Caof6249412021-01-14 03:41:56 +000052 install: true,
George Liud122cff2023-08-16 16:04:49 +080053 install_dir: systemd_system_unit_dir
Dung Caof6249412021-01-14 03:41:56 +000054)
55
Dung Caofaf6a6a2020-12-28 04:44:45 +000056executable('ssifbridged','ssifbridged.cpp',
Ed Tanous4f143282024-02-14 08:55:54 -080057 dependencies: [
58 boost,
59 sdbusplus,
60 cli11,
61 phosphor_logging,
62 ],
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000063 install: true)