aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Stange <stange@google.com>2019-05-06 19:13:22 -0400
committerAnthony Stange <stange@google.com>2019-05-08 16:24:57 -0400
commit5608ae4f4af6877a9322db82ae3b7d5d2a5b1d18 (patch)
tree3c164b1cb839ce7522ad54913dd4922575f0d2b3
parentf36803f3a09c330573e8805c618a69e8418552e0 (diff)
downloadchre-5608ae4f4af6877a9322db82ae3b7d5d2a5b1d18.tar.gz
Don't require compiling default static nanoapps
The default static nanoapps the CHRE team provides may not be needed in certain builds. Allow others to avoid compiling them if necessary. Bug: 131912580 Test: compile Change-Id: I55b0eacc283c0d88393a8bb15edb502baf3aa8b8
-rw-r--r--Makefile1
-rw-r--r--core/static_nanoapps.cc8
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 865372b0..5943409a 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,7 @@ OUTPUT_NAME = libchre
COMMON_CFLAGS += -DCHRE_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
COMMON_CFLAGS += -DNANOAPP_MINIMUM_LOG_LEVEL=CHRE_LOG_LEVEL_DEBUG
COMMON_CFLAGS += -DCHRE_ENABLE_DEBUG_DUMP
+COMMON_CFLAGS += -DCHRE_INCLUDE_DEFAULT_STATIC_NANOAPPS
ifneq ($(CHRE_ASSERTIONS_ENABLED), false)
COMMON_CFLAGS += -DCHRE_ASSERTIONS_ENABLED
diff --git a/core/static_nanoapps.cc b/core/static_nanoapps.cc
index dc571c61..d0f86156 100644
--- a/core/static_nanoapps.cc
+++ b/core/static_nanoapps.cc
@@ -14,7 +14,15 @@
* limitations under the License.
*/
+// If the CHRE build variant wants to supply its own static nanoapps, include
+// chre/platform/static_nanoapp_init.h in the nanoapp to include and define
+// CHRE_STATIC_NANOAPP_INIT with the appropriate parameters (see examples under
+// chre/apps/). Then, define the UniquePtr created by CHRE_STATIC_NANOAPP_INIT
+// similar to chre/apps/apps.h and add that variable to kStaticNanoappList
+// below.
+#ifdef CHRE_INCLUDE_DEFAULT_STATIC_NANOAPPS
#include "chre/apps/apps.h"
+#endif // CHRE_INCLUDE_DEFAULT_STATIC_NANOAPPS
#include "chre/core/event_loop_manager.h"
#include "chre/core/static_nanoapps.h"
#include "chre/util/macros.h"