From 15d0a26fc447200023eec8a58536d116e850b1b8 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Tue, 27 Aug 2019 12:24:45 -0400 Subject: [PATCH] Add spirv-cross to DEPS. Extract the appropriate parts of Dawn's third_party BUILD.gn for it, and put them in their own BUILD.gn. Change-Id: Iedfc11321ca5366499dfc8a1759d8aa08eb78931 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237442 Commit-Queue: Mike Klein Reviewed-by: Mike Klein --- DEPS | 1 + third_party/dawn/BUILD.gn | 2 +- third_party/dawn/third_party/BUILD.gn | 48 --------------------------- third_party/spirv-cross/BUILD.gn | 46 +++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 49 deletions(-) create mode 100644 third_party/spirv-cross/BUILD.gn diff --git a/DEPS b/DEPS index aa5f98bb2b..f49bc0f187 100644 --- a/DEPS +++ b/DEPS @@ -27,6 +27,7 @@ deps = { "third_party/externals/piex" : "https://android.googlesource.com/platform/external/piex.git@bb217acdca1cc0c16b704669dd6f91a1b509c406", "third_party/externals/sdl" : "https://skia.googlesource.com/third_party/sdl@5d7cfcca344034aff9327f77fc181ae3754e7a90", "third_party/externals/sfntly" : "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git@b55ff303ea2f9e26702b514cf6a3196a2e3e2974", + "third_party/externals/spirv-cross" : "https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Cross@53ab2144b90abede33be5161aec5dfc94ddc3caf", "third_party/externals/spirv-headers" : "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git@29c11140baaf9f7fdaa39a583672c556bf1795a1", "third_party/externals/spirv-tools" : "https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git@0c4feb643b89d1792b02f7cbef315e9d95633bd7", "third_party/externals/swiftshader" : "https://swiftshader.googlesource.com/SwiftShader@605f863173b69f9cbe40fca2ac1853eb299e8856", diff --git a/third_party/dawn/BUILD.gn b/third_party/dawn/BUILD.gn index 80256b4e88..ac8191ea0f 100644 --- a/third_party/dawn/BUILD.gn +++ b/third_party/dawn/BUILD.gn @@ -228,7 +228,7 @@ source_set("libdawn_native_sources") { deps = [ ":dawn_common", ":libdawn_native_utils_gen", - "third_party:spirv_cross", + "//third_party/spirv-cross:spirv_cross", "//third_party/spirv-tools:spvtools_val", ] diff --git a/third_party/dawn/third_party/BUILD.gn b/third_party/dawn/third_party/BUILD.gn index f11d313fcc..1dfbbe579d 100644 --- a/third_party/dawn/third_party/BUILD.gn +++ b/third_party/dawn/third_party/BUILD.gn @@ -1,51 +1,3 @@ -dawn_thirdparty_root = "../../externals/dawn/third_party" -spirv_cross = "${dawn_thirdparty_root}/spirv-cross" - -config("spirv_cross_config") { - include_dirs = [ "$dawn_thirdparty_root" ] - defines = [ "SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS" ] -} - -static_library("spirv_cross") { - public_configs = [ ":spirv_cross_config" ] - configs -= [ "//gn:warnings" ] - - cflags = [] - if (is_win) { - cflags += [ - "/wd5850", - "/wd4245", - "/wd4702", - "/wd4706", - "/wd4715", - ] - } - - sources = rebase_path([ - "GLSL.std.450.h", - "spirv.hpp", - "spirv_cfg.cpp", - "spirv_cfg.hpp", - "spirv_common.hpp", - "spirv_cpp.cpp", - "spirv_cpp.hpp", - "spirv_cross.cpp", - "spirv_cross.hpp", - "spirv_cross_parsed_ir.cpp", - "spirv_cross_parsed_ir.hpp", - "spirv_glsl.cpp", - "spirv_glsl.hpp", - "spirv_hlsl.cpp", - "spirv_hlsl.hpp", - "spirv_msl.cpp", - "spirv_msl.hpp", - "spirv_parser.cpp", - "spirv_parser.hpp", - ], - ".", - "${spirv_cross}") -} - # Empty targets to add the include dirs and list the sources of Khronos headers for header inclusion check. config("khronos_headers_public") { include_dirs = [ "../../externals/dawn/third_party/khronos" ] diff --git a/third_party/spirv-cross/BUILD.gn b/third_party/spirv-cross/BUILD.gn new file mode 100644 index 0000000000..0967b98829 --- /dev/null +++ b/third_party/spirv-cross/BUILD.gn @@ -0,0 +1,46 @@ +spirv_cross = "//third_party/externals/spirv-cross" + +config("spirv_cross_config") { + include_dirs = [ "//third_party/externals" ] + defines = [ "SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS" ] +} + +static_library("spirv_cross") { + public_configs = [ ":spirv_cross_config" ] + configs -= [ "//gn:warnings" ] + + cflags = [] + if (is_win) { + cflags += [ + "/wd5850", + "/wd4245", + "/wd4702", + "/wd4706", + "/wd4715", + ] + } + + sources = rebase_path([ + "GLSL.std.450.h", + "spirv.hpp", + "spirv_cfg.cpp", + "spirv_cfg.hpp", + "spirv_common.hpp", + "spirv_cpp.cpp", + "spirv_cpp.hpp", + "spirv_cross.cpp", + "spirv_cross.hpp", + "spirv_cross_parsed_ir.cpp", + "spirv_cross_parsed_ir.hpp", + "spirv_glsl.cpp", + "spirv_glsl.hpp", + "spirv_hlsl.cpp", + "spirv_hlsl.hpp", + "spirv_msl.cpp", + "spirv_msl.hpp", + "spirv_parser.cpp", + "spirv_parser.hpp", + ], + ".", + "${spirv_cross}") +}