meson: add src/ folder
This creates a conventional structure of src/ and test/ which helps to
separate top-level files such as meson.build, OWNERS, ...
from implementation files.
Git history of individual files is still accessible via e.g.
```
git log --follow -- src/thresholds.hpp
```
Tested: code compiles.
Change-Id: Ifff8b3e70437bc6a25cd6f65afd07d8a563d1a8c
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/meson.build b/meson.build
index fc8ca68..b2d4227 100644
--- a/meson.build
+++ b/meson.build
@@ -19,25 +19,7 @@
exprtk = declare_dependency(include_directories: 'subprojects/exprtk')
endif
-executable(
- 'virtual-sensor',
- [
- 'calculate.cpp',
- 'dbusSensor.cpp',
- 'dbusUtils.cpp',
- 'main.cpp',
- 'virtualSensor.cpp',
- ],
- dependencies: [
- dependency('nlohmann_json', include_type: 'system'),
- dependency('phosphor-dbus-interfaces'),
- dependency('phosphor-logging'),
- dependency('sdbusplus'),
- exprtk,
- ],
- install: true,
- install_dir: get_option('libexecdir') / meson.project_name(),
-)
+subdir('src')
packagedir = join_paths(
get_option('prefix'),
@@ -58,6 +40,8 @@
install_dir: systemd.get_variable('systemd_system_unit_dir'),
)
+src_inc = include_directories('src')
+
build_tests = get_option('tests')
if build_tests.allowed()
subdir('test')