blob: b26500490ca24faffc7c4c6873cdbca14529b467 [file] [log] [blame]
Patrick Williams419c6e42025-02-01 08:37:44 -05001project(
2 'ssifbridge',
3 'cpp',
Patrick Williams16592b32023-07-12 11:15:51 -05004 meson_version: '>=1.1.1',
Dung Caofaf6a6a2020-12-28 04:44:45 +00005 default_options: [
6 'buildtype=debugoptimized',
7 'warning_level=3',
8 'werror=true',
Konstantin Aladyshev3e0ecc82024-10-10 18:01:21 +03009 'cpp_std=c++23',
Konstantin Aladyshev0940a7c2024-04-03 19:11:12 +030010 'b_lto=true',
Dung Caofaf6a6a2020-12-28 04:44:45 +000011 ],
12 version: '1.0',
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000013)
14
Ed Tanous8e3f0ad2024-02-14 08:58:32 -080015add_project_arguments(
Patrick Williams419c6e42025-02-01 08:37:44 -050016 ['-Wno-psabi', '-DBOOST_ASIO_DISABLE_THREADS', '-DBOOST_ASIO_NO_DEPRECATED'],
17 language: 'cpp',
Ed Tanous8e3f0ad2024-02-14 08:58:32 -080018)
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000019
Ed Tanous4f143282024-02-14 08:55:54 -080020sdbusplus = dependency('sdbusplus')
21cli11 = dependency('CLI11')
22phosphor_logging = dependency('phosphor-logging')
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000023
Patrick Williams419c6e42025-02-01 08:37:44 -050024boost = dependency('boost', version: '>=1.83.0', required: false)
Ed Tanous4f143282024-02-14 08:55:54 -080025
26if not boost.found()
Patrick Williams419c6e42025-02-01 08:37:44 -050027 cmake = import('cmake')
28 opt = cmake.subproject_options()
29 opt.add_cmake_defines({'BOOST_INCLUDE_LIBRARIES': 'asio;callable_traits'})
30 boost_cmake = cmake.subproject('boost', required: true, options: opt)
31 boost_asio = boost_cmake.dependency('boost_asio').as_system()
32 boost_callable_traits = boost_cmake.dependency('boost_callable_traits').as_system()
33 boost = [boost_asio, boost_callable_traits]
Ed Tanous4f143282024-02-14 08:55:54 -080034endif
Dung Caofaf6a6a2020-12-28 04:44:45 +000035
Dung Caof6249412021-01-14 03:41:56 +000036# Configure and install systemd unit files
37systemd = dependency('systemd')
Patrick Williams6f25d7b2023-04-12 08:05:49 -050038systemd_system_unit_dir = systemd.get_variable(
Dung Caof6249412021-01-14 03:41:56 +000039 'systemdsystemunitdir',
Patrick Williams419c6e42025-02-01 08:37:44 -050040 pkgconfig_define: ['prefix', get_option('prefix')],
41)
Dung Caof6249412021-01-14 03:41:56 +000042
George Liud122cff2023-08-16 16:04:49 +080043fs = import('fs')
44fs.copyfile(
45 'ssifbridge.service',
Dung Caof6249412021-01-14 03:41:56 +000046 install: true,
Patrick Williams419c6e42025-02-01 08:37:44 -050047 install_dir: systemd_system_unit_dir,
Dung Caof6249412021-01-14 03:41:56 +000048)
49
Patrick Williams419c6e42025-02-01 08:37:44 -050050executable(
51 'ssifbridged',
52 'ssifbridged.cpp',
53 dependencies: [boost, sdbusplus, cli11, phosphor_logging],
54 install: true,
55)