Commit f26037c2 authored by jamesr@chromium.org's avatar jamesr@chromium.org

Don't assume output dir + "../.." == src/ in ui/gl/generate_bindings.py

With gn, it'll probably be common for folks to generate their out directory
in places other than out/{Debug|Release}. This is technically possible (and
busted) in gyp as well. This avoids the relative path dependency from the
script and simplifies it some more by adding the src/ui/gl and src/gpu
directories in the build files (where they can be relativized properly)
instead of trying to do so in the script.

R=brettw@chromium.org

Review URL: https://codereview.chromium.org/317813002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275520 0039d316-1c4b-4281-b951-d872f2087c98
parent 99bbc17d
...@@ -293,7 +293,9 @@ action("generate_gl_bindings") { ...@@ -293,7 +293,9 @@ action("generate_gl_bindings") {
args = [ args = [
"--header-paths=" + "--header-paths=" +
rebase_path("//third_party/khronos", root_build_dir) + ":" + rebase_path("//third_party/khronos", root_build_dir) + ":" +
rebase_path("//third_party/mesa/src/include", root_build_dir), rebase_path("//third_party/mesa/src/include", root_build_dir) + ":" +
rebase_path("//ui/gl", root_build_dir) + ":" +
rebase_path("//gpu", root_build_dir),
rebase_path(gl_binding_output_dir, root_build_dir), rebase_path(gl_binding_output_dir, root_build_dir),
] ]
} }
......
...@@ -1963,17 +1963,10 @@ def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions): ...@@ -1963,17 +1963,10 @@ def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions):
def ResolveHeader(header, header_paths): def ResolveHeader(header, header_paths):
paths = header_paths.split(':') paths = header_paths.split(':')
# Always use a path for Chromium-specific extensions. They are extracted
# to separate files.
paths.append('.')
paths.append('../../gpu')
root = os.path.abspath(os.path.dirname(__file__))
for path in paths: for path in paths:
result = os.path.join(path, header) result = os.path.join(path, header)
if not os.path.isabs(path): if not os.path.isabs(path):
result = os.path.relpath(os.path.join(root, result), os.getcwd()) result = os.path.relpath(os.path.join(os.getcwd(), result), os.getcwd())
if os.path.exists(result): if os.path.exists(result):
# Always use forward slashes as path separators. Otherwise backslashes # Always use forward slashes as path separators. Otherwise backslashes
# may be incorrectly interpreted as escape characters. # may be incorrectly interpreted as escape characters.
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
'variables': { 'variables': {
'generator_path': 'generate_bindings.py', 'generator_path': 'generate_bindings.py',
# Prefer khronos EGL/GLES headers by listing that path first. # Prefer khronos EGL/GLES headers by listing that path first.
'header_paths': '../../third_party/khronos:../../third_party/mesa/src/include', 'header_paths': '../../third_party/khronos:../../third_party/mesa/src/include:.:../../gpu',
}, },
'inputs': [ 'inputs': [
'<(generator_path)', '<(generator_path)',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment