From 6e62183aa5ed4d4b48f04520a23697f083a74360 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Thu, 4 Mar 2021 16:49:35 +0000 Subject: [PATCH] Statically link the dawn_end2end_tests This allows us to enable white_box tests that use Tint. It fixes linking with symbols from both dawn_native statically and dynamically. Bug: dawn:696 Change-Id: I6a002ae5ec55a27b6bf7329c9ba301ce8014d521 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/43840 Reviewed-by: Corentin Wallez Reviewed-by: Ben Clayton Commit-Queue: Austin Eng --- src/tests/BUILD.gn | 13 +++++++------ src/tests/white_box/QueryInternalShaderTests.cpp | 3 --- src/utils/BUILD.gn | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/tests/BUILD.gn b/src/tests/BUILD.gn index a0baaf2eae..dd1d74f6b1 100644 --- a/src/tests/BUILD.gn +++ b/src/tests/BUILD.gn @@ -264,7 +264,9 @@ source_set("dawn_end2end_tests_sources") { "${dawn_root}/src/common", "${dawn_root}/src/dawn:dawn_proc", "${dawn_root}/src/dawn:dawncpp", - "${dawn_root}/src/dawn_native", + + # Statically linked because the end2end white_box tests use Dawn internals. + "${dawn_root}/src/dawn_native:dawn_native_static", "${dawn_root}/src/dawn_wire", "${dawn_root}/src/utils:dawn_utils", ] @@ -390,12 +392,11 @@ source_set("dawn_white_box_tests_sources") { "${dawn_root}/src/dawn:dawn_proc", "${dawn_root}/src/dawn:dawncpp", "${dawn_root}/src/dawn_native:dawn_native_sources", + + # Statically linked because the end2end white_box tests use Dawn internals. + "${dawn_root}/src/dawn_native:dawn_native_static", "${dawn_root}/src/dawn_wire", "${dawn_root}/src/utils:dawn_utils", - - # Static because the tests both link against and have dawn_native - # sources. MSVC errors when both importing and exporting symbols. - "${dawn_root}/src/dawn_native:dawn_native_static", ] sources = [ "DawnTest.h" ] @@ -448,7 +449,7 @@ test("dawn_end2end_tests") { "${dawn_root}/src/common", "${dawn_root}/src/dawn:dawn_proc", "${dawn_root}/src/dawn:dawncpp", - "${dawn_root}/src/dawn_native", + "${dawn_root}/src/dawn_native:dawn_native_static", "${dawn_root}/src/dawn_wire", "${dawn_root}/src/utils:dawn_utils", ] diff --git a/src/tests/white_box/QueryInternalShaderTests.cpp b/src/tests/white_box/QueryInternalShaderTests.cpp index ce2e705f19..e0ad381713 100644 --- a/src/tests/white_box/QueryInternalShaderTests.cpp +++ b/src/tests/white_box/QueryInternalShaderTests.cpp @@ -88,9 +88,6 @@ class QueryInternalShaderTests : public DawnTest {}; TEST_P(QueryInternalShaderTests, TimestampComputeShader) { DAWN_SKIP_TEST_IF(UsesWire()); - // TODO(bclayton): DLL symbol linker issue? - DAWN_SKIP_TEST_IF(HasToggleEnabled("use_tint_generator") && IsWindows()); - constexpr uint32_t kTimestampCount = 10u; // A gpu frequency on Intel D3D12 (ticks/second) constexpr uint64_t kGPUFrequency = 12000048u; diff --git a/src/utils/BUILD.gn b/src/utils/BUILD.gn index 1884d8ffb1..ce561b3b89 100644 --- a/src/utils/BUILD.gn +++ b/src/utils/BUILD.gn @@ -88,7 +88,7 @@ static_library("dawn_utils") { deps = [ "${dawn_root}/src/common", "${dawn_root}/src/dawn:dawn_proc", - "${dawn_root}/src/dawn_native", + "${dawn_root}/src/dawn_native:dawn_native_headers", "${dawn_root}/src/dawn_wire", "${dawn_shaderc_dir}:libshaderc", ]