Merge branch 'iwyu' into 'master'

Added iwyu support

See merge request OpenMesh/OpenMesh!289
This commit is contained in:
Jan Möbius
2021-02-01 12:08:54 +00:00
6 changed files with 65 additions and 3 deletions

2
.gitignore vendored
View File

@@ -6,3 +6,5 @@ build*
.settings .settings
# ignore mac temporal files # ignore mac temporal files
.DS_Store .DS_Store
.idea
cmake-build*/

View File

@@ -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 # MAC tasks
# ----------------- # -----------------

View File

@@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
set -e
set -o pipefail
source CI/ci-linux-prepare.sh source CI/ci-linux-prepare.sh
echo -e "${OUTPUT}" 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 ../ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENMESH_BUILD_UNIT_TESTS=TRUE -DSTL_VECTOR_CHECKS=ON $OPTIONS ../
#build it if [ "$IWYU" == "IWYU" ]; then
make $MAKE_OPTIONS # 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 .. cd ..

View File

@@ -3,6 +3,7 @@
COMPILER=$1 COMPILER=$1
LANGUAGE=$2 LANGUAGE=$2
BUILD_TYPE=$3 BUILD_TYPE=$3
IWYU=$4
# Exit script on any error # Exit script on any error
set -e set -e
@@ -57,3 +58,9 @@ else
export BUILD_TYPE=debug export BUILD_TYPE=debug
BUILDPATH="$BUILDPATH-debug" BUILDPATH="$BUILDPATH-debug"
fi fi
if [ "$IWYU" == "IWYU" ]; then
echo "Include what you use enabled.";
BUILDPATH="$BUILDPATH-iwyu"
OPTIONS="$OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
fi

View File

@@ -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

View File

@@ -16,3 +16,5 @@ cppcheck:
{linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp11} {linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp11}
{linux-template-job.yml, COMPILER=gcc, LANGUAGE=cpp14} {linux-template-job.yml, COMPILER=gcc, LANGUAGE=cpp14}
{linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp14} {linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp14}
{linux-iwyu-job.yml, BUILDTYPE=release, COMPILER=clang, LANGUAGE=cpp14}