diff options
author | Greg Daniel <egdaniel@google.com> | 2018-05-21 13:48:03 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-21 18:17:08 +0000 |
commit | 477094250cd55a38d4d796ab6c50eb57bdba65e1 (patch) | |
tree | 850d635f7be891064e5a90e8b24cdf0b277675e1 /third_party | |
parent | 4dc5a454052e64227ecbfadd903f590d9361be08 (diff) |
Move gn setup for vulkan library/headers into their own third_party directory.
Bug: skia:
Change-Id: I4605f0d962271efb77bf3c17f1b0daaaddfb51c8
Reviewed-on: https://skia-review.googlesource.com/128540
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/vulkan/BUILD.gn | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/third_party/vulkan/BUILD.gn b/third_party/vulkan/BUILD.gn new file mode 100644 index 0000000000..8fbf555bb5 --- /dev/null +++ b/third_party/vulkan/BUILD.gn @@ -0,0 +1,65 @@ +# Copyright 2018 Google Inc. +# +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +declare_args() { + skia_vulkan_header = "" + skia_tools_vulkan_header_dir = "" + + # When buliding on Android we get the header via the NDK so no need for any extra path. + if (is_fuchsia) { + skia_tools_vulkan_header_dir = "$fuchsia_vulkan_sdk/include" + } else if (is_linux || is_win) { + skia_tools_vulkan_header_dir = "$skia_vulkan_sdk/include" + } +} + +config("moltenvk") { + if (is_ios) { + moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS" + } else { + moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS" + } + cflags = [ + "-F$moltenvk_framework_path", + "-isystem$skia_moltenvk_path/MoltenVK/include", # for <vulkan/vulkan.h> + ] + ldflags = [ "-F$moltenvk_framework_path" ] + libs = [ + "MoltenVK.framework", + "Metal.framework", + "IOSurface.framework", + "QuartzCore.framework", + "Foundation.framework", + ] + if (is_ios) { + libs += [ "UIKit.framework" ] + } else { + libs += [ "IOKit.framework" ] + } + defines = [ "SK_MOLTENVK" ] +} + +config("vulkan_config") { + include_dirs = [] + if (skia_tools_vulkan_header_dir != "") { + include_dirs += [ skia_tools_vulkan_header_dir ] + } + defines = [ "SK_VULKAN" ] + if (skia_vulkan_header != "") { + defines += [ "SK_VULKAN_HEADER=\"$skia_vulkan_header\"" ] + } else if (skia_moltenvk_path != "") { + defines += [ "SK_VULKAN_HEADER=<MoltenVK/mvk_vulkan.h>" ] + } else if (defined(is_skia_standalone) && is_skia_standalone && + !is_official_build) { + defines += [ "SK_VULKAN_HEADER=\"GrVulkanDefines.h\"" ] + } + if (skia_moltenvk_path != "") { + public_configs += [ ":moltenvk" ] + } +} + +source_set("vulkan") { + public_configs = [ ":vulkan_config" ] +} |