CMake - use more strict compiler flags.
This commit is contained in:
parent
d86234b7fd
commit
9e2a42ebf9
|
@ -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})
|
||||
|
|
|
@ -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})
|
||||
|
||||
|
|
|
@ -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})
|
||||
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Reference in New Issue