Skip to content

Commit

Permalink
Don't assume output dir + "../.." == src/ in ui/gl/generate_bindings.py
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jamesr@chromium.org committed Jun 6, 2014
1 parent 99bbc17 commit f26037c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 3 additions & 1 deletion ui/gl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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),
]
}
Expand Down
9 changes: 1 addition & 8 deletions ui/gl/generate_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ui/gl/gl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down

0 comments on commit f26037c

Please sign in to comment.