CMake - use more strict compiler flags.

This commit is contained in:
Kimmo Varis 2009-12-20 10:45:57 +02:00
parent d86234b7fd
commit 9e2a42ebf9
4 changed files with 30 additions and 0 deletions

View File

@ -27,6 +27,13 @@ set(CHECK_LIBS
)
endif (WIN32 AND NOT CYGWIN)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS}
"-Wall -Wextra -pedantic"
)
endif (CMAKE_COMPILER_IS_GNUCXX)
include_directories (${CPPCHECK_SOURCE_DIR}/lib)
ADD_EXECUTABLE(cppcheck ${CHECKCLI_SRCS})
TARGET_LINK_LIBRARIES(cppcheck ${CHECK_LIBS})

View File

@ -100,6 +100,13 @@ set(CHECK_LIBS
)
endif (WIN32 AND NOT CYGWIN)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS}
"-Wall"
)
endif (CMAKE_COMPILER_IS_GNUCXX)
# Generate rules for building source files from the resources
QT4_ADD_RESOURCES(CHECK_RCC_SRCS ${CHECK_RCCS})

View File

@ -1,6 +1,8 @@
# Minimal CMake build file to build static cppcheck library
# This static library is used to build executables:
# - cli
# - tests
# - Qt GUI
SET(CHECKLIB_SRCS
checkautovariables.cpp
@ -24,5 +26,12 @@ SET(CHECKLIB_SRCS
tokenize.cpp
)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS}
"-Wall -Wextra -pedantic"
)
endif (CMAKE_COMPILER_IS_GNUCXX)
ADD_LIBRARY(checklib STATIC ${CHECKLIB_SRCS})

View File

@ -41,6 +41,13 @@ set(CHECK_LIBS
)
endif (WIN32 AND NOT CYGWIN)
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS
${CMAKE_CXX_FLAGS}
"-Wall -Wextra -pedantic"
)
endif (CMAKE_COMPILER_IS_GNUCXX)
include_directories (${CPPCHECK_SOURCE_DIR}/lib)
ADD_EXECUTABLE(test ${CHECKTEST_SRCS})
TARGET_LINK_LIBRARIES(test ${CHECK_LIBS})