[openweave] Add minimal sub-target

Adds the openweave-core-minimal target for use cases that only intend to
use small, limited parts of Weave.

Change-Id: Idc7d217fc9399c1a10c363653100b36d68546a6c
diff --git a/BUILD.gn b/BUILD.gn
index 2987df6..c7644f2 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -19,3 +19,9 @@
   public_configs = [ "//third_party/openweave-core/src/include:public" ]
   public_deps = [ "//third_party/openweave-core/src/include:common" ]
 }
+
+# Provides OpenWeave plus the minimal dependencies to build.
+source_set("openweave-core-minimal") {
+  public_deps = [ ":openweave-core" ]
+  sources = [ "src/adaptations/device-layer/PersistedStorage-Stub.cpp" ]
+}
diff --git a/src/adaptations/device-layer/PersistedStorage-Stub.cpp b/src/adaptations/device-layer/PersistedStorage-Stub.cpp
new file mode 100644
index 0000000..72a543c
--- /dev/null
+++ b/src/adaptations/device-layer/PersistedStorage-Stub.cpp
@@ -0,0 +1,35 @@
+// Copyright 2021 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <Weave/Core/WeaveError.h>
+
+namespace nl {
+namespace Weave {
+namespace Platform {
+namespace PersistedStorage {
+
+// Dummy implementations of PersistedStorage platform methods. When using the
+// subset of openweave that does not require PersistedStorage to operate, but
+// must still satisfy the linker, these implementations can be used instead.
+//
+// NOTE: Do *NOT* use this implementation if the full functionality of
+// OpenWeave is used, this is intended only as a way to satisfy the linker
+// for uses that use a small, limited subset of OpenWeave that do not require
+// these to be implemented.
+
+WEAVE_ERROR Read(const char *aKey, uint32_t &aValue)
+{
+    return WEAVE_ERROR_UNSUPPORTED_WEAVE_FEATURE;
+}
+
+WEAVE_ERROR Write(const char *aKey, uint32_t aValue)
+{
+    return WEAVE_ERROR_UNSUPPORTED_WEAVE_FEATURE;
+}
+
+} // PersistentStorage
+} // Platform
+} // Weave
+} // nl
+