build: Add options for tweaking what is built

We don't need to always build tests or examples so make it possible for
the user to configure what is built. The default is to automatically
build them if possible.

Change-Id: I5cb6b1689c408188f14d1fcbcfb0006c17f1c90d
Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meson.build b/meson.build
index bbf43a7..6cacf8c 100644
--- a/meson.build
+++ b/meson.build
@@ -40,8 +40,12 @@
     modules: [ 'coroutine', 'context' ],
 )
 
-subdir('example')
-subdir('test')
+if not get_option('examples').disabled()
+  subdir('example')
+endif
+if not get_option('tests').disabled()
+  subdir('test')
+endif
 
 install_subdir(
     'include/sdbusplus',