From: Greg Daniel Date: Wed, 12 Apr 2017 17:29:50 +0000 (-0400) Subject: Allow including of vulkan.h as a required public api when using vulkan. X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~46^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50130e427c4d02405a38e26c4f020159e6ac295a;p=platform%2Fupstream%2FlibSkiaSharp.git Allow including of vulkan.h as a required public api when using vulkan. Bug: skia: Change-Id: I3ac382edc12144dcda9ef168f752b14878e0e5ac Reviewed-on: https://skia-review.googlesource.com/13262 Commit-Queue: Mike Klein Reviewed-by: Mike Klein --- diff --git a/BUILD.gn b/BUILD.gn index 2dbd380..64944b1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -74,6 +74,7 @@ skia_public_includes = [ "include/svg", "include/utils", "include/utils/mac", + skia_vulkan_headers_path, ] # Skia public API, generally provided by :skia. @@ -139,8 +140,6 @@ config("skia_private") { libs = [] lib_dirs = [] if (skia_use_vulkan) { - include_dirs += [ skia_vulkan_headers_path ] - if (skia_vulkan_sdk != "" && !is_android) { if (is_win) { lib_dirs += [ @@ -743,8 +742,15 @@ if (skia_enable_tools) { public_configs = [ ":skia.h_config" ] skia_h = "$target_gen_dir/skia.h" script = "gn/find_headers.py" - args = [ rebase_path(skia_h, root_build_dir) ] + - rebase_path(skia_public_includes) + if (skia_use_vulkan) { + use_vulkan_string = "True" + } else { + use_vulkan_string = "False" + } + args = [ + rebase_path(skia_h, root_build_dir), + use_vulkan_string, + ] + rebase_path(skia_public_includes - [ skia_vulkan_headers_path ]) depfile = "$skia_h.deps" outputs = [ skia_h, diff --git a/gn/find_headers.py b/gn/find_headers.py index 4ade28d..f02ebc9 100755 --- a/gn/find_headers.py +++ b/gn/find_headers.py @@ -15,14 +15,11 @@ import sys # very same mechanism Ninja uses to know which .h files affect which .cpp files. skia_h = sys.argv[1] -include_dirs = sys.argv[2:] +use_vulkan = eval(sys.argv[2]) +include_dirs = sys.argv[3:] blacklist = { "GrGLConfig_chrome.h", - "GrVkBackendContext.h", - "GrVkDefines.h", - "GrVkInterface.h", - "GrVkTypes.h", "SkFontMgr_fontconfig.h", } @@ -30,8 +27,9 @@ headers = [] for directory in include_dirs: for d, _, files in os.walk(directory): for f in files: - if f.endswith('.h') and f not in blacklist: - headers.append(os.path.join(d,f)) + if not d.endswith('vk') or use_vulkan: + if f.endswith('.h') and f not in blacklist: + headers.append(os.path.join(d,f)) headers.sort() with open(skia_h, "w") as f: