diff --git a/DEPS b/DEPS index 280c80eb4c274..3f87d841563cb 100644 --- a/DEPS +++ b/DEPS @@ -424,6 +424,9 @@ deps = { 'src/third_party/pkg/when': Var('dart_git') + '/when.git' + '@' + '0.2.0', + 'src/flutter/third_party/glad/scripts': + Var('github_git') + '/Dav1dde/glad.git' + '@' + 'de6c39e3040c987323b8ed078c36442f4fb681b3', + 'src/third_party/android_tools/ndk': { 'packages': [ { diff --git a/third_party/glad/BUILD.gn b/third_party/glad/BUILD.gn new file mode 100644 index 0000000000000..6eb09280d5437 --- /dev/null +++ b/third_party/glad/BUILD.gn @@ -0,0 +1,72 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +_glad_gen_dir = "$root_out_dir/gen/flutter/third_party/glad" +_public_headers = [ + "$_glad_gen_dir/include/KHR/khrplatform.h", + "$_glad_gen_dir/include/glad/glad.h", +] +_glad_sources = [ "$_glad_gen_dir/src/glad.c" ] + +config("glad_public") { + include_dirs = [ "$_glad_gen_dir/include" ] +} + +source_set("glad") { + public_configs = [ ":glad_public" ] + + public = _public_headers + + sources = _glad_sources + + deps = [ + ":gen_glad_sources", + ] +} + +action("gen_glad_sources") { + visibility = [ ":*" ] + script = "generate.py" + inputs = [ + "scripts/glad/__init__.py", + "scripts/glad/__main__.py", + "scripts/glad/opener.py", + "scripts/glad/parse.py", + "scripts/glad/spec.py", + "scripts/glad/util.py", + "scripts/glad/files/__init__.py", + "scripts/glad/files/egl.xml", + "scripts/glad/files/glx.xml", + "scripts/glad/files/wgl.xml", + "scripts/glad/files/gl.xml", + "scripts/glad/files/khrplatform.h", + "scripts/glad/lang/__init__.py", + "scripts/glad/lang/common/__init__.py", + "scripts/glad/lang/common/generator.py", + "scripts/glad/lang/common/loader.py", + "scripts/glad/lang/common/util.py", + "scripts/glad/lang/c/__init__.py", + "scripts/glad/lang/c/debug.py", + "scripts/glad/lang/c/generator.py", + "scripts/glad/lang/c/loader/__init__.py", + "scripts/glad/lang/c/loader/gl.py", + "scripts/glad/lang/c/loader/wgl.py", + "scripts/glad/lang/c/loader/egl.py", + "scripts/glad/lang/c/loader/glx.py", + ] + + outputs = _public_headers + _glad_sources + + args = [ + "--profile=compatibility", + "--api=gl=3.3", + "--generator=c", + "--spec=gl", + "--extensions=", + "--reproducible", + "--quiet", + "--out-path", + rebase_path("$_glad_gen_dir"), + ] +} diff --git a/third_party/glad/LICENSE b/third_party/glad/LICENSE new file mode 100644 index 0000000000000..c6823b81eb845 --- /dev/null +++ b/third_party/glad/LICENSE @@ -0,0 +1,25 @@ +Copyright 2013 The Flutter Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third_party/glad/generate.py b/third_party/glad/generate.py new file mode 100644 index 0000000000000..876a6b6c7b9ce --- /dev/null +++ b/third_party/glad/generate.py @@ -0,0 +1,13 @@ +#!/usr/bin/python +# -*- coding: UTF-8 -*- + +# GN can't run python scripts in `python -m scripts/glad` mode, +# so the generate.py file seems to be necessary. + +import os +import sys +sys.path.append(os.path.split(os.path.abspath(__file__))[0] + '/scripts') +from glad import __main__ + +if __name__ == '__main__': + __main__.main() \ No newline at end of file