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 <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-12-14 08:28:55 +00:00 committed by Commit Bot service account
parent ff9562f792
commit fd3717fa7c
2 changed files with 31 additions and 16 deletions
src/fuzzers
third_party

View File

@ -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",
]
}

45
third_party/BUILD.gn vendored
View File

@ -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") {