--native-only, -n Only compile for Native CPU (no multiarch)
--option, -o Enable specific VPP options (fib8, fib16)
--platform, -p Specify target platform
+ --plugins, -P Specify list of plugins to be built
--prefix, -r Specify prefix path (default: $prefix_path)
--sanitize, -s Enable sanitizer (mem)
--verbose, -v Verbose output of this script
exit 1
fi
;;
+ -P|--plugins)
+ if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
+ plugins=$2
+ shift 2
+ else
+ echo "Error: Argument for $1 is missing" >&2
+ exit 1
+ fi
+ ;;
-r|--prefix)
if [ -n "$2" ] && [ ${2:0:1} != "-" ]; then
prefix_path=$2
$wipe && git clean -fdx --exclude=startup.\*
+[[ -v plugins ]] && args+=("-DVPP_PLUGINS=${plugins}")
+
(
$verbose && set -o xtrace
cmake ${args[@]} -G Ninja -S ${src_dir}/src -B ${build_dir}
${CMAKE_CURRENT_BINARY_DIR}
)
+set(VPP_PLUGINS
+ ""
+ CACHE
+ STRING "Comma-separated list of plugins included in build"
+)
+
+if(NOT VPP_PLUGINS STREQUAL "")
+ string(REGEX REPLACE "[ \t]*,[ \t]*" ";" _plugins "${VPP_PLUGINS}")
+ list(FILTER _plugins EXCLUDE REGEX "^$")
+
+ foreach(p IN LISTS _plugins)
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${p}/CMakeLists.txt")
+ add_subdirectory("${p}")
+ else()
+ message(FATAL_ERROR
+ "VPP plugin '${p}' not found: expected '${CMAKE_CURRENT_SOURCE_DIR}/${p}/CMakeLists.txt'")
+ endif()
+ endforeach()
+ return()
+endif()
+
##############################################################################
# find and add all plugin subdirs
##############################################################################