mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-22 11:40:05 +00:00
BUILD.gn: Fix standalone GN builds (#4765)
Standalone projects that depend on both SPIRV-Tools and SwiftShader failed to have Ninja build files generated because `build_with_chromium` is false for both of them and cause the executables to be declared twice. This change causes `build_with_chromium` builds to declare the executables, but only for the copy in `//third_party`. The path for that was also corrected to include the `vulkan-deps` and `src` subdirectories. Builds from the Fuchsia tree also declare the executable targets. This change was tested with a Chromium build and a "standalone" Dawn build. Bug: b/158002593
This commit is contained in:
parent
05745cc9d4
commit
7841afd98e
11
BUILD.gn
11
BUILD.gn
@ -20,10 +20,15 @@ if (build_with_chromium) {
|
||||
}
|
||||
|
||||
# SPIRV-Tools may be part of multiple projects in the Chromium tree.
|
||||
# Only enable building executables if this is the main copy, or standalone.
|
||||
# Only enable building executables if this is the main copy.
|
||||
abspath = get_path_info(".", "abspath")
|
||||
spvtools_chromium_third_party = (abspath == "//third_party/SPIRV-Tools/")
|
||||
spvtools_build_executables = !build_with_chromium || spvtools_chromium_third_party
|
||||
spvtools_chromium_third_party = (abspath == "//third_party/vulkan-deps/spirv-tools/src/")
|
||||
spvtools_build_executables = build_with_chromium && spvtools_chromium_third_party
|
||||
# Fuchsia also requires building the executables.
|
||||
# TODO(b/158002593): Avoid the use of dependent-specific variables.
|
||||
if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
|
||||
spvtools_build_executables = true
|
||||
}
|
||||
|
||||
spirv_headers = spirv_tools_spirv_headers_dir
|
||||
spirv_is_winuwp = is_win && target_os == "winuwp"
|
||||
|
Loading…
Reference in New Issue
Block a user