From ccf420024f0b7fd84332996cf3dd52051ffdf6c8 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann <hoffmann@cs.fau.de> Date: Fri, 14 Feb 2014 19:38:31 +0100 Subject: [PATCH] Coding guideline: Added editorconfig Feel free to use editorconfig together with the according emacs/vi/sublime plugin. Silently removed old gen_build_env. Put /usr/include to cppcheck include paths, as we are actually using these headers in i386.. (Should we really do that?!) Change-Id: I31666c088f2d1a6c0f2f3a99af1af35d52d2767f --- .editorconfig | 35 +++++++++++++++++++ gen_build_env.sh | 61 ---------------------------------- static_analysis/CMakeLists.txt | 4 +-- 3 files changed, 37 insertions(+), 63 deletions(-) create mode 100644 .editorconfig delete mode 100755 gen_build_env.sh diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..07d1cb2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,35 @@ +root = true + +[*] +end_of_line = LF +charset = utf-8 + +[*.cc] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 + +[*.c] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 + +[*.h] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 + + +[*.py] +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +max_line_length = 80 + diff --git a/gen_build_env.sh b/gen_build_env.sh deleted file mode 100755 index 505fdf3..0000000 --- a/gen_build_env.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# -# Helper script generate a build environment. -# -# !!! Call the script from within your out-of-source build dir !!!! -# -# author: Martin Hoffmann, Peter Ulbrich -# -#set -x -echo "============================" -echo "Generating Build Environment" -echo "============================" -echo "" - -# Get repository base dir from script location -REPODIR=$(dirname $0)/ -GENERATOR="Unix Makefiles" - -if [ "$2" == "eclipse" ] -then - GENERATOR="Eclipse CDT4 - Unix Makefiles" -fi - -if [ "$2" == "ninja" ] -then - GENERATOR="Eclipse CDT4 - Ninja" -fi - -if [ "$1" == "i386" ] -then - ARCH=i386 -elif [ "$1" == "posix" ] -then - ARCH=posix -else - # Default Architecture i386 - ARCH=i386 - echo "Default architecture: $ARCH" -fi - -# Call cmake appropriately -if [ $ARCH ] -then - echo "Setting up build environment [$ARCH]:" - cmake $REPODIR -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE="$REPODIR/toolchain/$ARCH.cmake" -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "${GENERATOR}" -# We call cmake twice, as the crosscompiler linking does not work otherwise. Don't know why yet.. -# cmake $REPODIR -else - echo "Currently supported:" - echo " * i386" - echo " * posix" - echo "Per default an Eclipse Makefile project file is generated." - echo "To change to Ninja add 'ninja' as second parameter. (Needs cmake >= 2.8.9 !)" - echo "" - echo "Usage: " - echo " $0 [i386,posix] <ninja>" - echo "" - exit 1 -fi - diff --git a/static_analysis/CMakeLists.txt b/static_analysis/CMakeLists.txt index cb9fa3c..9091d48 100644 --- a/static_analysis/CMakeLists.txt +++ b/static_analysis/CMakeLists.txt @@ -16,10 +16,10 @@ if(CPPCHECK) foreach(dir ${INCLUDEDIRS}) file(APPEND ${CPPINCLUDES} "${dir}\n") endforeach() - if(BUILD_posix) +# if(BUILD_posix) file(APPEND ${CPPINCLUDES} "/usr/include\n") file(APPEND ${CPPINCLUDES} "/usr/include/linux\n") - endif() +# endif() add_custom_target( cppcheck -- GitLab