Move source into src directory

This makes the source more distinguishable from top-level metadata.

Change-Id: I5e41186d4606422937ec7d37402a3031d3f776b6
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meson.build b/meson.build
index 9245936..ed2814a 100644
--- a/meson.build
+++ b/meson.build
@@ -8,49 +8,7 @@
     'cpp_std=c++20',
   ])
 
-watchdog_headers = include_directories('.')
-
-# CLI11 might not have a pkg-config. It is header only so just make
-# sure we can access the needed symbols from the header.
-cli11_dep = dependency('cli11', required: false)
-has_cli11 = meson.get_compiler('cpp').has_header_symbol(
-  'CLI/CLI.hpp',
-  'CLI::App',
-  dependencies: cli11_dep,
-  required: false)
-if not has_cli11
-  cli11_proj = subproject('cli11', required: false)
-  assert(cli11_proj.found(), 'CLI11 is required')
-  cli11_dep = cli11_proj.get_variable('CLI11_dep')
-endif
-
-watchdog_deps = [
-  cli11_dep,
-  dependency('phosphor-dbus-interfaces'),
-  dependency('phosphor-logging'),
-  dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
-  dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']),
-]
-
-watchdog_lib = static_library(
-  'watchdog',
-  'watchdog.cpp',
-  implicit_include_directories: false,
-  include_directories: watchdog_headers,
-  dependencies: watchdog_deps)
-
-watchdog_dep = declare_dependency(
-  dependencies: watchdog_deps,
-  include_directories: watchdog_headers,
-  link_with: watchdog_lib)
-
-executable(
-  'phosphor-watchdog',
-  'mainapp.cpp',
-  implicit_include_directories: false,
-  dependencies: watchdog_dep,
-  install: true,
-  install_dir: get_option('bindir'))
+subdir('src')
 
 if not get_option('tests').disabled()
   subdir('test')
diff --git a/mainapp.cpp b/src/mainapp.cpp
similarity index 100%
rename from mainapp.cpp
rename to src/mainapp.cpp
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..63fae3d
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,43 @@
+watchdog_headers = include_directories('.')
+
+# CLI11 might not have a pkg-config. It is header only so just make
+# sure we can access the needed symbols from the header.
+cli11_dep = dependency('cli11', required: false)
+has_cli11 = meson.get_compiler('cpp').has_header_symbol(
+  'CLI/CLI.hpp',
+  'CLI::App',
+  dependencies: cli11_dep,
+  required: false)
+if not has_cli11
+  cli11_proj = subproject('cli11', required: false)
+  assert(cli11_proj.found(), 'CLI11 is required')
+  cli11_dep = cli11_proj.get_variable('CLI11_dep')
+endif
+
+watchdog_deps = [
+  cli11_dep,
+  dependency('phosphor-dbus-interfaces'),
+  dependency('phosphor-logging'),
+  dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
+  dependency('sdeventplus', fallback: ['sdeventplus', 'sdeventplus_dep']),
+]
+
+watchdog_lib = static_library(
+  'watchdog',
+  'watchdog.cpp',
+  implicit_include_directories: false,
+  include_directories: watchdog_headers,
+  dependencies: watchdog_deps)
+
+watchdog_dep = declare_dependency(
+  dependencies: watchdog_deps,
+  include_directories: watchdog_headers,
+  link_with: watchdog_lib)
+
+executable(
+  'phosphor-watchdog',
+  'mainapp.cpp',
+  implicit_include_directories: false,
+  dependencies: watchdog_dep,
+  install: true,
+  install_dir: get_option('bindir'))
diff --git a/watchdog.cpp b/src/watchdog.cpp
similarity index 100%
rename from watchdog.cpp
rename to src/watchdog.cpp
diff --git a/watchdog.hpp b/src/watchdog.hpp
similarity index 100%
rename from watchdog.hpp
rename to src/watchdog.hpp