blob: ec37c5532c6eab7da864c5fc5e7f35572484ca09 [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({
Konstantin Aladyshev6f22abd2024-04-03 19:14:08 +030036 'BOOST_INCLUDE_LIBRARIES': 'asio;callable_traits'
Ed Tanous4f143282024-02-14 08:55:54 -080037 })
38 boost_cmake = cmake.subproject('boost', required: true, options: opt)
39 boost_asio = boost_cmake.dependency('boost_asio').as_system()
Konstantin Aladyshev6f22abd2024-04-03 19:14:08 +030040 boost_callable_traits = boost_cmake.dependency('boost_callable_traits').as_system()
41 boost = [boost_asio, boost_callable_traits]
Ed Tanous4f143282024-02-14 08:55:54 -080042endif
Dung Caofaf6a6a2020-12-28 04:44:45 +000043
Dung Caof6249412021-01-14 03:41:56 +000044# Configure and install systemd unit files
45systemd = dependency('systemd')
Patrick Williams6f25d7b2023-04-12 08:05:49 -050046systemd_system_unit_dir = systemd.get_variable(
Dung Caof6249412021-01-14 03:41:56 +000047 'systemdsystemunitdir',
Patrick Williams6f25d7b2023-04-12 08:05:49 -050048 pkgconfig_define: ['prefix', get_option('prefix')])
Dung Caof6249412021-01-14 03:41:56 +000049
George Liud122cff2023-08-16 16:04:49 +080050fs = import('fs')
51fs.copyfile(
52 'ssifbridge.service',
Dung Caof6249412021-01-14 03:41:56 +000053 install: true,
George Liud122cff2023-08-16 16:04:49 +080054 install_dir: systemd_system_unit_dir
Dung Caof6249412021-01-14 03:41:56 +000055)
56
Dung Caofaf6a6a2020-12-28 04:44:45 +000057executable('ssifbridged','ssifbridged.cpp',
Ed Tanous4f143282024-02-14 08:55:54 -080058 dependencies: [
59 boost,
60 sdbusplus,
61 cli11,
62 phosphor_logging,
63 ],
Thang Q. Nguyen20c6f952020-12-09 03:28:44 +000064 install: true)