mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-26 21:30:07 +00:00
Fix BUILD.gn (#4378)
This change restricts BUILD.gn so that spirv-fuzz-related targets are only built when in a Chromium checkout. This is due to their dependence on protobuf, which is available in gn-friendly form in Chromium only. Fixes https://crbug.com/tint/987
This commit is contained in:
parent
2299b710de
commit
feb05446bb
37
BUILD.gn
37
BUILD.gn
@ -14,9 +14,9 @@
|
||||
|
||||
import("//build_overrides/build.gni")
|
||||
import("//build_overrides/spirv_tools.gni")
|
||||
import("//third_party/protobuf/proto_library.gni")
|
||||
if (build_with_chromium) {
|
||||
import("//testing/test.gni")
|
||||
import("//third_party/protobuf/proto_library.gni")
|
||||
}
|
||||
|
||||
spirv_headers = spirv_tools_spirv_headers_dir
|
||||
@ -878,15 +878,20 @@ static_library("spvtools_reduce") {
|
||||
configs += [ ":spvtools_internal_config" ]
|
||||
}
|
||||
|
||||
proto_library("spvtools_fuzz_proto") {
|
||||
if (build_with_chromium) {
|
||||
|
||||
# The spirv-fuzz library is only built when in a Chromium checkout
|
||||
# due to its dependency on protobuf.
|
||||
|
||||
proto_library("spvtools_fuzz_proto") {
|
||||
sources = [
|
||||
"source/fuzz/protobufs/spvtoolsfuzz.proto",
|
||||
]
|
||||
generate_python = false
|
||||
use_protobuf_full = true
|
||||
}
|
||||
}
|
||||
|
||||
static_library("spvtools_fuzz") {
|
||||
static_library("spvtools_fuzz") {
|
||||
sources = [
|
||||
"source/fuzz/added_function_reducer.cpp",
|
||||
"source/fuzz/added_function_reducer.h",
|
||||
@ -1282,11 +1287,10 @@ static_library("spvtools_fuzz") {
|
||||
":spvtools_opt",
|
||||
]
|
||||
public_deps = [ ":spvtools_headers" ]
|
||||
if (build_with_chromium) {
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
}
|
||||
configs += [ ":spvtools_internal_config" ]
|
||||
}
|
||||
}
|
||||
|
||||
group("SPIRV-Tools") {
|
||||
@ -1476,10 +1480,11 @@ executable("spirv-link") {
|
||||
configs += [ ":spvtools_internal_config" ]
|
||||
}
|
||||
|
||||
if (!is_ios && !spirv_is_winuwp) {
|
||||
if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
|
||||
|
||||
# iOS and UWP do not allow std::system calls which spirv-fuzz and
|
||||
# spirv-reduce require
|
||||
# iOS and UWP do not allow std::system calls which spirv-fuzz
|
||||
# requires. Additionally, spirv-fuzz is only built when in a
|
||||
# Chromium checkout due to its dependency on protobuf.
|
||||
|
||||
executable("spirv-fuzz") {
|
||||
sources = [ "tools/fuzz/fuzz.cpp" ]
|
||||
@ -1495,6 +1500,12 @@ if (!is_ios && !spirv_is_winuwp) {
|
||||
]
|
||||
configs += [ ":spvtools_internal_config" ]
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_ios && !spirv_is_winuwp) {
|
||||
|
||||
# iOS and UWP do not allow std::system calls which spirv-reduce
|
||||
# requires.
|
||||
|
||||
executable("spirv-reduce") {
|
||||
sources = [ "tools/reduce/reduce.cpp" ]
|
||||
@ -1519,10 +1530,10 @@ group("all_spirv_tools") {
|
||||
":spirv-opt",
|
||||
":spirv-val",
|
||||
]
|
||||
if (!is_ios && !spirv_is_winuwp && build_with_chromium) {
|
||||
deps += [ ":spirv-fuzz" ]
|
||||
}
|
||||
if (!is_ios && !spirv_is_winuwp) {
|
||||
deps += [
|
||||
":spirv-fuzz",
|
||||
":spirv-reduce",
|
||||
]
|
||||
deps += [ ":spirv-reduce" ]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user