From d7680154981c54989bcbcab81173791dc1805512 Mon Sep 17 00:00:00 2001 From: YohanPipereau Date: Tue, 12 Mar 2019 14:15:26 +0100 Subject: Fix Cmake build environment and harden Warnings -Remove unused sweetcomb CmakeList.txt Warnings -Add more Warnings to plugins, scvpp and gNMI Cmake projects -Remove unused/useless Cmake options in CmakeList files & add comments -Improve gNMI CMakeList.txt and make it independant of a gRPC cmake build for later package integration. -Add FindGRPC.cmake -Remove the use of CXX17 variant and use a dedicated Cmake module for gRPC Change-Id: Iafa3c031d12802e8d8c914cbce6b119c2a5c4800 Signed-off-by: Yohan Pipereau --- src/scvpp/src/CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/scvpp/src/CMakeLists.txt') diff --git a/src/scvpp/src/CMakeLists.txt b/src/scvpp/src/CMakeLists.txt index 6869a4b..71a891f 100644 --- a/src/scvpp/src/CMakeLists.txt +++ b/src/scvpp/src/CMakeLists.txt @@ -13,8 +13,6 @@ # limitations under the License. # -include(GNUInstallDirs) - # scvpp sources set(SCVPP_SOURCES sc_vpp_comm.c @@ -33,7 +31,15 @@ set(SCVPP_HEADERS sc_vpp_nat.h ) -set(CMAKE_C_FLAGS " -g -O0 -fpic -fPIC -std=gnu99 -Wl,-rpath-link=/usr/lib") +# Generate a compile_commands.json with compile options +set(CMAKE_EXPORT_COMPILE_COMMANDS 1) + +#set compiler and linker flags +set(RIGOROUS_C_FLAGS "-Wlogical-op -Wformat=2") +set(CMAKE_C_FLAGS "-Wall -Wextra -std=gnu99 ${RIGOROUS_C_FLAGS}") +set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -std=gnu99 -g -O0 ${RIGOROUS_C_FLAGS}") +#NDEBUG to skip assert checks +set(CMAKE_C_FLAGS_RELEASE "-Wall -Wextra -std=gnu99 -DNDEBUG -O2 ${RIGOROUS_C_FLAGS}") # libraries to link with set(LINK_LIBRARIES vlibmemoryclient vapiclient vppapiclient svm vppinfra pthread rt dl) -- cgit 1.2.3-korg