diff --git a/.gitignore b/.gitignore index 210ba9f4..d0f731ed 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ build* .settings # ignore mac temporal files .DS_Store +.idea +cmake-build*/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5fa85660..10742901 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -321,6 +321,22 @@ test-release-clang-cpp14: +#----------- Job Informations: +# Type: Build: release +# OS: Linux +# Compiler: clang +# Language: cpp14 + +iwyu-release-clang-cpp14: + stage: build + script: "CI/ci-linux-build.sh clang cpp14 release IWYU" + image: graphics.rwth-aachen.de:4567/docker/docker/docker-openmesh-container + tags: [Docker] + artifacts: + paths: + - build-clang-cpp14-release-iwyu-Vector-Checks/compile_commands.json + - build-clang-cpp14-release-iwyu-Vector-Checks/iwyu.dump + # ----------------- # MAC tasks # ----------------- diff --git a/CI/ci-linux-build.sh b/CI/ci-linux-build.sh index db28ab29..42dca598 100755 --- a/CI/ci-linux-build.sh +++ b/CI/ci-linux-build.sh @@ -1,4 +1,6 @@ #!/bin/bash +set -e +set -o pipefail source CI/ci-linux-prepare.sh echo -e "${OUTPUT}" @@ -31,7 +33,25 @@ cd build-$BUILDPATH-Vector-Checks cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../ -#build it -make $MAKE_OPTIONS +if [ "$IWYU" == "IWYU" ]; then + # do iwyu check + if echo $(iwyu --version) | grep -q "0.11" + then + # support older tool version + iwyu_tool -j 4 -p . -- \ + --mapping_file=/usr/share/include-what-you-use/gcc.libc.imp \ + --mapping_file=/usr/share/include-what-you-use/clang-6.intrinsics.imp \ + | tee iwyu.dump + else + # current tool version + iwyu_tool -j 4 -p . -- \ + -Xiwyu --mapping_file=/usr/share/include-what-you-use/gcc.libc.imp \ + -Xiwyu --mapping_file=/usr/share/include-what-you-use/clang-6.intrinsics.imp \ + | tee iwyu.dump + fi +else + # build it + make $MAKE_OPTIONS +fi cd .. \ No newline at end of file diff --git a/CI/ci-linux-prepare.sh b/CI/ci-linux-prepare.sh index 9153abea..ce6ef2c6 100755 --- a/CI/ci-linux-prepare.sh +++ b/CI/ci-linux-prepare.sh @@ -3,6 +3,7 @@ COMPILER=$1 LANGUAGE=$2 BUILD_TYPE=$3 +IWYU=$4 # Exit script on any error set -e @@ -56,4 +57,10 @@ if [ "$BUILD_TYPE" == "release" ]; then else export BUILD_TYPE=debug BUILDPATH="$BUILDPATH-debug" -fi \ No newline at end of file +fi + +if [ "$IWYU" == "IWYU" ]; then + echo "Include what you use enabled."; + BUILDPATH="$BUILDPATH-iwyu" + OPTIONS="$OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" +fi diff --git a/CI/gitlab-ci/linux-iwyu-job.yml b/CI/gitlab-ci/linux-iwyu-job.yml new file mode 100644 index 00000000..0e5838aa --- /dev/null +++ b/CI/gitlab-ci/linux-iwyu-job.yml @@ -0,0 +1,15 @@ +#----------- Job Informations: +# Type: Build: {{BUILDTYPE}} +# OS: Linux +# Compiler: {{COMPILER}} +# Language: {{LANGUAGE}} + +iwyu-{{BUILDTYPE}}-{{COMPILER}}-{{LANGUAGE}}: + stage: build + script: "CI/ci-linux-build.sh {{COMPILER}} {{LANGUAGE}} {{BUILDTYPE}} IWYU" + image: graphics.rwth-aachen.de:4567/docker/docker/docker-openmesh-container + tags: [Docker] + artifacts: + paths: + - build-{{COMPILER}}-{{LANGUAGE}}-{{BUILDTYPE}}-iwyu-Vector-Checks/compile_commands.json + - build-{{COMPILER}}-{{LANGUAGE}}-{{BUILDTYPE}}-iwyu-Vector-Checks/iwyu.dump diff --git a/CI/gitlab-ci/linux.yml b/CI/gitlab-ci/linux.yml index 1ce9de13..fdc85ffe 100644 --- a/CI/gitlab-ci/linux.yml +++ b/CI/gitlab-ci/linux.yml @@ -16,3 +16,5 @@ cppcheck: {linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp11} {linux-template-job.yml, COMPILER=gcc, LANGUAGE=cpp14} {linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp14} + +{linux-iwyu-job.yml, BUILDTYPE=release, COMPILER=clang, LANGUAGE=cpp14}