dawn-cmake/BUILD.gn
Corentin Wallez b31015b836 Split examples, test and utils in their own BUILD.gn
The basic change was to copy-paste targets in the new BUILD.gn files and
fixup paths / add includes. There's a couple more changes that had to be
done at the same time:

 - Multiple files need to know if GLFW is supported so the variable was
moved to dawn_features.gni.
 - The gtest_and_gmock target used to abstract between Dawn's copy of
GTest/GMock is only needed by tests and was moved in src/tests/BUILD.gn.
 - A leftover dawn_end2end_tests target is left in the main BUILD.gn
file that is an exact copy of the on in src/tests/BUILD.gn. This is
because the GN path is hardcoded in Chromium's isolate_map.pyl that also
can't support GN groups. The only way to move a target I could figure
out was to duplicate it temporarily.

Bug: chromium:1064305
Change-Id: I96820e9d6510b8c9b9112c3e6cd8df2413f04287
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19201
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-04-10 08:20:10 +00:00

109 lines
2.8 KiB
Plaintext

# Copyright 2018 The Dawn Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/build.gni")
import("scripts/dawn_features.gni")
import("scripts/dawn_overrides_with_defaults.gni")
group("all") {
testonly = true
deps = [
"src/fuzzers:dawn_fuzzers",
"src/tests:dawn_tests",
]
if (dawn_standalone) {
deps += [ "examples:dawn_samples" ]
}
}
###############################################################################
# Temporary Dawn end2end test target
###############################################################################
# It is not possible to move a target around with a proxy group without
# breaking swarming tests. This is a temporary target that is a duplicate of
# //src/tests:dawn_end2end_tests that's used temporarily so that we can land
# the split of src/tests/BUILD.gn in a Chromium roll and switch which targets
# the swarmed tests use.
import("//testing/test.gni")
test("dawn_end2end_tests") {
configs += [ "src/common:dawn_internal" ]
deps = [
"src/common",
"src/dawn:dawncpp",
"src/dawn:libdawn_proc",
"src/dawn_native",
"src/dawn_wire",
"src/tests:dawn_end2end_tests_sources",
"src/tests:dawn_white_box_tests_sources",
"src/tests:gmock_and_gtest",
"src/utils:dawn_utils",
]
sources = [
"src/tests/DawnTest.cpp",
"src/tests/DawnTest.h",
]
libs = []
# When building inside Chromium, use their gtest main function because it is
# needed to run in swarming correctly.
if (build_with_chromium) {
sources += [ "//gpu/dawn_end2end_tests_main.cc" ]
} else {
sources += [ "src/tests/End2EndTestsMain.cpp" ]
}
if (dawn_enable_opengl) {
deps += [ "src/utils:dawn_glfw" ]
}
if (is_chromeos) {
libs += [ "gbm" ]
}
}
###############################################################################
# Temporary groups
###############################################################################
# Temporary groups to make a 5-way patch to fix crbug.com/913171
group("dawn_unittests_temp_group") {
testonly = true
public_deps = [
"src/tests:dawn_unittests",
]
}
group("dawn_end2end_tests_temp_group") {
testonly = true
public_deps = [
":dawn_end2end_tests",
]
}
group("dawn_perf_tests_temp_group") {
testonly = true
public_deps = [
"src/tests:dawn_perf_tests",
]
data_deps = [
"src/tests:dawn_perf_tests",
]
}