Use intermediate bmcweb object files

If you look at an OpenBMC build, every source file is compiled for every
source unit.  This is pretty wasteful, but meson documents how to reuse
object files between link units.  This has a couple benefits:

- Source files are only compiled once
- There are less likely to be unit-test specific binary differences (if,
  for example, the unit tests used different compiler flags).
- Errors in a source file only appear once in the output, instead of 10
  times.

On my 36 core Xeon, a normal build went from 2m38s down to 2m34s, which
is quite underwhelming, and less than you'd expect from a change this
large, but it turns out that if you have more parallelism than you have
compile units, building things twice doesn't appear to matter much.
With that said, if I simulate a smaller machine, using -J 8, the build
time with this commit remains at 2m38s, whereas the commit previous to
this takes 4m48s, so clearly there's some benefit here.

This regression appears to have been caused by
0ad63df8aa8ab60f74395794d8ffce64c82ee031 which caused us to build
multiple executables (one per unit test).  This fixes the regression.

Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ib77e8679b69e0f2242f65c20b129f2fb8e370edb
diff --git a/meson.build b/meson.build
index 1c306f2..79dfe5a 100644
--- a/meson.build
+++ b/meson.build
@@ -334,12 +334,20 @@
   'src/dbus_singleton.cpp',
 )
 
+bmcweblib = static_library(
+  'bmcweblib',
+  srcfiles_bmcweb,
+  include_directories : incdir,
+  dependencies: bmcweb_dependencies,
+)
+
 # Generate the bmcweb executable
 executable(
   'bmcweb',
-  srcfiles_bmcweb + ['src/webserver_main.cpp'],
+  'src/webserver_main.cpp',
   include_directories : incdir,
   dependencies: bmcweb_dependencies,
+  link_with: bmcweblib,
   link_args: '-Wl,--gc-sections',
   install: true,
   install_dir:bindir
@@ -380,7 +388,8 @@
     foreach test_src : srcfiles_unittest
       test_bin = executable(
         fs.stem(test_src),
-        srcfiles_bmcweb + test_src,
+        test_src,
+        link_with: bmcweblib,
         include_directories : incdir,
         install_dir: bindir,
         dependencies: bmcweb_dependencies + [