Check explicitly for clang++ usage gcc might also be used on linux instead of clang++ but the current implementation would still include these clang++ specific flags which are not supported by gcc. Change-Id: I1345bff16d9bf07f1c81506fef4749963182f299 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/13900 Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Brett Wilson <brettw@chromium.org>
diff --git a/build/gen.py b/build/gen.py index 6738f44..ce600e7 100755 --- a/build/gen.py +++ b/build/gen.py
@@ -446,8 +446,8 @@ '-std=c++17' ]) - # flag not supported by gcc/g++. - if not (platform.is_aix() or platform.is_msys() or platform.is_mingw()): + # flags not supported by gcc/g++. + if cxx == 'clang++': cflags.extend(['-Wrange-loop-analysis', '-Wextra-semi-stmt']) if platform.is_linux() or platform.is_mingw() or platform.is_msys():