From fd3717fa7cbc2495d41f6ca2620803a9324db188 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Fri, 14 Dec 2018 08:28:55 +0000 Subject: [PATCH] Fix the build with only the OpenGL and Null backends enabled BUG=chromium:914375 Change-Id: I07dbdbdb7518ac6b9800483f570fe97c16f08ee1 Reviewed-on: https://dawn-review.googlesource.com/c/3243 Reviewed-by: Stephen White Reviewed-by: Kai Ninomiya Commit-Queue: Corentin Wallez --- src/fuzzers/BUILD.gn | 2 +- third_party/BUILD.gn | 45 +++++++++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/fuzzers/BUILD.gn b/src/fuzzers/BUILD.gn index 00f378940c..80ecb2f6b9 100644 --- a/src/fuzzers/BUILD.gn +++ b/src/fuzzers/BUILD.gn @@ -76,7 +76,7 @@ static_library("dawn_spirv_cross_fuzzer_common") { "DawnSPIRVCrossFuzzer.h", ] public_deps = [ - "${dawn_top_level}/third_party:spirv_cross", + "${dawn_top_level}/third_party:spirv_cross_full_for_fuzzers", ] } diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn index 070a5c9448..bc1d359f67 100644 --- a/third_party/BUILD.gn +++ b/third_party/BUILD.gn @@ -16,10 +16,6 @@ import("../scripts/dawn_overrides_with_defaults.gni") import("../scripts/dawn_features.gni") import("//build_overrides/build.gni") -if (build_with_chromium) { - import("//testing/libfuzzer/fuzzer_test.gni") -} - is_msvc = is_win && !is_clang ############################################################################### @@ -49,9 +45,7 @@ config("spirv_cross_public") { defines = [ "SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS" ] } -static_library("spirv_cross") { - public_configs = [ ":spirv_cross_public" ] - +config("spirv_cross_internal") { if (!is_msvc) { cflags_cc = [ "-Wno-implicit-fallthrough", @@ -62,6 +56,11 @@ static_library("spirv_cross") { # Disable "not all control paths return a value" warning. cflags_cc = [ "/wd4715" ] } +} + +static_library("spirv_cross") { + public_configs = [ ":spirv_cross_public" ] + configs += [ ":spirv_cross_internal" ] sources = [ "${spirv_cross_dir}/GLSL.std.450.h", @@ -75,12 +74,7 @@ static_library("spirv_cross") { need_glsl_cross = dawn_enable_opengl - is_fuzzing = false - if (build_with_chromium) { - is_fuzzing = use_fuzzing_engine - } - - if (dawn_enable_d3d12 || is_fuzzing) { + if (dawn_enable_d3d12) { sources += [ "${spirv_cross_dir}/spirv_hlsl.cpp", "${spirv_cross_dir}/spirv_hlsl.hpp", @@ -88,7 +82,7 @@ static_library("spirv_cross") { need_glsl_cross = true } - if (dawn_enable_metal || is_fuzzing) { + if (dawn_enable_metal) { sources += [ "${spirv_cross_dir}/spirv_msl.cpp", "${spirv_cross_dir}/spirv_msl.hpp", @@ -96,7 +90,7 @@ static_library("spirv_cross") { need_glsl_cross = true } - if (need_glsl_cross || is_fuzzing) { + if (need_glsl_cross) { sources += [ "${spirv_cross_dir}/spirv_glsl.cpp", "${spirv_cross_dir}/spirv_glsl.hpp", @@ -104,6 +98,27 @@ static_library("spirv_cross") { } } +static_library("spirv_cross_full_for_fuzzers") { + public_configs = [ ":spirv_cross_public" ] + configs += [ ":spirv_cross_internal" ] + + sources = [ + "${spirv_cross_dir}/GLSL.std.450.h", + "${spirv_cross_dir}/spirv.hpp", + "${spirv_cross_dir}/spirv_cfg.cpp", + "${spirv_cross_dir}/spirv_cfg.hpp", + "${spirv_cross_dir}/spirv_common.hpp", + "${spirv_cross_dir}/spirv_cross.cpp", + "${spirv_cross_dir}/spirv_cross.hpp", + "${spirv_cross_dir}/spirv_glsl.cpp", + "${spirv_cross_dir}/spirv_glsl.hpp", + "${spirv_cross_dir}/spirv_hlsl.cpp", + "${spirv_cross_dir}/spirv_hlsl.hpp", + "${spirv_cross_dir}/spirv_msl.cpp", + "${spirv_cross_dir}/spirv_msl.hpp", + ] +} + # An empty Vulkan target to add the include dirs and list the sources # for the header inclusion check. config("vulkan_headers_public") {