aboutsummaryrefslogtreecommitdiffhomepage
path: root/BUILD.gn
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@google.com>2018-05-22 12:25:43 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-22 12:25:55 +0000
commit2c2a119f945eedaced4bf081347a53f05cf0c39c (patch)
tree9feae854e97f543d42de7c73a7df75f16923a1a9 /BUILD.gn
parentedf8449d2c3663350b6b6e30d2fa4c70da02deef (diff)
Revert "Move gn setup for vulkan library/headers into their own third_party directory."
This reverts commit 477094250cd55a38d4d796ab6c50eb57bdba65e1. Reason for revert: I think we know this broke the MoltenVK bots. It also appears to have broken the Fuchsia roll: https://logs.chromium.org/v/?s=fuchsia%2Fbuildbucket%2Fcr-buildbucket.appspot.com%2F8945885190914943680%2F%2B%2Fsteps%2Fbuild%2F0%2Fsteps%2Fbuild_fuchsia%2F0%2Fsteps%2Fgn_gen%2F0%2Fstdout Original change's description: > 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> TBR=egdaniel@google.com,mtklein@google.com,bungeman@google.com Change-Id: I6e41d98e39883eff34424a2f352b0c8adec178db No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/129444 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn69
1 files changed, 55 insertions, 14 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 1e89661c5b..d59cea6dda 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -43,6 +43,9 @@ declare_args() {
skia_enable_spirv_validation = is_skia_dev_build && is_debug
skia_enable_tools = is_skia_dev_build
skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
+ skia_vulkan_header = ""
+ skia_vulkan_sdk = getenv("VULKAN_SDK")
+ skia_moltenvk_path = ""
skia_qt_path = getenv("QT_PATH")
skia_compile_processors = false
skia_generate_workarounds = false
@@ -76,6 +79,17 @@ declare_args() {
skia_ios_profile = "Google Development"
}
}
+declare_args() {
+ skia_tools_vulkan_header_dir = ""
+ if (skia_use_vulkan) {
+ # 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"
+ }
+ }
+}
if (defined(skia_settings)) {
import(skia_settings)
@@ -117,6 +131,9 @@ if (skia_use_metal) {
# Skia public API, generally provided by :skia.
config("skia_public") {
include_dirs = skia_public_includes
+ if (skia_tools_vulkan_header_dir != "") {
+ include_dirs += [ skia_tools_vulkan_header_dir ]
+ }
defines = []
if (is_component_build) {
defines += [ "SKIA_DLL" ]
@@ -208,6 +225,32 @@ config("skia_library") {
defines = [ "SKIA_IMPLEMENTATION=1" ]
}
+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" ]
+}
+
skia_library_configs = [
":skia_public",
":skia_private",
@@ -359,7 +402,6 @@ template("optional") {
"*",
[
"public_defines",
- "public_deps",
"deps",
"libs",
"sources",
@@ -581,7 +623,6 @@ optional("gpu") {
}
public_defines = []
public_configs = []
- public_deps = []
sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs
@@ -617,17 +658,22 @@ optional("gpu") {
}
if (skia_use_vulkan) {
- # TODO: We should make this deps be //third_party/vulkan and then update clients to have a
- # //third_party/vulkan directory in their trees so they can set up the vulkan library however
- # they want. For example this would allow us to remove the fuchsia specific vulkan code in our
- # vulkan files.
- public_deps += [ "third_party/vulkan" ]
+ public_defines += [ "SK_VULKAN" ]
sources += skia_vk_sources
if (skia_enable_vulkan_debug_layers) {
public_defines += [ "SK_ENABLE_VK_LAYERS" ]
}
+ if (skia_vulkan_header != "") {
+ public_defines += [ "SK_VULKAN_HEADER=\"$skia_vulkan_header\"" ]
+ } else if (skia_moltenvk_path != "") {
+ public_defines += [ "SK_VULKAN_HEADER=<MoltenVK/mvk_vulkan.h>" ]
+ } else if (is_skia_dev_build) {
+ public_defines += [ "SK_VULKAN_HEADER=\"GrVulkanDefines.h\"" ]
+ }
+ if (skia_moltenvk_path != "") {
+ public_configs += [ ":moltenvk" ]
+ }
}
-
if (skia_use_legacy_gpu_pixel_ops) {
public_defines += [ "SK_LEGACY_GPU_PIXEL_OPS" ]
}
@@ -845,6 +891,7 @@ component("skia") {
":fontmgr_empty",
":fontmgr_fontconfig",
":fontmgr_fuchsia",
+ ":gpu",
":heif",
":hsw",
":jpeg",
@@ -861,12 +908,6 @@ component("skia") {
":xml",
]
- # We need the public deps here for Vulkan. Our third_party/vulkan target sets some defines that
- # need to get propagated up to the tools that depend on :skia and thus :gpu.
- public_deps = [
- ":gpu",
- ]
-
# This file (and all GN files in Skia) are designed to work with an
# empty sources assignment filter; we handle all that explicitly.
# We clear the filter here for clients who may have set up a global filter.