Port to meson

OpenBMC is moving everything to meson, so do that here, too.

Change-Id: I6a7181d6a538ce4e81d216c4391828819e27ee16
Signed-off-by: Jason M. Bills <jason.m.bills@intel.com>
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..513cddf
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,56 @@
+project(
+  'peci-pcie',
+  'cpp',
+  version : '1.0',
+  meson_version: '>=1.1.1',
+  default_options: [
+    'b_ndebug=if-release',
+    'cpp_rtti=false',
+    'cpp_std=c++20',
+    'warning_level=3',
+    'werror=true',
+  ]
+)
+
+if(get_option('wait-for-os-standby').enabled())
+  add_project_arguments('-DWAIT_FOR_OS_STANDBY', language : 'cpp')
+endif
+
+if(get_option('use-rdendpointcfg').enabled())
+  add_project_arguments('-DUSE_RDENDPOINTCFG', language : 'cpp')
+endif
+
+sdbusplus = dependency('sdbusplus')
+
+systemd = dependency('systemd', required: true)
+systemd_system_unit_dir = systemd.get_variable(pkgconfig:
+    'systemdsystemunitdir'
+)
+
+peci = dependency('libpeci')
+
+boost = dependency('boost', version: '>=1.82')
+add_project_arguments(
+  [
+    '-DBOOST_ASIO_DISABLE_THREADS',
+    '-DBOOST_ASIO_EXCEPTION_DISABLE',
+    '-DBOOST_ASIO_NO_DEPRECATED',
+    '-DBOOST_NO_RTTI',
+    '-DBOOST_NO_TYPEID',
+  ],
+  language : 'cpp'
+)
+
+executable(
+  'peci-pcie',
+  'src/peci_pcie.cpp',
+  include_directories: include_directories('include'),
+  dependencies: [
+    boost,
+    peci,
+    sdbusplus,
+  ],
+  install: true,
+)
+
+subdir('service_files')
diff --git a/meson.options b/meson.options
new file mode 100644
index 0000000..259285c
--- /dev/null
+++ b/meson.options
@@ -0,0 +1,13 @@
+option(
+    'wait-for-os-standby',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Wait for the OS Standby state to indicate that BIOS is complete before starting the PCIe scan',
+)
+
+option(
+    'use-rdendpointcfg',
+    type: 'feature',
+    value: 'disabled',
+    description: 'Use the RdEndpointConfig PECI command to read PCI data',
+)
diff --git a/service_files/meson.build b/service_files/meson.build
new file mode 100644
index 0000000..42722d2
--- /dev/null
+++ b/service_files/meson.build
@@ -0,0 +1,4 @@
+install_data(
+  'xyz.openbmc_project.PCIe.service',
+  install_dir: systemd_system_unit_dir,
+)
diff --git a/src/peci_pcie.cpp b/src/peci_pcie.cpp
index 2ad8535..0e9ca91 100644
--- a/src/peci_pcie.cpp
+++ b/src/peci_pcie.cpp
@@ -1015,7 +1015,7 @@
         "OperatingSystemState");
 }
 
-int main(int /*argc*/, char** /*argv*/)
+int main(int /*argc*/, char* /*argv*/[])
 {
     // setup connection to dbus
     boost::asio::io_context io;