Roll shaderc and glslang and use their BUILD.gn

This rolls glslang and shaderc to be able to use their BUILD.gn files,
and also rolls SPIRV-Tools and spirv-headers to have compatible
versions.

BUG=chromium:870747

Change-Id: I13c615f6f3d148c9b69f06547992bf5910e04e62
Reviewed-on: https://dawn-review.googlesource.com/c/1680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-10-04 17:17:57 +00:00 committed by Commit Bot service account
parent d380fdda08
commit 16092faa16
11 changed files with 61 additions and 246 deletions

View File

@ -689,7 +689,7 @@ static_library("dawn_utils") {
":libdawn_native",
":libdawn_wire",
"third_party:glfw",
"third_party:libshaderc",
"${dawn_shaderc_dir}:libshaderc",
]
libs = []

8
DEPS
View File

@ -56,19 +56,19 @@ deps = {
# SPIRV compiler dependencies: SPIRV-Tools, SPIRV-headers, glslang and shaderc
'third_party/SPIRV-Tools': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@21bcb9d8b9dba1c7b7e1d0a8f5b6ad7ea26cc5b6',
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@1225324ae2450623e62621b91b380644f84c16d1',
'condition': 'dawn_standalone',
},
'third_party/spirv-headers': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@ff684ffc6a35d2a58f0f63108877d0064ea33feb',
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Headers@d5b2e1255f706ce1f88812217e9a554f299848af',
'condition': 'dawn_standalone',
},
'third_party/glslang': {
'url': '{chromium_git}/external/github.com/google/glslang@29619b2312f7bc862221749f3f4d37c3e6a0dee2',
'url': '{chromium_git}/external/github.com/KhronosGroup/glslang@ca042a0ffbb6fe09a47c1c867d911b3a69d2102e',
'condition': 'dawn_standalone',
},
'third_party/shaderc': {
'url': '{chromium_git}/external/github.com/google/shaderc@30af9f9899aefd018669e81a5b8e605d14d40431',
'url': '{chromium_git}/external/github.com/google/shaderc@196d38f64e4d919ddb26557f176ca134e2d88ddc',
'condition': 'dawn_standalone',
},

View File

@ -24,10 +24,9 @@ dawn_standalone = true
# users of Dawn don't have to set dirs if they happen to use the same as Dawn.
# The paths to Dawn's dependencies
dawn_spirv_cross_dir = "//third_party/spirv-cross"
dawn_googletest_dir = "//third_party/googletest"
dawn_glslang_dir = "//third_party/glslang"
dawn_spirv_tools_dir = "//third_party/SPIRV-Tools"
dawn_shaderc_dir = "//third_party/shaderc"
dawn_glfw_dir = "//third_party/glfw"
dawn_jinja2_dir = "//third_party/jinja2"
dawn_glfw_dir = "//third_party/glfw"
dawn_googletest_dir = "//third_party/googletest"
dawn_shaderc_dir = "//third_party/shaderc"
dawn_spirv_tools_dir = "//third_party/SPIRV-Tools"
dawn_spirv_cross_dir = "//third_party/spirv-cross"

View File

@ -0,0 +1,15 @@
# Copyright 2018 The Dawn 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.
glslang_spirv_tools_dir = "//third_party/SPIRV-Tools"

View File

@ -0,0 +1,16 @@
# Copyright 2018 The Dawn 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.
shaderc_glslang_dir = "//third_party/glslang"
shaderc_spirv_tools_dir = "//third_party/SPIRV-Tools"

View File

@ -24,30 +24,26 @@ if (!defined(dawn_standalone)) {
dawn_standalone = false
}
if (!defined(dawn_spirv_cross_dir)) {
dawn_spirv_cross_dir = "//third_party/spirv-cross"
}
if (!defined(dawn_googletest_dir)) {
dawn_googletest_dir = "//third_party/googletest"
}
if (!defined(dawn_glslang_dir)) {
dawn_glslang_dir = "//third_party/glslang"
}
if (!defined(dawn_spirv_tools_dir)) {
dawn_spirv_tools_dir = "//third_party/SPIRV-Tools"
}
if (!defined(dawn_shaderc_dir)) {
dawn_shaderc_dir = "//third_party/shaderc"
if (!defined(dawn_jinja2_dir)) {
dawn_jinja2_dir = "//third_party/jinja2"
}
if (!defined(dawn_glfw_dir)) {
dawn_glfw_dir = "//third_party/glfw"
}
if (!defined(dawn_jinja2_dir)) {
dawn_jinja2_dir = "//third_party/jinja2"
if (!defined(dawn_googletest_dir)) {
dawn_googletest_dir = "//third_party/googletest"
}
if (!defined(dawn_shaderc_dir)) {
dawn_shaderc_dir = "//third_party/shaderc"
}
if (!defined(dawn_spirv_cross_dir)) {
dawn_spirv_cross_dir = "//third_party/spirv-cross"
}
if (!defined(dawn_spirv_tools_dir)) {
dawn_spirv_tools_dir = "//third_party/SPIRV-Tools"
}

211
third_party/BUILD.gn vendored
View File

@ -144,217 +144,6 @@ static_library("gmock") {
public_configs = [ ":gmock_config" ]
}
###############################################################################
# GLSLang - good enough build targets
###############################################################################
glslang_dir = dawn_glslang_dir
spirv_tools_dir = dawn_spirv_tools_dir
config("glslang_public") {
include_dirs = [ glslang_dir ]
}
static_library("glslang_static") {
defines = []
public_configs = [ ":glslang_public" ]
sources = [
"${glslang_dir}/OGLCompilersDLL/InitializeDll.cpp",
"${glslang_dir}/OGLCompilersDLL/InitializeDll.h",
"${glslang_dir}/SPIRV/GLSL.ext.EXT.h",
"${glslang_dir}/SPIRV/GLSL.ext.KHR.h",
"${glslang_dir}/SPIRV/GLSL.std.450.h",
"${glslang_dir}/SPIRV/GlslangToSpv.cpp",
"${glslang_dir}/SPIRV/GlslangToSpv.h",
"${glslang_dir}/SPIRV/InReadableOrder.cpp",
"${glslang_dir}/SPIRV/Logger.cpp",
"${glslang_dir}/SPIRV/Logger.h",
"${glslang_dir}/SPIRV/SPVRemapper.cpp",
"${glslang_dir}/SPIRV/SPVRemapper.h",
"${glslang_dir}/SPIRV/SpvBuilder.cpp",
"${glslang_dir}/SPIRV/SpvBuilder.h",
"${glslang_dir}/SPIRV/bitutils.h",
"${glslang_dir}/SPIRV/disassemble.cpp",
"${glslang_dir}/SPIRV/disassemble.h",
"${glslang_dir}/SPIRV/doc.cpp",
"${glslang_dir}/SPIRV/doc.h",
"${glslang_dir}/SPIRV/hex_float.h",
"${glslang_dir}/SPIRV/spirv.hpp",
"${glslang_dir}/SPIRV/spvIR.h",
"${glslang_dir}/glslang/GenericCodeGen/CodeGen.cpp",
"${glslang_dir}/glslang/GenericCodeGen/Link.cpp",
"${glslang_dir}/glslang/Include/BaseTypes.h",
"${glslang_dir}/glslang/Include/Common.h",
"${glslang_dir}/glslang/Include/ConstantUnion.h",
"${glslang_dir}/glslang/Include/InfoSink.h",
"${glslang_dir}/glslang/Include/InitializeGlobals.h",
"${glslang_dir}/glslang/Include/PoolAlloc.h",
"${glslang_dir}/glslang/Include/ResourceLimits.h",
"${glslang_dir}/glslang/Include/ShHandle.h",
"${glslang_dir}/glslang/Include/Types.h",
"${glslang_dir}/glslang/Include/arrays.h",
"${glslang_dir}/glslang/Include/intermediate.h",
"${glslang_dir}/glslang/Include/revision.h",
"${glslang_dir}/glslang/MachineIndependent/Constant.cpp",
"${glslang_dir}/glslang/MachineIndependent/InfoSink.cpp",
"${glslang_dir}/glslang/MachineIndependent/Initialize.cpp",
"${glslang_dir}/glslang/MachineIndependent/Initialize.h",
"${glslang_dir}/glslang/MachineIndependent/IntermTraverse.cpp",
"${glslang_dir}/glslang/MachineIndependent/Intermediate.cpp",
"${glslang_dir}/glslang/MachineIndependent/LiveTraverser.h",
"${glslang_dir}/glslang/MachineIndependent/ParseContextBase.cpp",
"${glslang_dir}/glslang/MachineIndependent/ParseHelper.cpp",
"${glslang_dir}/glslang/MachineIndependent/ParseHelper.h",
"${glslang_dir}/glslang/MachineIndependent/PoolAlloc.cpp",
"${glslang_dir}/glslang/MachineIndependent/RemoveTree.cpp",
"${glslang_dir}/glslang/MachineIndependent/RemoveTree.h",
"${glslang_dir}/glslang/MachineIndependent/Scan.cpp",
"${glslang_dir}/glslang/MachineIndependent/Scan.h",
"${glslang_dir}/glslang/MachineIndependent/ScanContext.h",
"${glslang_dir}/glslang/MachineIndependent/ShaderLang.cpp",
"${glslang_dir}/glslang/MachineIndependent/SymbolTable.cpp",
"${glslang_dir}/glslang/MachineIndependent/SymbolTable.h",
"${glslang_dir}/glslang/MachineIndependent/Versions.cpp",
"${glslang_dir}/glslang/MachineIndependent/Versions.h",
"${glslang_dir}/glslang/MachineIndependent/attribute.cpp",
"${glslang_dir}/glslang/MachineIndependent/attribute.h",
"${glslang_dir}/glslang/MachineIndependent/gl_types.h",
"${glslang_dir}/glslang/MachineIndependent/glslang.y",
"${glslang_dir}/glslang/MachineIndependent/glslang_tab.cpp",
"${glslang_dir}/glslang/MachineIndependent/glslang_tab.cpp.h",
"${glslang_dir}/glslang/MachineIndependent/intermOut.cpp",
"${glslang_dir}/glslang/MachineIndependent/iomapper.cpp",
"${glslang_dir}/glslang/MachineIndependent/iomapper.h",
"${glslang_dir}/glslang/MachineIndependent/limits.cpp",
"${glslang_dir}/glslang/MachineIndependent/linkValidate.cpp",
"${glslang_dir}/glslang/MachineIndependent/localintermediate.h",
"${glslang_dir}/glslang/MachineIndependent/parseConst.cpp",
"${glslang_dir}/glslang/MachineIndependent/parseVersions.h",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/Pp.cpp",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/PpAtom.cpp",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/PpContext.cpp",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/PpContext.h",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/PpScanner.cpp",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/PpTokens.cpp",
"${glslang_dir}/glslang/MachineIndependent/preprocessor/PpTokens.h",
"${glslang_dir}/glslang/MachineIndependent/propagateNoContraction.cpp",
"${glslang_dir}/glslang/MachineIndependent/propagateNoContraction.h",
"${glslang_dir}/glslang/MachineIndependent/reflection.cpp",
"${glslang_dir}/glslang/MachineIndependent/reflection.h",
"${glslang_dir}/glslang/OSDependent/osinclude.h",
"${glslang_dir}/glslang/Public/ShaderLang.h",
]
if (is_msvc) {
cflags_cc = [
# switch statement contains 'default' but no 'case' labels
"/wd4065",
# local variable is initialized but not referenced
"/wd4189",
]
} else {
cflags_cc = [
"-Wno-implicit-fallthrough",
"-Wno-ignored-qualifiers",
"-Wno-unused-variable",
]
}
deps = [
"${spirv_tools_dir}:spvtools_opt",
]
if (is_win) {
sources += [ "${glslang_dir}/glslang/OSDependent/Windows/ossource.cpp" ]
defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
} else {
sources += [ "${glslang_dir}/glslang/OSDependent/Unix/ossource.cpp" ]
defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
}
}
###############################################################################
# Shaderc - good enough build targets
###############################################################################
shaderc_dir = dawn_shaderc_dir
config("shaderc_util_public") {
include_dirs = [ "${shaderc_dir}/libshaderc_util/include" ]
}
static_library("shaderc_util") {
public_configs = [ ":shaderc_util_public" ]
deps = [
":glslang_static",
"${spirv_tools_dir}:spvtools",
]
sources = [
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/counting_includer.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/file_finder.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/format.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/io.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/message.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/mutex.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/resources.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/spirv_tools_wrapper.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/string_piece.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/universal_unistd.h",
"${shaderc_dir}/libshaderc_util/include/libshaderc_util/version_profile.h",
"${shaderc_dir}/libshaderc_util/src/compiler.cc",
"${shaderc_dir}/libshaderc_util/src/file_finder.cc",
"${shaderc_dir}/libshaderc_util/src/io.cc",
"${shaderc_dir}/libshaderc_util/src/message.cc",
"${shaderc_dir}/libshaderc_util/src/resources.cc",
"${shaderc_dir}/libshaderc_util/src/shader_stage.cc",
"${shaderc_dir}/libshaderc_util/src/spirv_tools_wrapper.cc",
"${shaderc_dir}/libshaderc_util/src/version_profile.cc",
]
}
config("shaderc_public") {
include_dirs = [ "${shaderc_dir}/libshaderc/include" ]
defines = [ "SHADERC_SHAREDLIB" ]
# Executable needs an rpath to find our shared libraries on OSX
if (is_mac) {
ldflags = [
"-rpath",
"@executable_path/",
]
}
}
shared_library("libshaderc") {
public_configs = [ ":shaderc_public" ]
deps = [
":glslang_static",
":shaderc_util",
"${spirv_tools_dir}:spvtools",
"${spirv_tools_dir}:spvtools_val",
]
defines = [ "SHADERC_IMPLEMENTATION" ]
sources = [
"${shaderc_dir}/libshaderc/include/shaderc/shaderc.h",
"${shaderc_dir}/libshaderc/include/shaderc/shaderc.hpp",
"${shaderc_dir}/libshaderc/src/shaderc.cc",
"${shaderc_dir}/libshaderc/src/shaderc_private.h",
]
# Tell dependents where to find this shared library
if (is_mac) {
ldflags = [
"-install_name",
"@rpath/${target_name}.dylib",
]
}
}
###############################################################################
# GLFW - good enough build targets
###############################################################################

2
third_party/glslang vendored

@ -1 +1 @@
Subproject commit 29619b2312f7bc862221749f3f4d37c3e6a0dee2
Subproject commit ca042a0ffbb6fe09a47c1c867d911b3a69d2102e

2
third_party/shaderc vendored

@ -1 +1 @@
Subproject commit 30af9f9899aefd018669e81a5b8e605d14d40431
Subproject commit 196d38f64e4d919ddb26557f176ca134e2d88ddc

@ -1 +1 @@
Subproject commit ff684ffc6a35d2a58f0f63108877d0064ea33feb
Subproject commit d5b2e1255f706ce1f88812217e9a554f299848af

@ -1 +1 @@
Subproject commit 21bcb9d8b9dba1c7b7e1d0a8f5b6ad7ea26cc5b6
Subproject commit 1225324ae2450623e62621b91b380644f84c16d1