skia2/gn/find_headers.py
Greg Daniel 5238f994bf Revert "Check-in vulkan.h into third_party and use that instead of local sdk vulkan.h"
This reverts commit 3a3bc42b7d.

Reason for revert: still breaking android

Original change's description:
> Check-in vulkan.h into third_party and use that instead of local sdk vulkan.h
> 
> This change is needed since once we start getting support for varrying of extensions
> and newer version support in general, we need a common vulkan header to compile off of.
> Otherwise we will run into problems if clients have older headers that don't include
> functions/symbols we are trying to use.
> 
> Additionally it has the benefit of not needing to add if SK_VULKAN around code in
> include which wants to use vulkan symbols.
> 
> This is a reupload of CL: https://skia-review.googlesource.com/13651
> 
> Bug: skia:
> Change-Id: I091f526b8c4a61774c34834cd7bfb7e2c822ff5c
> Reviewed-on: https://skia-review.googlesource.com/13804
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> 

TBR=djsollen@google.com,egdaniel@google.com,mtklein@google.com,jvanverth@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ic595e32005761170156499cfb6efc1acfce96001
Reviewed-on: https://skia-review.googlesource.com/13806
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-04-19 14:44:47 +00:00

53 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
# We'll recursively search each include directory for headers,
# then write them to skia.h with a small blacklist.
# We'll also write skia.h.deps, which Ninja uses to track dependencies. It's the
# very same mechanism Ninja uses to know which .h files affect which .cpp files.
skia_h = sys.argv[1]
use_vulkan = eval(sys.argv[2])
include_dirs = sys.argv[3:]
blacklist = {
"GrGLConfig_chrome.h",
"SkFontMgr_fontconfig.h",
}
headers = []
for directory in include_dirs:
for d, _, files in os.walk(directory):
for f in files:
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:
f.write('// skia.h generated by GN.\n')
f.write('#ifndef skia_h_DEFINED\n')
f.write('#define skia_h_DEFINED\n')
for h in headers:
f.write('#include "' + h + '"\n')
f.write('#endif//skia_h_DEFINED\n')
with open(skia_h + '.deps', "w") as f:
f.write(skia_h + ':')
for h in headers:
f.write(' ' + h)
f.write('\n')
# Temporary: during development this file wrote skia.h.d, not skia.h.deps,
# and I think we have some bad versions of those files laying around.
if os.path.exists(skia_h + '.d'):
os.remove(skia_h + '.d')