Commit 62331d00 authored by Mirko Bonadei's avatar Mirko Bonadei Committed by Commit Bot

Stop using -isystem and -imsvc because "gn check" ignores them.

Gn check can enforce dependencies only if the header is included with
an absolute path (from the root of the project) or if "include_dirs"
is used. It ignores -isystem and -imsvc since they are part of
cflags (and similar variants).

Since //third_party/abseil-cpp/absl:absl_include_config was using
-isystem and -imsvc only to sidestep compiler warnings in absl code,
it is good to try to switch back to include_dirs instead of adding
-isystem/-imsvc support to "gn check".

Bug: 862521
Change-Id: I9c2d01abad75023918a88f852e3080486dcafead
Reviewed-on: https://chromium-review.googlesource.com/1124478
Commit-Queue: Mirko Bonadei <mbonadei@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577535}
parent 07fcf075
......@@ -19,28 +19,7 @@ group("default") {
}
config("absl_include_config") {
# Using -isystem (with clang and GCC) and -imsvc (with clang-cl) instead of
# include_dirs (-I), so we don't need to suppress warnings coming from
# Abseil. Doing so would mask warnings in our own code.
if (is_win) {
if (is_clang) {
# clang-cl:
cflags = [
"-imsvc",
rebase_path(".", root_build_dir),
]
} else {
# MSVC doesn't have -isystem, in that case we fallback to include_dirs and
# we use the warning suppression flags defined in :absl_default_cflags_cc.
include_dirs = [ "." ]
}
} else {
# GCC or clang:
cflags = [
"-isystem",
rebase_path(".", root_build_dir),
]
}
include_dirs = [ "." ]
}
config("absl_define_config") {
......
......@@ -14,11 +14,21 @@ if (build_with_chromium) {
visibility = [ "*" ]
}
config("suppress_unguarded_availability") {
# TODO(bugs.webrtc.org/9557): Remove -Wno-unguarded-availability when
# abseil will support Xcode 9.0+ (it currently supports Xcode 7.3.1+
# which doesn't have -Wunguarded-availability and __builtin_available).
cflags = [
"-Wno-unguarded-availability",
]
}
source_set("time") {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [
"//build/config/compiler:no_chromium_code",
"//third_party/abseil-cpp:absl_default_cflags_cc",
":suppress_unguarded_availability",
]
public_configs = [ "//third_party/abseil-cpp:absl_include_config" ]
sources = [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment