Add in basic BUILD.gn and additional DEPS
This is a minimal config that gets us building the tint binary from samples/ BUG=tint:2 Change-Id: Ifafa903e99a34f1c47177eb954df69ecbe70cb36 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19106 Reviewed-by: dan sinclair <dsinclair@google.com>
This commit is contained in:
parent
a1a86007c9
commit
2962888b8c
|
@ -0,0 +1,21 @@
|
|||
# Copyright 2020 The Tint Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
buildconfig = "//build/config/BUILDCONFIG.gn"
|
||||
|
||||
check_targets = [
|
||||
"//samples:*",
|
||||
"//source:*",
|
||||
"//third_party:*",
|
||||
]
|
|
@ -0,0 +1,219 @@
|
|||
# Copyright 2020 The Tint Authors
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//build_overrides/build.gni")
|
||||
import("//build_overrides/tint.gni")
|
||||
|
||||
config("tint_common_config") {
|
||||
cflags = []
|
||||
ldflags = []
|
||||
include_dirs = []
|
||||
defines = []
|
||||
}
|
||||
|
||||
source_set("libtint") {
|
||||
sources = [
|
||||
"src/ast/array_accessor_expression.cc",
|
||||
"src/ast/array_accessor_expression.h",
|
||||
"src/ast/as_expression.cc",
|
||||
"src/ast/as_expression.h",
|
||||
"src/ast/assignment_statement.cc",
|
||||
"src/ast/assignment_statement.h",
|
||||
"src/ast/binary_expression.cc",
|
||||
"src/ast/binary_expression.h",
|
||||
"src/ast/binding_decoration.cc",
|
||||
"src/ast/binding_decoration.h",
|
||||
"src/ast/bool_literal.h",
|
||||
"src/ast/bool_literal.cc",
|
||||
"src/ast/break_statement.cc",
|
||||
"src/ast/break_statement.h",
|
||||
"src/ast/builtin.cc",
|
||||
"src/ast/builtin.h",
|
||||
"src/ast/builtin_decoration.cc",
|
||||
"src/ast/builtin_decoration.h",
|
||||
"src/ast/call_expression.cc",
|
||||
"src/ast/call_expression.h",
|
||||
"src/ast/case_statement.cc",
|
||||
"src/ast/case_statement.h",
|
||||
"src/ast/cast_expression.cc",
|
||||
"src/ast/cast_expression.h",
|
||||
"src/ast/constructor_expression.cc",
|
||||
"src/ast/constructor_expression.h",
|
||||
"src/ast/continue_statement.cc",
|
||||
"src/ast/continue_statement.h",
|
||||
"src/ast/decorated_variable.cc",
|
||||
"src/ast/decorated_variable.h",
|
||||
"src/ast/derivative_modifier.cc",
|
||||
"src/ast/derivative_modifier.h",
|
||||
"src/ast/else_statement.cc",
|
||||
"src/ast/else_statement.h",
|
||||
"src/ast/entry_point.cc",
|
||||
"src/ast/entry_point.h",
|
||||
"src/ast/expression.cc",
|
||||
"src/ast/expression.h",
|
||||
"src/ast/fallthrough_statement.cc",
|
||||
"src/ast/fallthrough_statement.h",
|
||||
"src/ast/float_literal.cc",
|
||||
"src/ast/float_literal.h",
|
||||
"src/ast/function.cc",
|
||||
"src/ast/function.h",
|
||||
"src/ast/identifier_expression.cc",
|
||||
"src/ast/identifier_expression.h",
|
||||
"src/ast/if_statement.cc",
|
||||
"src/ast/if_statement.h",
|
||||
"src/ast/import.cc",
|
||||
"src/ast/import.h",
|
||||
"src/ast/int_literal.cc",
|
||||
"src/ast/int_literal.h",
|
||||
"src/ast/kill_statement.cc",
|
||||
"src/ast/kill_statement.h",
|
||||
"src/ast/literal.h",
|
||||
"src/ast/literal.cc",
|
||||
"src/ast/location_decoration.cc",
|
||||
"src/ast/location_decoration.h",
|
||||
"src/ast/loop_statement.cc",
|
||||
"src/ast/loop_statement.h",
|
||||
"src/ast/member_accessor_expression.cc",
|
||||
"src/ast/member_accessor_expression.h",
|
||||
"src/ast/module.cc",
|
||||
"src/ast/module.h",
|
||||
"src/ast/node.cc",
|
||||
"src/ast/node.h",
|
||||
"src/ast/nop_statement.cc",
|
||||
"src/ast/nop_statement.h",
|
||||
"src/ast/pipeline_stage.cc",
|
||||
"src/ast/pipeline_stage.h",
|
||||
"src/ast/regardless_statement.cc",
|
||||
"src/ast/regardless_statement.h",
|
||||
"src/ast/return_statement.cc",
|
||||
"src/ast/return_statement.h",
|
||||
"src/ast/scalar_constructor_expression.cc",
|
||||
"src/ast/scalar_constructor_expression.h",
|
||||
"src/ast/set_decoration.cc",
|
||||
"src/ast/set_decoration.h",
|
||||
"src/ast/statement.cc",
|
||||
"src/ast/statement.h",
|
||||
"src/ast/statement_condition.cc",
|
||||
"src/ast/statement_condition.h",
|
||||
"src/ast/storage_class.cc",
|
||||
"src/ast/storage_class.h",
|
||||
"src/ast/struct_decoration.cc",
|
||||
"src/ast/struct_decoration.h",
|
||||
"src/ast/struct.cc",
|
||||
"src/ast/struct.h",
|
||||
"src/ast/struct_member.cc",
|
||||
"src/ast/struct_member.h",
|
||||
"src/ast/struct_member_decoration.cc",
|
||||
"src/ast/struct_member_decoration.h",
|
||||
"src/ast/struct_member_offset_decoration.cc",
|
||||
"src/ast/struct_member_offset_decoration.h",
|
||||
"src/ast/switch_statement.cc",
|
||||
"src/ast/switch_statement.h",
|
||||
"src/ast/type_constructor_expression.h",
|
||||
"src/ast/type_constructor_expression.cc",
|
||||
"src/ast/type/alias_type.cc",
|
||||
"src/ast/type/alias_type.h",
|
||||
"src/ast/type/array_type.cc",
|
||||
"src/ast/type/array_type.h",
|
||||
"src/ast/type/bool_type.cc",
|
||||
"src/ast/type/bool_type.h",
|
||||
"src/ast/type/f32_type.cc",
|
||||
"src/ast/type/f32_type.h",
|
||||
"src/ast/type/i32_type.cc",
|
||||
"src/ast/type/i32_type.h",
|
||||
"src/ast/type/matrix_type.cc",
|
||||
"src/ast/type/matrix_type.h",
|
||||
"src/ast/type/pointer_type.cc",
|
||||
"src/ast/type/pointer_type.h",
|
||||
"src/ast/type/struct_type.cc",
|
||||
"src/ast/type/struct_type.h",
|
||||
"src/ast/type/type.cc",
|
||||
"src/ast/type/type.h",
|
||||
"src/ast/type/u32_type.cc",
|
||||
"src/ast/type/u32_type.h",
|
||||
"src/ast/type/vector_type.cc",
|
||||
"src/ast/type/vector_type.h",
|
||||
"src/ast/type/void_type.cc",
|
||||
"src/ast/type/void_type.h",
|
||||
"src/ast/uint_literal.cc",
|
||||
"src/ast/uint_literal.h",
|
||||
"src/ast/unary_derivative.cc",
|
||||
"src/ast/unary_derivative.h",
|
||||
"src/ast/unary_derivative_expression.cc",
|
||||
"src/ast/unary_derivative_expression.h",
|
||||
"src/ast/unary_method.cc",
|
||||
"src/ast/unary_method.h",
|
||||
"src/ast/unary_method_expression.cc",
|
||||
"src/ast/unary_method_expression.h",
|
||||
"src/ast/unary_op.cc",
|
||||
"src/ast/unary_op.h",
|
||||
"src/ast/unary_op_expression.cc",
|
||||
"src/ast/unary_op_expression.h",
|
||||
"src/ast/unless_statement.cc",
|
||||
"src/ast/unless_statement.h",
|
||||
"src/ast/variable.cc",
|
||||
"src/ast/variable.h",
|
||||
"src/ast/variable_decoration.cc",
|
||||
"src/ast/variable_decoration.h",
|
||||
"src/ast/variable_decl_statement.cc",
|
||||
"src/ast/variable_decl_statement.h",
|
||||
"src/context.h",
|
||||
"src/context.cc",
|
||||
"src/reader/reader.cc",
|
||||
"src/reader/reader.h",
|
||||
"src/scope_stack.h",
|
||||
"src/source.h",
|
||||
"src/type_determiner.cc",
|
||||
"src/type_determiner.h",
|
||||
"src/type_manager.cc",
|
||||
"src/type_manager.h",
|
||||
"src/validator.cc",
|
||||
"src/validator.h",
|
||||
"src/validator_impl.cc",
|
||||
"src/validator_impl.h",
|
||||
"src/writer/writer.cc",
|
||||
"src/writer/writer.h",
|
||||
]
|
||||
|
||||
if (build_with_chromium) {
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
}
|
||||
|
||||
# Suppress warnings from the Chromium Clang plugin
|
||||
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
executable("tint") {
|
||||
sources = [
|
||||
"samples/main.cc",
|
||||
]
|
||||
deps = [
|
||||
":libtint",
|
||||
]
|
||||
|
||||
if (build_with_chromium) {
|
||||
configs -= [ "//build/config/compiler:chromium_code" ]
|
||||
configs += [ "//build/config/compiler:no_chromium_code" ]
|
||||
}
|
||||
|
||||
# Suppress warnings from the Chromium Clang plugin
|
||||
configs -= [ "//build/config/clang:find_bad_constructs" ]
|
||||
}
|
||||
|
||||
group("tint_all") {
|
||||
deps = [
|
||||
":tint",
|
||||
]
|
||||
}
|
120
DEPS
120
DEPS
|
@ -4,6 +4,10 @@ vars = {
|
|||
'chromium_git': 'https://chromium.googlesource.com',
|
||||
'github': '/external/github.com',
|
||||
|
||||
'binutils_revision': '01aa7745b0bab64ae22600f09fd6483c60f22ebf',
|
||||
'build_revision': 'f3d0ca5f46b7b190dbbdc6be508ca11dd5c54302',
|
||||
'buildtools_revision': '74cfb57006f83cfe050817526db359d5c8a11628',
|
||||
'clang_revision': '3605577b67603ec5776afcfada9e0ff4ea05cf0e',
|
||||
'cpplint_revision': '305ac8725a166ed42e3f5dd3f80d6de2cf840ef1',
|
||||
'googletest_revision': '482ac6ee63429af2aa9c44f4e6427873fb68fb1f',
|
||||
'spirv_headers_revision': 'f8bf11a0253a32375c32cad92c841237b96696c0',
|
||||
|
@ -22,4 +26,120 @@ deps = {
|
|||
|
||||
'third_party/spirv-tools': Var('chromium_git') + Var('github') +
|
||||
'/KhronosGroup//SPIRV-Tools.git@' + Var('spirv_tools_revision'),
|
||||
|
||||
# Dependencies required to use GN/Clang in standalone
|
||||
'build': Var('chromium_git') + '/chromium/src/build@' +
|
||||
Var('build_revision'),
|
||||
|
||||
'buildtools': Var('chromium_git') + '/chromium/src/buildtools@' +
|
||||
Var('buildtools_revision'),
|
||||
|
||||
'tools/clang': Var('chromium_git') + '/chromium/src/tools/clang@' +
|
||||
Var('clang_revision'),
|
||||
|
||||
'third_party/binutils': Var('chromium_git') +
|
||||
'/chromium/src/third_party/binutils@' + Var('binutils_revision'),
|
||||
}
|
||||
|
||||
hooks = [
|
||||
# Pull clang-format binaries using checked-in hashes.
|
||||
{
|
||||
'name': 'clang_format_win',
|
||||
'pattern': '.',
|
||||
'condition': 'host_os == "win"',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=win32',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-clang-format',
|
||||
'-s', 'buildtools/win/clang-format.exe.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'clang_format_mac',
|
||||
'pattern': '.',
|
||||
'condition': 'host_os == "mac"',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=darwin',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-clang-format',
|
||||
'-s', 'buildtools/mac/clang-format.sha1',
|
||||
],
|
||||
},
|
||||
{
|
||||
'name': 'clang_format_linux',
|
||||
'pattern': '.',
|
||||
'condition': 'host_os == "linux"',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--platform=linux*',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-clang-format',
|
||||
'-s', 'buildtools/linux64/clang-format.sha1',
|
||||
],
|
||||
},
|
||||
|
||||
# Pull the compilers and system libraries for hermetic builds
|
||||
{
|
||||
'name': 'sysroot_x86',
|
||||
'pattern': '.',
|
||||
'condition': 'checkout_linux and ((checkout_x86 or checkout_x64))',
|
||||
'action': ['python', 'build/linux/sysroot_scripts/install-sysroot.py',
|
||||
'--arch=x86'],
|
||||
},
|
||||
{
|
||||
'name': 'sysroot_x64',
|
||||
'pattern': '.',
|
||||
'condition': 'checkout_linux and (checkout_x64)',
|
||||
'action': ['python', 'build/linux/sysroot_scripts/install-sysroot.py',
|
||||
'--arch=x64'],
|
||||
},
|
||||
{
|
||||
# Update the Windows toolchain if necessary. Must run before 'clang' below.
|
||||
'name': 'win_toolchain',
|
||||
'pattern': '.',
|
||||
'condition': 'checkout_win',
|
||||
'action': ['python', 'build/vs_toolchain.py', 'update', '--force'],
|
||||
},
|
||||
{
|
||||
# Note: On Win, this should run after win_toolchain, as it may use it.
|
||||
'name': 'clang',
|
||||
'pattern': '.',
|
||||
'action': ['python', 'tools/clang/scripts/update.py'],
|
||||
},
|
||||
{
|
||||
# Pull rc binaries using checked-in hashes.
|
||||
'name': 'rc_win',
|
||||
'pattern': '.',
|
||||
'condition': 'checkout_win and (host_os == "win")',
|
||||
'action': [ 'download_from_google_storage',
|
||||
'--no_resume',
|
||||
'--no_auth',
|
||||
'--bucket', 'chromium-browser-clang/rc',
|
||||
'-s', 'build/toolchain/win/rc/win/rc.exe.sha1',
|
||||
],
|
||||
},
|
||||
# Pull binutils for linux hermetic builds
|
||||
{
|
||||
'name': 'binutils',
|
||||
'pattern': 'src/third_party/binutils',
|
||||
'condition': 'host_os == "linux"',
|
||||
'action': [
|
||||
'python',
|
||||
'third_party/binutils/download.py',
|
||||
],
|
||||
},
|
||||
# Update build/util/LASTCHANGE.
|
||||
{
|
||||
'name': 'lastchange',
|
||||
'pattern': '.',
|
||||
'action': ['python', 'build/util/lastchange.py',
|
||||
'-o', 'build/util/LASTCHANGE'],
|
||||
},
|
||||
]
|
||||
|
||||
recursedeps = [
|
||||
# buildtools provides clang_format, libc++, and libc++abi
|
||||
'buildtools',
|
||||
]
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
# Copyright 2020 The Tint Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file contains build-related overrides.
|
||||
|
||||
# Variable that can be used to support multiple build scenarios, like having
|
||||
# Chromium specific targets in a client project's GN file etc.
|
||||
build_with_chromium = false
|
||||
|
||||
# Builds don't use Chromium's third_party/binutils.
|
||||
linux_use_bundled_binutils_override = false
|
||||
|
||||
declare_args() {
|
||||
# Android 32-bit non-component, non-clang builds cannot have symbol_level=2
|
||||
# due to 4GiB file size limit, see https://crbug.com/648948.
|
||||
# Set this flag to true to skip the assertion.
|
||||
ignore_elf32_limitations = false
|
||||
|
||||
# Use the system install of Xcode for tools like ibtool, libtool, etc.
|
||||
# This does not affect the compiler. When this variable is false, targets will
|
||||
# instead use a hermetic install of Xcode. [The hermetic install can be
|
||||
# obtained with gclient sync after setting the environment variable
|
||||
# FORCE_MAC_TOOLCHAIN].
|
||||
use_system_xcode = ""
|
||||
}
|
||||
|
||||
if (use_system_xcode == "") {
|
||||
if (target_os == "mac") {
|
||||
_result = exec_script("//build/mac/should_use_hermetic_xcode.py",
|
||||
[ target_os ],
|
||||
"value")
|
||||
use_system_xcode = _result == 0
|
||||
}
|
||||
if (target_os == "ios") {
|
||||
use_system_xcode = true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
# Copyright 2020 The Tint Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# This file contains Tint-related overrides.
|
|
@ -0,0 +1,43 @@
|
|||
# Copyright 2020 The Tint Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import("//build_overrides/tint.gni")
|
||||
|
||||
# This file contains Tint-related build flags.
|
||||
|
||||
declare_args() {
|
||||
# Generate documentation
|
||||
# TODO(rharrison): Implement documentation support
|
||||
tint_build_doc = false
|
||||
|
||||
# Generate SPIR-V input parser
|
||||
# TODO(rharrison): Implement SPIR-V input parser support
|
||||
tint_build_spv_parser = false
|
||||
|
||||
# Generate fuzzers
|
||||
# TODO(rharrison): Implement fuzzer support
|
||||
tint_build_fuzzers = false
|
||||
|
||||
# Enable memory sanitizer
|
||||
# TODO(rharrison): Implement sanitizer support
|
||||
tint_enable_msan = false
|
||||
|
||||
# Enable address sanitizer
|
||||
# TODO(rharrison): Implement sanitizer support
|
||||
tint_enable_msan = false
|
||||
|
||||
# Enable undefined behaviour sanitizer
|
||||
# TODO(rharrison): Implement sanitizer support
|
||||
tint_enable_ubsan = false
|
||||
}
|
Loading…
Reference in New Issue