From f26037c2dc7b11050ac5f9896dfe75662cf1953e Mon Sep 17 00:00:00 2001 From: "jamesr@chromium.org" Date: Fri, 6 Jun 2014 20:48:03 +0000 Subject: [PATCH] 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 --- ui/gl/BUILD.gn | 4 +++- ui/gl/generate_bindings.py | 9 +-------- ui/gl/gl.gyp | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn index 025f8f8f23ce92..98c03963022edb 100644 --- a/ui/gl/BUILD.gn +++ b/ui/gl/BUILD.gn @@ -293,7 +293,9 @@ action("generate_gl_bindings") { args = [ "--header-paths=" + 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), ] } diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py index c647f9e2696ad7..248e4ff1d31832 100755 --- a/ui/gl/generate_bindings.py +++ b/ui/gl/generate_bindings.py @@ -1963,17 +1963,10 @@ def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions): def ResolveHeader(header, header_paths): 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: result = os.path.join(path, header) 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): # Always use forward slashes as path separators. Otherwise backslashes # may be incorrectly interpreted as escape characters. diff --git a/ui/gl/gl.gyp b/ui/gl/gl.gyp index a050064a83ddbb..ceba2a9b1029b3 100644 --- a/ui/gl/gl.gyp +++ b/ui/gl/gl.gyp @@ -136,7 +136,7 @@ 'variables': { 'generator_path': 'generate_bindings.py', # 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': [ '<(generator_path)',