From 9022a59e9908b51b9d6bd82381f6d994bfa702b7 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 6 Mar 2018 15:39:04 -0700 Subject: [PATCH] configure: add --disable-tests option Change-Id: Icb6f3d8cf32e630a53b0c9e362306a09b0a49139 Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/402966 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu --- CONFIG | 3 +++ Makefile | 3 ++- configure | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CONFIG b/CONFIG index 28f4ab0e8..951aa2158 100644 --- a/CONFIG +++ b/CONFIG @@ -55,6 +55,9 @@ CONFIG_UBSAN?=n # Build with Thread Sanitizer enabled CONFIG_TSAN?=n +# Build tests +CONFIG_TESTS?=y + # Directory that contains the desired SPDK environment library. # By default, this is implemented using DPDK. CONFIG_ENV?=$(SPDK_ROOT_DIR)/lib/env_dpdk diff --git a/Makefile b/Makefile index e7d2d547e..25b1fbab8 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,8 @@ S := SPDK_ROOT_DIR := $(CURDIR) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -DIRS-y += lib test examples app include +DIRS-y += lib examples app include +DIRS-$(CONFIG_TESTS) += test .PHONY: all clean $(DIRS-y) config.h CONFIG.local mk/cc.mk cc_version cxx_version diff --git a/configure b/configure index 1531ca34c..6804bfc33 100755 --- a/configure +++ b/configure @@ -21,6 +21,7 @@ function usage() echo " --enable-ubsan Enable undefined behavior sanitizer" echo " --enable-coverage Enable code coverage tracking" echo " --enable-lto Enable link-time optimization" + echo " --disable-tests Disable building of tests" echo " --with-env=path Use an alternate environment implementation" echo "" echo "Specifying Dependencies:" @@ -101,6 +102,12 @@ for i in "$@"; do --disable-lto) CONFIG_LTO=n ;; + --enable-tests) + CONFIG_TESTS=y + ;; + --disable-tests) + CONFIG_TESTS=n + ;; --enable-werror) CONFIG_WERROR=y ;; @@ -233,6 +240,9 @@ fi if [ -n "$CONFIG_LTO" ]; then echo "CONFIG_LTO?=$CONFIG_LTO" >> CONFIG.local fi +if [ -n "$CONFIG_TESTS" ]; then + echo "CONFIG_TESTS?=$CONFIG_TESTS" >> CONFIG.local +fi if [ -n "$CONFIG_ASAN" ]; then echo "CONFIG_ASAN?=$CONFIG_ASAN" >> CONFIG.local fi