From 9b2c64529495f68cf9d33057ed6f62b01860da0c Mon Sep 17 00:00:00 2001 From: Jacek Kalwas Date: Thu, 27 Feb 2020 17:59:20 +0100 Subject: [PATCH] build: add option to disable building examples If examples are not needed using that option can reduce build time and output logs so it is easier to spot most important issues/warnings. Signed-off-by: Jacek Kalwas Change-Id: Id279cba96ddf25d50a8748555d511d21f243bd7e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1047 Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- CONFIG | 3 +++ Makefile | 3 ++- configure | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CONFIG b/CONFIG index 25be84fd7..b8fa8f728 100644 --- a/CONFIG +++ b/CONFIG @@ -73,6 +73,9 @@ CONFIG_TSAN=n # Build tests CONFIG_TESTS=y +# Build examples +CONFIG_EXAMPLES=y + # Directory that contains the desired SPDK environment library. # By default, this is implemented using DPDK. CONFIG_ENV= diff --git a/Makefile b/Makefile index 4d98e4485..e4c645579 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,8 @@ include $(SPDK_ROOT_DIR)/mk/spdk.common.mk DIRS-y += lib DIRS-y += module DIRS-$(CONFIG_SHARED) += shared_lib -DIRS-y += examples app include +DIRS-y += app include +DIRS-$(CONFIG_EXAMPLES) += examples DIRS-$(CONFIG_TESTS) += test DIRS-$(CONFIG_IPSEC_MB) += ipsecbuild DIRS-$(CONFIG_ISAL) += isalbuild diff --git a/configure b/configure index f99f12aa6..45acc34d2 100755 --- a/configure +++ b/configure @@ -33,6 +33,7 @@ function usage() echo " --enable-pgo-capture Enable generation of profile guided optimization data" echo " --enable-pgo-use Use previously captured profile guided optimization data" echo " --disable-tests Disable building of tests" + echo " --disable-examples Disable building of examples" echo "" echo "Specifying Dependencies:" echo "--with-DEPENDENCY[=path] Use the given dependency. Optionally, provide the" @@ -240,6 +241,12 @@ for i in "$@"; do --disable-tests) CONFIG[TESTS]=n ;; + --enable-examples) + CONFIG[EXAMPLES]=y + ;; + --disable-examples) + CONFIG[EXAMPLES]=n + ;; --enable-werror) CONFIG[WERROR]=y ;;