Do not use Dawn's warnings for compiling Chromium's gtest main.
When building in Chromium, Dawn's gtest targets use sources files in Chromium so it can use Chromium's GTest harness. These source files were compiled with the "dawn_internal" config included. This made them include Dawn-specific warnings that trigger on parts of Chromium's //base. Instead compile these "main" files as separate source_sets without dawn_internal and link them in the dawn test executables. Bug: chromium:1075817 Change-Id: I573390ca3e6a7dfd1e8a949dc10ed268f0d0f63e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20520 Reviewed-by: Austin Eng <enga@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
c94f4a7a19
commit
2d79ef264e
|
@ -89,6 +89,31 @@ if (!build_with_chromium) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Wrapping of Chromium targets
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# These targets are separated because they are Chromium sources files that
|
||||||
|
# can't use the dawn_internal config, otherwise Dawn's warning flags get
|
||||||
|
# applied while compiling a bunch of Chromium's //base (via header inclusion)
|
||||||
|
if (build_with_chromium) {
|
||||||
|
source_set("dawn_unittests_main") {
|
||||||
|
testonly = true
|
||||||
|
deps = [ ":gmock_and_gtest" ]
|
||||||
|
sources = [ "//gpu/dawn_unittests_main.cc" ]
|
||||||
|
}
|
||||||
|
source_set("dawn_end2end_tests_main") {
|
||||||
|
testonly = true
|
||||||
|
deps = [ ":gmock_and_gtest" ]
|
||||||
|
sources = [ "//gpu/dawn_end2end_tests_main.cc" ]
|
||||||
|
}
|
||||||
|
source_set("dawn_perf_tests_main") {
|
||||||
|
testonly = true
|
||||||
|
deps = [ ":gmock_and_gtest" ]
|
||||||
|
sources = [ "//gpu/dawn_perf_tests_main.cc" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Dawn unittests
|
# Dawn unittests
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -198,7 +223,7 @@ test("dawn_unittests") {
|
||||||
# When building inside Chromium, use their gtest main function because it is
|
# When building inside Chromium, use their gtest main function because it is
|
||||||
# needed to run in swarming correctly.
|
# needed to run in swarming correctly.
|
||||||
if (build_with_chromium) {
|
if (build_with_chromium) {
|
||||||
sources += [ "//gpu/dawn_unittests_main.cc" ]
|
deps += [ ":dawn_unittests_main" ]
|
||||||
} else {
|
} else {
|
||||||
sources += [ "UnittestsMain.cpp" ]
|
sources += [ "UnittestsMain.cpp" ]
|
||||||
}
|
}
|
||||||
|
@ -386,7 +411,7 @@ test("dawn_end2end_tests") {
|
||||||
# When building inside Chromium, use their gtest main function because it is
|
# When building inside Chromium, use their gtest main function because it is
|
||||||
# needed to run in swarming correctly.
|
# needed to run in swarming correctly.
|
||||||
if (build_with_chromium) {
|
if (build_with_chromium) {
|
||||||
sources += [ "//gpu/dawn_end2end_tests_main.cc" ]
|
deps += [ ":dawn_end2end_tests_main" ]
|
||||||
} else {
|
} else {
|
||||||
sources += [ "End2EndTestsMain.cpp" ]
|
sources += [ "End2EndTestsMain.cpp" ]
|
||||||
}
|
}
|
||||||
|
@ -435,7 +460,7 @@ test("dawn_perf_tests") {
|
||||||
# When building inside Chromium, use their gtest main function because it is
|
# When building inside Chromium, use their gtest main function because it is
|
||||||
# needed to run in swarming correctly.
|
# needed to run in swarming correctly.
|
||||||
if (build_with_chromium) {
|
if (build_with_chromium) {
|
||||||
sources += [ "//gpu/dawn_perf_tests_main.cc" ]
|
deps += [ ":dawn_perf_tests_main" ]
|
||||||
} else {
|
} else {
|
||||||
sources += [ "PerfTestsMain.cpp" ]
|
sources += [ "PerfTestsMain.cpp" ]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue