| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Copyright 2018 Google Inc. All rights reserved. |
| 4 |
# Use of this source code is governed by a BSD-style license that can be |
| 5 |
# found in the LICENSE file. |
| 6 |
|
| 7 |
set -e |
| 8 |
|
| 9 |
args="" |
| 10 |
src="" |
| 11 |
|
| 12 |
while [ "$1" ]; do |
| 13 |
arg=$1 |
| 14 |
|
| 15 |
args="$args $1" |
| 16 |
shift |
| 17 |
|
| 18 |
if [ "$arg" == "-c" ]; then |
| 19 |
src=$1 |
| 20 |
|
| 21 |
args="$args $1" |
| 22 |
shift |
| 23 |
fi |
| 24 |
done |
| 25 |
|
| 26 |
# Ignore third party code (which we don't control). Generally it's found in //third_party/ |
| 27 |
# but is also found in //src/gpu/vk/vulkanmemoryallocator and in a generated folder when building |
| 28 |
# Dawn using CMake |
| 29 |
if [ "$src" ] && [[ "$src" != *"third_party"* ]] && [[ "$src" != *"vulkanmemoryallocator"* ]] && [[ "$src" != *"cmake_"* ]]; then |
| 30 |
clang-tidy -quiet -header-filter='.*' -warnings-as-errors='*' $src -- $args |
| 31 |
fi |
| 32 |
exec clang++ $args |
| 33 |
|