mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-04 09:46:02 -04:00
Added a cppcheck rule to the "all" target
- Travis: apt-get install cppcheck
This commit is contained in:
parent
c93b461628
commit
1af6930fc7
@ -4,6 +4,10 @@ compiler:
|
||||
- gcc
|
||||
- clang
|
||||
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq cppcheck
|
||||
|
||||
# using a symbolic link to get the "make test" to work as if launched from the root directorys
|
||||
before_script:
|
||||
- mkdir build
|
||||
|
@ -27,6 +27,13 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_definitions (-rdynamic -fstack-protector-all -Wall -Wextra -pedantic -Weffc++ -Wformat-security -Winit-self -Wswitch-default -Wswitch-enum -Wfloat-equal -Wundef -Wshadow -Wcast-qual -Wconversion -Wlogical-op -Winline -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn)
|
||||
endif ()
|
||||
|
||||
# add a cppcheck target to the "all" target
|
||||
add_custom_target(cppcheck
|
||||
ALL
|
||||
COMMAND cppcheck -j 4 cppcheck --enable=style,portability,performance,information --quiet --template='{file}:{line}: warning: cppcheck: {message} [{severity}/{id}]' src
|
||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# add the subdirectory containing the CMakeLists.txt of the wrapper library
|
||||
add_subdirectory (src)
|
||||
|
6
Makefile
6
Makefile
@ -39,7 +39,7 @@ SQLITE_EXAMPLE1_OBJECTS = \
|
||||
|
||||
### Targets: ###
|
||||
|
||||
all: $(BUILD) $(BUILD)/example1
|
||||
all: $(BUILD) $(BUILD)/example1 cppcheck
|
||||
|
||||
clean:
|
||||
rm -f $(BUILD)/*.o
|
||||
@ -69,8 +69,10 @@ $(BUILD)/Statement.o: src/Statement.cpp
|
||||
$(BUILD)/Transaction.o: src/Transaction.cpp
|
||||
$(CXX) -c -o $@ $(SQLITE_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
||||
cppcheck:
|
||||
cppcheck -j 4 cppcheck --enable=style --quiet --template='{file}:{line}: warning: cppcheck: {message} [{severity}/{id}]' src
|
||||
|
||||
.PHONY: all clean
|
||||
.PHONY: all clean cppcheck
|
||||
|
||||
|
||||
# Dependencies tracking:
|
||||
|
Loading…
x
Reference in New Issue
Block a user