Added cmake-linter support

This commit is contained in:
seleznevae 2019-04-12 20:58:31 +03:00
parent b7da40cbbc
commit ee6bd827ee
2 changed files with 11 additions and 4 deletions

View File

@ -7,6 +7,7 @@ matrix:
compiler: gcc compiler: gcc
before_script: before_script:
- pip install --user cpp-coveralls - pip install --user cpp-coveralls
- pip install cmakelint
env: env:
- BASIC_LINUX_GCC=yes - BASIC_LINUX_GCC=yes
addons: addons:
@ -132,6 +133,12 @@ script:
export CXX=${FORT_CXX_COMPILER}; export CXX=${FORT_CXX_COMPILER};
fi fi
# check CMakeLists.txt
- |
if [ "${BASIC_LINUX_GCC}" = "yes" ]; then
cmakelint CMakeLists.txt
fi
# basic build with old c standard (use gnu89 instead of c89 because some functions are not defines in c89) # basic build with old c standard (use gnu89 instead of c89 because some functions are not defines in c89)
- cd lib - cd lib
- ${CC} -Wall -Wextra -Werror --std=gnu89 -DFT_CONGIG_HAVE_WCHAR fort.c -c -o fort.o - ${CC} -Wall -Wextra -Werror --std=gnu89 -DFT_CONGIG_HAVE_WCHAR fort.c -c -o fort.o

View File

@ -79,7 +79,7 @@ endif("${FORT_COMPILER}" STREQUAL "MSVC")
# Sources and executables # Sources and executables
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
FILE(GLOB_RECURSE FortHeaders "lib/*.h" "lib/*.hpp" "tests/*.h" "tests/*.hpp" "src/*.h") file(GLOB_RECURSE FortHeaders "lib/*.h" "lib/*.hpp" "tests/*.h" "tests/*.hpp" "src/*.h")
add_custom_target(headers SOURCES ${FortHeaders}) add_custom_target(headers SOURCES ${FortHeaders})
@ -151,9 +151,9 @@ add_executable(${PROJECT_NAME}_test_cpp
${TEST_SOURCES_CPP}) ${TEST_SOURCES_CPP})
if(FORT_CXX_BUILD) if(FORT_CXX_BUILD)
SET_SOURCE_FILES_PROPERTIES(${FORT_DEV_SOURCES} PROPERTIES LANGUAGE CXX) set_source_files_properties(${FORT_DEV_SOURCES} PROPERTIES LANGUAGE CXX)
SET_SOURCE_FILES_PROPERTIES(${EXAMPLE_SOURCES} PROPERTIES LANGUAGE CXX) set_source_files_properties(${EXAMPLE_SOURCES} PROPERTIES LANGUAGE CXX)
SET_SOURCE_FILES_PROPERTIES(${TEST_SOURCES} PROPERTIES LANGUAGE CXX) set_source_files_properties(${TEST_SOURCES} PROPERTIES LANGUAGE CXX)
endif(FORT_CXX_BUILD) endif(FORT_CXX_BUILD)