From 789e25ea7d0e97bfbcd0e16e8c382fbf39962eb2 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Fri, 30 Sep 2016 13:41:03 -0400 Subject: [PATCH] Add gn option to set the location of the Vulkan SDK GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2848 Change-Id: I0b60ae03d7b155d4f9a581cab6b551e152b03a86 Reviewed-on: https://skia-review.googlesource.com/2848 Reviewed-by: Mike Klein Commit-Queue: Mike Klein --- BUILD.gn | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index c138492e16..3a81d369ae 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -27,8 +27,11 @@ declare_args() { skia_enable_gpu = true skia_enable_tools = is_skia_standalone skia_enable_vulkan_debug_layers = is_skia_standalone && is_debug + skia_vulkan_sdk = "" } +skia_use_vulkan = skia_use_vulkan || skia_vulkan_sdk != "" + # Our tools require static linking (they use non-exported symbols). skia_enable_tools = skia_enable_tools && !is_component_build @@ -107,6 +110,15 @@ config("skia_private") { # TODO(bsalomon): it'd be nice to make Android normal. defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ] } + libs = [] + lib_dirs = [] + if (skia_use_vulkan) { + if (skia_vulkan_sdk != "") { + include_dirs += [ "$skia_vulkan_sdk/x86_64/include/" ] + lib_dirs += [ "$skia_vulkan_sdk/x86_64/lib/" ] + } + libs += [ "vulkan" ] + } } # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. @@ -345,7 +357,6 @@ optional("gpu") { if (skia_use_vulkan) { public_defines += [ "SK_VULKAN" ] sources += skia_vk_sources - libs += [ "vulkan" ] if (skia_enable_vulkan_debug_layers) { public_defines += [ "SK_ENABLE_VK_LAYERS" ] }