mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 10:51:35 +00:00
Make the Vulkan Validation Layers an optional dependency.
The build_overrides directory for the VVL will default to "" which causes support for them to be skipped if the dependents don't set the dawn_vulkan_validation_layers_dir variable. Bug: chromium:1064305 Change-Id: I0a31f5d1d55982b5c953ce8ac6542d38829eedb5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19085 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Zhenyao Mo <zmo@google.com>
This commit is contained in:
parent
7119a0278d
commit
d9d9d1ec73
@ -62,6 +62,7 @@ if (!defined(dawn_swiftshader_dir)) {
|
||||
dawn_swiftshader_dir = ""
|
||||
}
|
||||
|
||||
if (!defined(dawn_vulkan_validaion_layers_dir)) {
|
||||
dawn_vulkan_validaion_layers_dir = "//third_party/vulkan-validation-layers"
|
||||
if (!defined(dawn_vulkan_validation_layers_dir)) {
|
||||
# Default to VVLs not being available.
|
||||
dawn_vulkan_validation_layers_dir = ""
|
||||
}
|
||||
|
@ -28,7 +28,9 @@ if (is_mac) {
|
||||
}
|
||||
}
|
||||
|
||||
if (dawn_enable_vulkan_validation_layers) {
|
||||
enable_vulkan_validation_layers = dawn_enable_vulkan_validation_layers &&
|
||||
dawn_vulkan_validation_layers_dir != ""
|
||||
if (enable_vulkan_validation_layers) {
|
||||
import("//build_overrides/vulkan_validation_layers.gni")
|
||||
}
|
||||
|
||||
@ -100,9 +102,7 @@ if (dawn_enable_opengl) {
|
||||
# Public dawn_native headers so they can be publicly visible for
|
||||
# dependencies of dawn_native
|
||||
source_set("dawn_native_headers") {
|
||||
public_deps = [
|
||||
"${dawn_root}/src/dawn:dawncpp_headers",
|
||||
]
|
||||
public_deps = [ "${dawn_root}/src/dawn:dawncpp_headers" ]
|
||||
all_dependent_configs = [ "${dawn_root}/src/common:dawn_public_include_dirs" ]
|
||||
sources = [
|
||||
"${dawn_root}/src/include/dawn_native/DawnNative.h",
|
||||
@ -531,13 +531,14 @@ source_set("dawn_native_sources") {
|
||||
# Necessary to ensure that the Vulkan libraries will be in the
|
||||
# final Fuchsia package.
|
||||
data_deps = [
|
||||
# NOTE: The line below is a work around for http://crbug.com/1001081
|
||||
"//third_party/fuchsia-sdk/sdk:trace_engine",
|
||||
"//third_party/fuchsia-sdk:vulkan_base",
|
||||
"//third_party/fuchsia-sdk:vulkan_validation",
|
||||
|
||||
# NOTE: The line below is a work around for http://crbug.com/1001081
|
||||
"//third_party/fuchsia-sdk/sdk:trace_engine",
|
||||
]
|
||||
}
|
||||
if (dawn_enable_vulkan_validation_layers) {
|
||||
if (enable_vulkan_validation_layers) {
|
||||
defines += [
|
||||
"DAWN_ENABLE_VULKAN_VALIDATION_LAYERS",
|
||||
"DAWN_VK_DATA_DIR=\"$vulkan_data_subdir\"",
|
||||
@ -568,17 +569,13 @@ dawn_component("dawn_native") {
|
||||
DEFINE_PREFIX = "DAWN_NATIVE"
|
||||
|
||||
#Make headers publically visible
|
||||
public_deps = [
|
||||
":dawn_native_headers",
|
||||
]
|
||||
public_deps = [ ":dawn_native_headers" ]
|
||||
|
||||
deps = [
|
||||
":dawn_native_sources",
|
||||
"${dawn_root}/src/common",
|
||||
]
|
||||
sources = [
|
||||
"DawnNative.cpp",
|
||||
]
|
||||
sources = [ "DawnNative.cpp" ]
|
||||
configs = [ ":dawn_native_internal" ]
|
||||
public_configs = [ ":dawn_native_weak_framework" ]
|
||||
|
||||
@ -597,10 +594,9 @@ dawn_component("dawn_native") {
|
||||
if (dawn_enable_vulkan) {
|
||||
sources += [ "vulkan/VulkanBackend.cpp" ]
|
||||
|
||||
if (dawn_enable_vulkan_validation_layers) {
|
||||
data_deps = [
|
||||
"${dawn_vulkan_validation_layers_dir}:vulkan_validation_layers",
|
||||
]
|
||||
if (enable_vulkan_validation_layers) {
|
||||
data_deps =
|
||||
[ "${dawn_vulkan_validation_layers_dir}:vulkan_validation_layers" ]
|
||||
if (!is_android) {
|
||||
data_deps +=
|
||||
[ "${dawn_vulkan_validation_layers_dir}:vulkan_gen_json_files" ]
|
||||
@ -611,7 +607,5 @@ dawn_component("dawn_native") {
|
||||
|
||||
# Temporary group for a 3-way patch with Chromium
|
||||
group("libdawn_native_headers") {
|
||||
public_deps = [
|
||||
":dawn_native_headers",
|
||||
]
|
||||
public_deps = [ ":dawn_native_headers" ]
|
||||
}
|
||||
|
18
third_party/BUILD.gn
vendored
18
third_party/BUILD.gn
vendored
@ -47,9 +47,7 @@ source_set("vulkan_headers") {
|
||||
}
|
||||
|
||||
source_set("khronos_platform") {
|
||||
sources = [
|
||||
"khronos/KHR/khrplatform.h",
|
||||
]
|
||||
sources = [ "khronos/KHR/khrplatform.h" ]
|
||||
|
||||
public_configs = [ ":khronos_headers_public" ]
|
||||
}
|
||||
@ -77,9 +75,7 @@ if (!build_with_chromium) {
|
||||
|
||||
static_library("gtest") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"${googletest_dir}/googletest/src/gtest-all.cc",
|
||||
]
|
||||
sources = [ "${googletest_dir}/googletest/src/gtest-all.cc" ]
|
||||
public_configs = [ ":gtest_config" ]
|
||||
}
|
||||
|
||||
@ -93,9 +89,7 @@ if (!build_with_chromium) {
|
||||
|
||||
static_library("gmock") {
|
||||
testonly = true
|
||||
sources = [
|
||||
"${googletest_dir}/googlemock/src/gmock-all.cc",
|
||||
]
|
||||
sources = [ "${googletest_dir}/googlemock/src/gmock-all.cc" ]
|
||||
public_configs = [ ":gmock_config" ]
|
||||
}
|
||||
|
||||
@ -149,8 +143,10 @@ if (is_win || (is_linux && !is_chromeos) || is_mac) {
|
||||
static_library("glfw") {
|
||||
public_configs = [ ":glfw_public" ]
|
||||
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
if (dawn_has_build) {
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
}
|
||||
|
||||
if (is_win && !is_clang) {
|
||||
# nonstandard extension, function/data pointer conversion in expression
|
||||
|
Loading…
x
Reference in New Issue
Block a user