Useful build commands:
- ninja Build VPP
- ninja config Start build configuration TUI
- ninja compdb Generate compile_commands.json
- ninja run Runs VPP using startup.conf in the build directory
- ninja debug Runs VPP inside GDB using startup.conf in the build directory
- ninja pkg-deb Create .deb packages
- ninja install Install VPP to $install_dir
+ ninja Build VPP
+ ninja set-build-type-* Change build type to <debug|release|gcov|...>
+ ninja config Start build configuration TUI
+ ninja compdb Generate compile_commands.json
+ ninja run Runs VPP using startup.conf in the build directory
+ ninja debug Runs VPP inside GDB using startup.conf in the build directory
+ ninja pkg-deb Create .deb packages
+ ninja install Install VPP to $install_dir
__EOF__
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UC)
-string(REPLACE ";" " " BUILD_TYPES "${BUILD_TYPES}")
+string(REPLACE ";" " " BUILD_TYPES_STR "${BUILD_TYPES}")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
- HELPSTRING "Build type - valid options are: ${BUILD_TYPES}")
+ HELPSTRING "Build type - valid options are: ${BUILD_TYPES_STR}")
##############################################################################
# link time optimizations
USES_TERMINAL
)
+foreach(bt ${BUILD_TYPES})
+ add_custom_target(set-build-type-${bt}
+ COMMAND cmake -DCMAKE_BUILD_TYPE:STRING=${bt} .
+ COMMENT "Changing build type to ${bt}"
+ USES_TERMINAL
+ )
+endforeach()
+
##############################################################################
# print configuration
##############################################################################