skia2/third_party/BUILD.bazel

3515 lines
162 KiB
Python
Raw Normal View History

[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
# https://github.com/bazelbuild/bazel-skylib
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@rules_python//python:defs.bzl", "py_binary")
[bazel] Use hermetic Python with jinja2+MarkupSafe The file generation logic that dawn [1] uses to make some source files requires jinja2, which also requires MarkupSafe. The GN build handles this by specifying those repos in DEPS, checking them out at a certain git hash, and then providing them via a command line arg [2]. We do not have to do it this way in Bazel to have reproducible builds. This CL specifies an exact version (verified by sha256) of those two deps and then uses a hermetic version of Python 3.9 to run all py_binary commands. Previously, we would rely on the system Python (and installed libraries). That happened to work on my machine, but not on other machines without jinja2 and MarkupSafe installed. After this CL, it should work on machines that do not have python even installed. I chose the same jinja2 version used by Dawn [3], which was 2.11.3. Then I chose the newest version of MarkupSafe that was compatible with jinja2 (2.0.1). If we have other python scripts that need external deps, we should be able to specify them in the py_binary that needs them and in requirements.txt. Then, the pip_install() step in WORKSPACE.bazel will download them and make them available. [1] https://dawn.googlesource.com/dawn.git/+/refs/heads/main/docs/dawn/overview.md [2] https://dawn.googlesource.com/dawn.git/+/e45ff6a4b3c2f06dade68ec0f01ddc3bfd70c282/generator/generator_lib.gni#77 [3] https://chromium.googlesource.com/chromium/src/third_party/jinja2/+/ee69aa00ee8536f61db6a451f3858745cf587de6 Change-Id: I3d0074f3003de179400e239e00107c34f35f4901 Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524217 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-03-25 16:36:17 +00:00
load("@py_deps//:requirements.bzl", "requirement")
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
[infra] Add initial Bazel rules and files These rules can be used to build our GMs on WASM+WebGL and libskia.a with just the CPU backend (and most other features turned off). This can be done with the following commands: - bazel build //modules/canvaskit:gm-bindings-wasm --gpu_backend=gl_backend --with_gl_standard=webgl_standard - bazel build :skia-core --config clang This pivots slightly from http://review.skia.org/463517 by using config_settings [1] instead of platforms for the optional features that we control. This pivot was suggested in [2] We have BUILD.bazel files in many of the subdirectories that specify filegroups for the appropriate files. In an effort to make //BUILD.bazel more readable, it is the responsibility of these subfolders to deal with conditionally including certain .h or .cpp files. This is done using select statements and config_settings or platform constraints as necessary. For example, src/gpu/BUILD.bazel will different private filegroups for each of the supported gpu backends [3] and a more-visible filegroup called "srcs" that has the right selection of the private files to be used for compilation. An effort has been made to avoid using glob() in our BUILD.bazel files. These file lists were made by using `ls -1` and some regex to add in quotes. We might want to make a helper script to assist with that, if necessary. To specify which options we have, the settings in //bazel/common_config_settings/BUILD.bazel have been redesigned. They make use of a macro `string_flag_with_values` that removes the boilerplate. Patchset 36 shows what the file looks like w/o the macro. The top level BUILD.bazel file will still need to use some logic to handle defines, because local_defines is a list of strings, not a list of labels [4]. Suggested Review Order: - WORKSPACE.bazel to see the new dependencies on the emsdk toolchain and bazel_skylib - bazel/common_config_settings/* to see the few settings defined (we have more to define, see BUILD.gn and //gn/skia.gni for ideas) - BUILD.bazel to see the "skia-core" cc_library rule. See also "gms" and "tests" - modules/canvaskit/BUILD.bazel to see the use of the emscripten "wasm_cc_binary" rule, which depends on the "skia-core", "gms", and "tests" rule. Note that it only builds some of the gms as a proof of concept. - The other BUILD.bazel files. Some of these are not platform or feature dependent (e.g. pathops). Others are (e.g. gpu). - All other files. [1] https://docs.bazel.build/versions/4.2.1/skylark/config.html#user-defined-build-settings [2] https://github.com/emscripten-core/emsdk/pull/920 [3] In this CL, that's just the webgl one. [4] https://docs.bazel.build/versions/main/be/c-cpp.html#cc_library.local_defines Change-Id: Ieecf9c106d5e3a6ae97d13d66be06b4b3c207089 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458637 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Owners-Override: Kevin Lubick <kjlubick@google.com>
2021-11-08 20:26:09 +00:00
cc_library(
name = "skcms",
srcs = [
"skcms/skcms.cc",
"skcms/skcms_internal.h",
"skcms/src/Transform_inl.h",
],
[bazel] Try adding cc_binary rules that use generated rules To make the atomic rules a bit easier to work with, in many of the folders, this adds in cc_library rules to group together the sources from that folder (and subfolders where prudent). We only needs sources because those atoms should have their headers as deps. One issue that was pointed out is that there is currently no way to restrict the inclusion of certain packages, a la, `gn check`. For example, there is no mechanism from stopping a dev from adding #include "modules/canvaskit/WasmCommon.h" to something in //src/core (except circular dependencies). We can probably address that using Bazel's visibility rules as needed: https://docs.bazel.build/versions/main/visibility.html https://docs.bazel.build/versions/main/be/functions.html#package_group It is recommended to look at this CL patchset by patchset. PS1: Update gazelle command to generate rules in more folders. PS2: A few changes to make generation work better. PS3: The result of running make generate in //bazel PS4: Adding the rules to build sksllex, the simplest binary I could find in the Skia repo. PS5: Adding the rules to build skdiff, a more complex binary. I tried a few approaches, but ended up gravitating back towards the layout where we have each folder/package group up the sources. I imagine at some point, we'll have skdiff depend on skia_core or something, which will have things like //src/core, //src/codecs, //src/pathops all bundled together. PS7: Added in the groupings of sources, similar to what we had earlier. I liked these for readability. These helped fix up the //:skia_core build, and by extension, the CanvasKit build. Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 13:15:24 +00:00
copts = [
"-isystem include/third_party/skcms/",
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[bazel] Try adding cc_binary rules that use generated rules To make the atomic rules a bit easier to work with, in many of the folders, this adds in cc_library rules to group together the sources from that folder (and subfolders where prudent). We only needs sources because those atoms should have their headers as deps. One issue that was pointed out is that there is currently no way to restrict the inclusion of certain packages, a la, `gn check`. For example, there is no mechanism from stopping a dev from adding #include "modules/canvaskit/WasmCommon.h" to something in //src/core (except circular dependencies). We can probably address that using Bazel's visibility rules as needed: https://docs.bazel.build/versions/main/visibility.html https://docs.bazel.build/versions/main/be/functions.html#package_group It is recommended to look at this CL patchset by patchset. PS1: Update gazelle command to generate rules in more folders. PS2: A few changes to make generation work better. PS3: The result of running make generate in //bazel PS4: Adding the rules to build sksllex, the simplest binary I could find in the Skia repo. PS5: Adding the rules to build skdiff, a more complex binary. I tried a few approaches, but ended up gravitating back towards the layout where we have each folder/package group up the sources. I imagine at some point, we'll have skdiff depend on skia_core or something, which will have things like //src/core, //src/codecs, //src/pathops all bundled together. PS7: Added in the groupings of sources, similar to what we had earlier. I liked these for readability. These helped fix up the //:skia_core build, and by extension, the CanvasKit build. Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 13:15:24 +00:00
deps = [
"//include/third_party/skcms:skcms_hdr",
[infra] Add initial Bazel rules and files These rules can be used to build our GMs on WASM+WebGL and libskia.a with just the CPU backend (and most other features turned off). This can be done with the following commands: - bazel build //modules/canvaskit:gm-bindings-wasm --gpu_backend=gl_backend --with_gl_standard=webgl_standard - bazel build :skia-core --config clang This pivots slightly from http://review.skia.org/463517 by using config_settings [1] instead of platforms for the optional features that we control. This pivot was suggested in [2] We have BUILD.bazel files in many of the subdirectories that specify filegroups for the appropriate files. In an effort to make //BUILD.bazel more readable, it is the responsibility of these subfolders to deal with conditionally including certain .h or .cpp files. This is done using select statements and config_settings or platform constraints as necessary. For example, src/gpu/BUILD.bazel will different private filegroups for each of the supported gpu backends [3] and a more-visible filegroup called "srcs" that has the right selection of the private files to be used for compilation. An effort has been made to avoid using glob() in our BUILD.bazel files. These file lists were made by using `ls -1` and some regex to add in quotes. We might want to make a helper script to assist with that, if necessary. To specify which options we have, the settings in //bazel/common_config_settings/BUILD.bazel have been redesigned. They make use of a macro `string_flag_with_values` that removes the boilerplate. Patchset 36 shows what the file looks like w/o the macro. The top level BUILD.bazel file will still need to use some logic to handle defines, because local_defines is a list of strings, not a list of labels [4]. Suggested Review Order: - WORKSPACE.bazel to see the new dependencies on the emsdk toolchain and bazel_skylib - bazel/common_config_settings/* to see the few settings defined (we have more to define, see BUILD.gn and //gn/skia.gni for ideas) - BUILD.bazel to see the "skia-core" cc_library rule. See also "gms" and "tests" - modules/canvaskit/BUILD.bazel to see the use of the emscripten "wasm_cc_binary" rule, which depends on the "skia-core", "gms", and "tests" rule. Note that it only builds some of the gms as a proof of concept. - The other BUILD.bazel files. Some of these are not platform or feature dependent (e.g. pathops). Others are (e.g. gpu). - All other files. [1] https://docs.bazel.build/versions/4.2.1/skylark/config.html#user-defined-build-settings [2] https://github.com/emscripten-core/emsdk/pull/920 [3] In this CL, that's just the webgl one. [4] https://docs.bazel.build/versions/main/be/c-cpp.html#cc_library.local_defines Change-Id: Ieecf9c106d5e3a6ae97d13d66be06b4b3c207089 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458637 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Owners-Override: Kevin Lubick <kjlubick@google.com>
2021-11-08 20:26:09 +00:00
],
)
LIBPNG_SRCS = [
"externals/libpng/png.c",
"externals/libpng/pngconf.h",
"externals/libpng/pngdebug.h",
"externals/libpng/pngerror.c",
"externals/libpng/pngget.c",
"externals/libpng/pnginfo.h",
"externals/libpng/pngmem.c",
"externals/libpng/pngpread.c",
"externals/libpng/pngpriv.h",
"externals/libpng/pngread.c",
"externals/libpng/pngrio.c",
"externals/libpng/pngrtran.c",
"externals/libpng/pngrutil.c",
"externals/libpng/pngset.c",
"externals/libpng/pngstruct.h",
"externals/libpng/pngtrans.c",
"externals/libpng/pngwio.c",
"externals/libpng/pngwrite.c",
"externals/libpng/pngwtran.c",
"externals/libpng/pngwutil.c",
"libpng/pnglibconf.h",
] + select({
"@platforms//cpu:x86_64": [
"externals/libpng/intel/filter_sse2_intrinsics.c",
"externals/libpng/intel/intel_init.c",
],
"@platforms//cpu:arm": [
"externals/libpng/arm/arm_init.c",
"externals/libpng/arm/filter_neon_intrinsics.c",
"externals/libpng/arm/palette_neon_intrinsics.c",
],
# No SIMD support in wasm for now
"//bazel/common_config_settings:cpu_wasm": [],
# The default is to avoid using SIMD
"//conditions:default": [],
})
PNG_DEFINES = ["PNG_SET_OPTION_SUPPORTED"] + select({
"@platforms//cpu:x86_64": ["PNG_INTEL_SSE"],
"//conditions:default": [],
})
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
cc_library(
name = "libpng",
srcs = LIBPNG_SRCS,
hdrs = [
"externals/libpng/png.h",
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
],
copts = [
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"-isystem third_party/libpng/",
"-Wno-unused-but-set-variable",
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
],
includes = [
# This adds -isystem "third_party/externals/libpng" to any dependent
# compilation steps. This allows #include <png.h> to work
"externals/libpng",
# png.h attempts to #include "pnglibconf.h" , which we store in //third_party/libpng/
# This rule adds -isystem "third_party/externals/libpng" to any dependent
# rule on this, which avoids having to add "-Ithird_party/libpng/" to copts for
# those dependent rules.
"libpng",
],
local_defines = PNG_DEFINES,
# This is included by //third_party/libpng/pnglibconf.h, but because it is not a .h
# file, we must tell Bazel to explicitly bring it in as an "includable".
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
textual_hdrs = ["externals/libpng/scripts/pnglibconf.h.prebuilt"],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
deps = [":zlib"],
)
ZLIB_SRCS = [
"externals/zlib/adler32.c",
"externals/zlib/compress.c",
"externals/zlib/contrib/optimizations/insert_string.h",
"externals/zlib/cpu_features.c",
"externals/zlib/cpu_features.h",
"externals/zlib/crc32.h",
"externals/zlib/crc32.c",
"externals/zlib/deflate.c",
"externals/zlib/deflate.h",
"externals/zlib/gzclose.c",
"externals/zlib/gzguts.h",
"externals/zlib/gzlib.c",
"externals/zlib/gzread.c",
"externals/zlib/gzwrite.c",
"externals/zlib/infback.c",
"externals/zlib/inffast.c",
"externals/zlib/inffast.h",
"externals/zlib/inflate.h",
"externals/zlib/inftrees.c",
"externals/zlib/inftrees.h",
"externals/zlib/trees.c",
"externals/zlib/trees.h",
"externals/zlib/uncompr.c",
"externals/zlib/inffixed.h",
"externals/zlib/zutil.c",
"externals/zlib/zutil.h",
] + select({
"@platforms//cpu:x86_64": [
"externals/zlib/adler32_simd.h",
"externals/zlib/adler32_simd.c",
"externals/zlib/contrib/optimizations/chunkcopy.h",
"externals/zlib/contrib/optimizations/inffast_chunk.h",
"externals/zlib/contrib/optimizations/inffast_chunk.c",
"externals/zlib/contrib/optimizations/inflate.c",
"externals/zlib/crc32_simd.h",
"externals/zlib/crc32_simd.c",
"externals/zlib/crc_folding.c",
"externals/zlib/fill_window_sse.c",
],
"@platforms//cpu:arm": [
"externals/zlib/adler32_simd.h",
"externals/zlib/adler32_simd.c",
"externals/zlib/contrib/optimizations/chunkcopy.h",
"externals/zlib/contrib/optimizations/inffast_chunk.h",
"externals/zlib/contrib/optimizations/inffast_chunk.c",
"externals/zlib/contrib/optimizations/inflate.c",
"externals/zlib/crc32_simd.h",
"externals/zlib/crc32_simd.c",
],
# No SIMD support in wasm for now
"//bazel/common_config_settings:cpu_wasm": ["externals/zlib/inflate.c"],
# The default is to avoid using SIMD
"//conditions:default": ["externals/zlib/inflate.c"],
})
ZLIB_DEFINES = ["ZLIB_IMPLEMENTATION"] + select({
"@platforms//cpu:x86_64": [
"ADLER32_SIMD_SSSE3",
"CRC32_SIMD_SSE42_PCLMUL",
"INFLATE_CHUNK_READ_64LE",
"INFLATE_CHUNK_SIMD_SSE2",
"DEFLATE_FILL_WINDOW_SSE2",
],
"@platforms//cpu:arm": [
"ADLER32_SIMD_NEON",
"INFLATE_CHUNK_SIMD_NEON",
],
"//bazel/common_config_settings:cpu_wasm": ["CPU_NO_SIMD"],
"//conditions:default": ["CPU_NO_SIMD"],
}) + select({
"//bazel/common_config_settings:windows_x64": ["X86_WINDOWS"],
"//bazel/common_config_settings:linux_x64": ["X86_NOT_WINDOWS"],
"//bazel/common_config_settings:fuchsia_arm64": [
"X86_NOT_WINDOWS",
"ARMV8_OS_FUCHSIA",
],
# TODO(kjlubick) other arm flavors
"//conditions:default": ["X86_NOT_WINDOWS"],
})
ZLIB_COPTS = [
"-Wno-unused-function",
# Make the headers in contrib available, without exposing them in hdrs.
"-isystem third_party/externals/zlib/",
] + select({
"//bazel/common_config_settings:linux_x64": [
"-mssse3",
"-msse4.2",
"-mpclmul",
],
"@platforms//cpu:arm": ["-march=armv8-a+crc"],
# If empty list isn't set for wasm, select picks linux_x64
"//bazel/common_config_settings:cpu_wasm": [],
"//conditions:default": [],
})
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
cc_library(
name = "zlib",
srcs = ZLIB_SRCS,
hdrs = [
"externals/zlib/chromeconf.h",
"externals/zlib/zconf.h",
"externals/zlib/zlib.h",
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
],
copts = ZLIB_COPTS,
local_defines = ZLIB_DEFINES,
# This allows users of zlib to just do #include "zlib.h"
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
strip_include_prefix = "externals/zlib/",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add hermetic toolchain for C/C++ using Clang+Musl This can successfully build a C library: bazel build --config=clang //third_party:libpng This can build and run a statically-linked executable: bazel test --config=clang //:bazel_test For more verbose compile and linking output, add the `--features diagnostic` flag to a Bazel command (see _make_diagnostic_flags() in toolchain/clang_toolchain_config.bzl. Similarly, a `--features print_search_dirs` can be used to show where clang is looking for libraries etc to link against. These features are made available for easier debugging. Suggested review order: - Read https://docs.bazel.build/versions/4.2.1/tutorial/cc-toolchain-config.html if unfamiliar with setting up C++ toolchains in Bazel - .bazelrc and WORKSPACE.bazel that configure use and download of the toolchain (Clang 13, musl 1.2.2) - toolchain/build_toolchain.bzl which downloads and assembles the toolchain (w/o installing anything on the host machine) - toolchain/BUILD.bazel and toolchain/*trampoline.sh to see the setup of the toolchain rules. - toolchain/clang_toolchain_config.bzl to see the configuration of the toolchain. Pay special attention to the various command line flags that are set. - See that tools/bazel_test.cc has made a new home in experimental/bazel_test/bazel_test.cpp, with a companion BUILD.bazel. Note the addition of some function calls that test use of the C++ standard library. The number being used to test the PNG library is the latest and greatest that verifies we are compiling the one brought in via DEPS (and not a local one). - third_party/* to see how png (and its dependent zlib) have been built. Pay special attention to the musl_compat hack to fix static linking (any idea what the real cause is?) - //BUILD.bazel to see definition of the bazel_test executable. Change-Id: I7b0922d0d45cb9be8df2fd5fa5a1f48492654d5f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461178 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-20 20:20:42 +00:00
)
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
JPEGTURBO_SRCS = [
"externals/libjpeg-turbo/jaricom.c",
"externals/libjpeg-turbo/jcapimin.c",
"externals/libjpeg-turbo/jcapistd.c",
"externals/libjpeg-turbo/jcarith.c",
"externals/libjpeg-turbo/jccoefct.c",
"externals/libjpeg-turbo/jccolor.c",
"externals/libjpeg-turbo/jcdctmgr.c",
"externals/libjpeg-turbo/jchuff.c",
"externals/libjpeg-turbo/jchuff.h",
"externals/libjpeg-turbo/jcinit.c",
"externals/libjpeg-turbo/jcmainct.c",
"externals/libjpeg-turbo/jcmarker.c",
"externals/libjpeg-turbo/jcmaster.c",
"externals/libjpeg-turbo/jcomapi.c",
"externals/libjpeg-turbo/jconfigint.h",
"externals/libjpeg-turbo/jcparam.c",
"externals/libjpeg-turbo/jcphuff.c",
"externals/libjpeg-turbo/jcprepct.c",
"externals/libjpeg-turbo/jcsample.c",
"externals/libjpeg-turbo/jdapimin.c",
"externals/libjpeg-turbo/jdapistd.c",
"externals/libjpeg-turbo/jdarith.c",
"externals/libjpeg-turbo/jdcoefct.c",
"externals/libjpeg-turbo/jdcoefct.h",
"externals/libjpeg-turbo/jdcolor.c",
"externals/libjpeg-turbo/jdct.h",
"externals/libjpeg-turbo/jddctmgr.c",
"externals/libjpeg-turbo/jdhuff.c",
"externals/libjpeg-turbo/jdhuff.h",
"externals/libjpeg-turbo/jdinput.c",
"externals/libjpeg-turbo/jdmainct.c",
"externals/libjpeg-turbo/jdmainct.h",
"externals/libjpeg-turbo/jdmarker.c",
"externals/libjpeg-turbo/jdmaster.c",
"externals/libjpeg-turbo/jdmaster.h",
"externals/libjpeg-turbo/jdmerge.c",
"externals/libjpeg-turbo/jdmerge.h",
"externals/libjpeg-turbo/jdphuff.c",
"externals/libjpeg-turbo/jdpostct.c",
"externals/libjpeg-turbo/jdsample.c",
"externals/libjpeg-turbo/jdsample.h",
"externals/libjpeg-turbo/jerror.c",
"externals/libjpeg-turbo/jfdctflt.c",
"externals/libjpeg-turbo/jfdctfst.c",
"externals/libjpeg-turbo/jfdctint.c",
"externals/libjpeg-turbo/jidctflt.c",
"externals/libjpeg-turbo/jidctfst.c",
"externals/libjpeg-turbo/jidctint.c",
"externals/libjpeg-turbo/jidctred.c",
"externals/libjpeg-turbo/jinclude.h",
"externals/libjpeg-turbo/jmemmgr.c",
"externals/libjpeg-turbo/jmemnobs.c",
"externals/libjpeg-turbo/jmemsys.h",
"externals/libjpeg-turbo/jpeg_nbits_table.c",
"externals/libjpeg-turbo/jpeg_nbits_table.h",
"externals/libjpeg-turbo/jpegcomp.h",
"externals/libjpeg-turbo/jpegint.h",
"externals/libjpeg-turbo/jquant1.c",
"externals/libjpeg-turbo/jquant2.c",
"externals/libjpeg-turbo/jsimd.h",
"externals/libjpeg-turbo/jsimddct.h",
"externals/libjpeg-turbo/jutils.c",
"externals/libjpeg-turbo/jversion.h",
] + selects.with_or({
("@platforms//cpu:arm", "@platforms//cpu:arm64"): [
"externals/libjpeg-turbo/simd/arm/jccolor-neon.c",
"externals/libjpeg-turbo/simd/arm/jcgray-neon.c",
"externals/libjpeg-turbo/simd/arm/jcphuff-neon.c",
"externals/libjpeg-turbo/simd/arm/jcsample-neon.c",
"externals/libjpeg-turbo/simd/arm/jdcolor-neon.c",
"externals/libjpeg-turbo/simd/arm/jdmerge-neon.c",
"externals/libjpeg-turbo/simd/arm/jdsample-neon.c",
"externals/libjpeg-turbo/simd/arm/jfdctfst-neon.c",
"externals/libjpeg-turbo/simd/arm/jfdctint-neon.c",
"externals/libjpeg-turbo/simd/arm/jidctfst-neon.c",
"externals/libjpeg-turbo/simd/arm/jidctint-neon.c",
"externals/libjpeg-turbo/simd/arm/jidctred-neon.c",
"externals/libjpeg-turbo/simd/arm/jquanti-neon.c",
],
"//conditions:default": ["externals/libjpeg-turbo/jsimd_none.c"],
}) + select({
"@platforms//cpu:arm": [
"externals/libjpeg-turbo/simd/arm/aarch32/jchuff-neon.c",
"externals/libjpeg-turbo/simd/arm/aarch32/jsimd.c",
],
"@platforms//cpu:arm64": [
"externals/libjpeg-turbo/simd/arm/aarch64/jchuff-neon.c",
"externals/libjpeg-turbo/simd/arm/aarch64/jsimd.c",
],
"//conditions:default": [],
})
JPEGTURBO_DEFINES = [
# Add support for arithmetic encoding (C_) and decoding (D_).
# This matches Android. Note that such JPEGs are likely rare, given lack of
# support by major browsers.
"C_ARITH_CODING_SUPPORTED=1",
"D_ARITH_CODING_SUPPORTED=1",
] + selects.with_or({
("@platforms//cpu:arm", "@platforms//cpu:arm64"): ["NEON_INTRINSICS"],
"//conditions:default": [],
}) + select({
"@platforms//os:windows": [],
"//conditions:default": ["USE_CLZ_INTRINSIC"], # Cuts a 64K table.
})
cc_library(
name = "libjpeg-turbo",
srcs = JPEGTURBO_SRCS,
hdrs = [
"externals/libjpeg-turbo/jconfig.h",
"externals/libjpeg-turbo/jerror.h",
"externals/libjpeg-turbo/jmorecfg.h",
"externals/libjpeg-turbo/jpeglib.h",
"externals/libjpeg-turbo/jpeglibmangler.h",
],
local_defines = JPEGTURBO_DEFINES,
strip_include_prefix = "externals/libjpeg-turbo/",
textual_hdrs = [
"externals/libjpeg-turbo/jccolext.c",
"externals/libjpeg-turbo/jdmrgext.c",
"externals/libjpeg-turbo/jdcolext.c",
"externals/libjpeg-turbo/jdcol565.c",
"externals/libjpeg-turbo/jdmrg565.c",
"externals/libjpeg-turbo/jstdhuff.c",
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
)
WEBP_SRCS = [
"externals/libwebp/src/dec/alpha_dec.c",
"externals/libwebp/src/dec/alphai_dec.h",
"externals/libwebp/src/dec/buffer_dec.c",
"externals/libwebp/src/dec/common_dec.h",
"externals/libwebp/src/dec/frame_dec.c",
"externals/libwebp/src/dec/idec_dec.c",
"externals/libwebp/src/dec/io_dec.c",
"externals/libwebp/src/dec/quant_dec.c",
"externals/libwebp/src/dec/tree_dec.c",
"externals/libwebp/src/dec/vp8_dec.c",
"externals/libwebp/src/dec/vp8_dec.h",
"externals/libwebp/src/dec/vp8i_dec.h",
"externals/libwebp/src/dec/vp8l_dec.c",
"externals/libwebp/src/dec/vp8li_dec.h",
"externals/libwebp/src/dec/webp_dec.c",
"externals/libwebp/src/dec/webpi_dec.h",
"externals/libwebp/src/demux/anim_decode.c",
"externals/libwebp/src/demux/demux.c",
"externals/libwebp/src/dsp/alpha_processing.c",
"externals/libwebp/src/dsp/alpha_processing_mips_dsp_r2.c",
"externals/libwebp/src/dsp/alpha_processing_neon.c",
"externals/libwebp/src/dsp/alpha_processing_sse2.c",
"externals/libwebp/src/dsp/common_sse2.h",
"externals/libwebp/src/dsp/common_sse41.h",
"externals/libwebp/src/dsp/cost.c",
"externals/libwebp/src/dsp/cost_mips32.c",
"externals/libwebp/src/dsp/cost_mips_dsp_r2.c",
"externals/libwebp/src/dsp/cost_neon.c",
"externals/libwebp/src/dsp/cost_sse2.c",
"externals/libwebp/src/dsp/cpu.c",
"externals/libwebp/src/dsp/dec.c",
"externals/libwebp/src/dsp/dec_clip_tables.c",
"externals/libwebp/src/dsp/dec_mips32.c",
"externals/libwebp/src/dsp/dec_mips_dsp_r2.c",
"externals/libwebp/src/dsp/dec_msa.c",
"externals/libwebp/src/dsp/dec_neon.c",
"externals/libwebp/src/dsp/dec_sse2.c",
"externals/libwebp/src/dsp/dsp.h",
"externals/libwebp/src/dsp/enc.c",
"externals/libwebp/src/dsp/enc_mips32.c",
"externals/libwebp/src/dsp/enc_mips_dsp_r2.c",
"externals/libwebp/src/dsp/enc_msa.c",
"externals/libwebp/src/dsp/enc_neon.c",
"externals/libwebp/src/dsp/enc_sse2.c",
"externals/libwebp/src/dsp/filters.c",
"externals/libwebp/src/dsp/filters_mips_dsp_r2.c",
"externals/libwebp/src/dsp/filters_msa.c",
"externals/libwebp/src/dsp/filters_neon.c",
"externals/libwebp/src/dsp/filters_sse2.c",
"externals/libwebp/src/dsp/lossless.c",
"externals/libwebp/src/dsp/lossless.h",
"externals/libwebp/src/dsp/lossless_common.h",
"externals/libwebp/src/dsp/lossless_enc.c",
"externals/libwebp/src/dsp/lossless_enc_mips32.c",
"externals/libwebp/src/dsp/lossless_enc_mips_dsp_r2.c",
"externals/libwebp/src/dsp/lossless_enc_msa.c",
"externals/libwebp/src/dsp/lossless_enc_neon.c",
"externals/libwebp/src/dsp/lossless_enc_sse2.c",
"externals/libwebp/src/dsp/lossless_mips_dsp_r2.c",
"externals/libwebp/src/dsp/lossless_msa.c",
"externals/libwebp/src/dsp/lossless_neon.c",
"externals/libwebp/src/dsp/lossless_sse2.c",
"externals/libwebp/src/dsp/mips_macro.h",
"externals/libwebp/src/dsp/msa_macro.h",
"externals/libwebp/src/dsp/neon.h",
"externals/libwebp/src/dsp/quant.h",
"externals/libwebp/src/dsp/rescaler.c",
"externals/libwebp/src/dsp/rescaler_mips32.c",
"externals/libwebp/src/dsp/rescaler_mips_dsp_r2.c",
"externals/libwebp/src/dsp/rescaler_msa.c",
"externals/libwebp/src/dsp/rescaler_neon.c",
"externals/libwebp/src/dsp/rescaler_sse2.c",
"externals/libwebp/src/dsp/ssim.c",
"externals/libwebp/src/dsp/ssim_sse2.c",
"externals/libwebp/src/dsp/upsampling.c",
"externals/libwebp/src/dsp/upsampling_mips_dsp_r2.c",
"externals/libwebp/src/dsp/upsampling_msa.c",
"externals/libwebp/src/dsp/upsampling_neon.c",
"externals/libwebp/src/dsp/upsampling_sse2.c",
"externals/libwebp/src/dsp/yuv.c",
"externals/libwebp/src/dsp/yuv.h",
"externals/libwebp/src/dsp/yuv_mips32.c",
"externals/libwebp/src/dsp/yuv_mips_dsp_r2.c",
"externals/libwebp/src/dsp/yuv_neon.c",
"externals/libwebp/src/dsp/yuv_sse2.c",
"externals/libwebp/src/enc/alpha_enc.c",
"externals/libwebp/src/enc/analysis_enc.c",
"externals/libwebp/src/enc/backward_references_cost_enc.c",
"externals/libwebp/src/enc/backward_references_enc.c",
"externals/libwebp/src/enc/backward_references_enc.h",
"externals/libwebp/src/enc/config_enc.c",
"externals/libwebp/src/enc/cost_enc.c",
"externals/libwebp/src/enc/cost_enc.h",
"externals/libwebp/src/enc/filter_enc.c",
"externals/libwebp/src/enc/frame_enc.c",
"externals/libwebp/src/enc/histogram_enc.c",
"externals/libwebp/src/enc/histogram_enc.h",
"externals/libwebp/src/enc/iterator_enc.c",
"externals/libwebp/src/enc/near_lossless_enc.c",
"externals/libwebp/src/enc/picture_csp_enc.c",
"externals/libwebp/src/enc/picture_enc.c",
"externals/libwebp/src/enc/picture_psnr_enc.c",
"externals/libwebp/src/enc/picture_rescale_enc.c",
"externals/libwebp/src/enc/picture_tools_enc.c",
"externals/libwebp/src/enc/predictor_enc.c",
"externals/libwebp/src/enc/quant_enc.c",
"externals/libwebp/src/enc/syntax_enc.c",
"externals/libwebp/src/enc/token_enc.c",
"externals/libwebp/src/enc/tree_enc.c",
"externals/libwebp/src/enc/vp8i_enc.h",
"externals/libwebp/src/enc/vp8l_enc.c",
"externals/libwebp/src/enc/vp8li_enc.h",
"externals/libwebp/src/enc/webp_enc.c",
"externals/libwebp/src/mux/anim_encode.c",
"externals/libwebp/src/mux/animi.h",
"externals/libwebp/src/mux/muxedit.c",
"externals/libwebp/src/mux/muxi.h",
"externals/libwebp/src/mux/muxinternal.c",
"externals/libwebp/src/mux/muxread.c",
"externals/libwebp/src/utils/bit_reader_inl_utils.h",
"externals/libwebp/src/utils/bit_reader_utils.c",
"externals/libwebp/src/utils/bit_reader_utils.h",
"externals/libwebp/src/utils/bit_writer_utils.c",
"externals/libwebp/src/utils/bit_writer_utils.h",
"externals/libwebp/src/utils/color_cache_utils.c",
"externals/libwebp/src/utils/color_cache_utils.h",
"externals/libwebp/src/utils/endian_inl_utils.h",
"externals/libwebp/src/utils/filters_utils.c",
"externals/libwebp/src/utils/filters_utils.h",
"externals/libwebp/src/utils/huffman_encode_utils.c",
"externals/libwebp/src/utils/huffman_encode_utils.h",
"externals/libwebp/src/utils/huffman_utils.c",
"externals/libwebp/src/utils/huffman_utils.h",
"externals/libwebp/src/utils/quant_levels_dec_utils.c",
"externals/libwebp/src/utils/quant_levels_dec_utils.h",
"externals/libwebp/src/utils/quant_levels_utils.c",
"externals/libwebp/src/utils/quant_levels_utils.h",
"externals/libwebp/src/utils/random_utils.c",
"externals/libwebp/src/utils/random_utils.h",
"externals/libwebp/src/utils/rescaler_utils.c",
"externals/libwebp/src/utils/rescaler_utils.h",
"externals/libwebp/src/utils/thread_utils.c",
"externals/libwebp/src/utils/thread_utils.h",
"externals/libwebp/src/utils/utils.c",
"externals/libwebp/src/utils/utils.h",
] + select({
"@platforms//cpu:x86_64": [
"externals/libwebp/src/dsp/alpha_processing_sse41.c",
"externals/libwebp/src/dsp/dec_sse41.c",
"externals/libwebp/src/dsp/enc_sse41.c",
"externals/libwebp/src/dsp/lossless_enc_sse41.c",
"externals/libwebp/src/dsp/lossless_sse41.c",
"externals/libwebp/src/dsp/upsampling_sse41.c",
"externals/libwebp/src/dsp/yuv_sse41.c",
],
"//bazel/common_config_settings:cpu_wasm": [], # not sure why wasm doesn't use default
"//conditions:default": [],
})
WEBP_COPTS = [
"-isystem third_party/externals/libwebp/",
] + select({
"@platforms//cpu:x86_64": ["-msse4.1"],
"//bazel/common_config_settings:cpu_wasm": [], # not sure why wasm doesn't use default
"//conditions:default": [],
})
WEBP_DEFINES = [
# TODO(scroggo): swizzle ourself in SkWebpCodec instead of requiring this non-standard libwebp.
"WEBP_SWAP_16BIT_CSP",
]
cc_library(
name = "libwebp",
srcs = WEBP_SRCS,
hdrs = [
"externals/libwebp/src/webp/decode.h",
"externals/libwebp/src/webp/demux.h",
"externals/libwebp/src/webp/encode.h",
"externals/libwebp/src/webp/format_constants.h",
"externals/libwebp/src/webp/mux.h",
"externals/libwebp/src/webp/mux_types.h",
"externals/libwebp/src/webp/types.h",
],
copts = WEBP_COPTS,
local_defines = WEBP_DEFINES,
strip_include_prefix = "externals/libwebp/src/",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
)
cc_library(
name = "wuffs",
# We list this file both as a source file and a header file because it will be
# compiled for symbols *and* included as a header file.
srcs = ["externals/wuffs/release/c/wuffs-v0.3.c"],
# Thankfully, bazel doesn't mind a .c file being declared as a public "header".
hdrs = ["externals/wuffs/release/c/wuffs-v0.3.c"],
local_defines = [
# Copy/pasting from "externals/wuffs/release/c/wuffs-*.c":
#
# ----
#
# Wuffs ships as a "single file C library" or "header file library" as per
# https://github.com/nothings/stb/blob/master/docs/stb_howto.txt
#
# To use that single file as a "foo.c"-like implementation, instead of a
# "foo.h"-like header, #define WUFFS_IMPLEMENTATION before #include'ing or
# compiling it.
#
# ----
"WUFFS_IMPLEMENTATION",
# Continuing to copy/paste:
#
# ----
#
# Defining the WUFFS_CONFIG__MODULE* macros are optional, but it lets users
# of Wuffs' .c file specify which parts of Wuffs to build. That file
# contains the entire Wuffs standard library, implementing a variety of
# codecs and file formats. Without this macro definition, an optimizing
# compiler or linker may very well discard Wuffs code for unused codecs,
# but listing the Wuffs modules we use makes that process explicit.
# Preprocessing means that such code simply isn't compiled.
#
# ----
#
# For Skia, we're only interested in particular image codes (e.g. GIF) and
# their dependencies (e.g. BASE, LZW).
"WUFFS_CONFIG__MODULES",
"WUFFS_CONFIG__MODULE__BASE",
"WUFFS_CONFIG__MODULE__GIF",
"WUFFS_CONFIG__MODULE__LZW",
],
strip_include_prefix = "externals/wuffs/release/c/",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
)
cc_library(
name = "piex",
srcs = [
"externals/piex/src/binary_parse/cached_paged_byte_array.cc",
"externals/piex/src/binary_parse/cached_paged_byte_array.h",
"externals/piex/src/binary_parse/range_checked_byte_ptr.cc",
"externals/piex/src/binary_parse/range_checked_byte_ptr.h",
"externals/piex/src/image_type_recognition/image_type_recognition_lite.cc",
"externals/piex/src/image_type_recognition/image_type_recognition_lite.h",
"externals/piex/src/piex.cc",
"externals/piex/src/tiff_directory/tiff_directory.cc",
"externals/piex/src/tiff_directory/tiff_directory.h",
"externals/piex/src/tiff_parser.cc",
"externals/piex/src/tiff_parser.h",
],
hdrs = [
"externals/piex/src/piex.h",
"externals/piex/src/piex_types.h",
],
copts = [
"-isystem third_party/externals/piex/",
],
local_defines = ["BREAK_IF_DEBUGGING_AND_OUT_OF_RANGE"],
strip_include_prefix = "externals/piex/",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
)
cc_library(
name = "dng_sdk",
srcs = [
"externals/dng_sdk/source/dng_1d_function.cpp",
"externals/dng_sdk/source/dng_1d_table.cpp",
"externals/dng_sdk/source/dng_abort_sniffer.cpp",
"externals/dng_sdk/source/dng_area_task.cpp",
"externals/dng_sdk/source/dng_bad_pixels.cpp",
"externals/dng_sdk/source/dng_bottlenecks.cpp",
"externals/dng_sdk/source/dng_camera_profile.cpp",
"externals/dng_sdk/source/dng_color_space.cpp",
"externals/dng_sdk/source/dng_color_spec.cpp",
"externals/dng_sdk/source/dng_date_time.cpp",
"externals/dng_sdk/source/dng_exceptions.cpp",
"externals/dng_sdk/source/dng_exif.cpp",
"externals/dng_sdk/source/dng_file_stream.cpp",
"externals/dng_sdk/source/dng_filter_task.cpp",
"externals/dng_sdk/source/dng_fingerprint.cpp",
"externals/dng_sdk/source/dng_gain_map.cpp",
"externals/dng_sdk/source/dng_globals.cpp",
"externals/dng_sdk/source/dng_host.cpp",
"externals/dng_sdk/source/dng_hue_sat_map.cpp",
"externals/dng_sdk/source/dng_ifd.cpp",
"externals/dng_sdk/source/dng_image.cpp",
"externals/dng_sdk/source/dng_image_writer.cpp",
"externals/dng_sdk/source/dng_info.cpp",
"externals/dng_sdk/source/dng_iptc.cpp",
"externals/dng_sdk/source/dng_jpeg_image.cpp",
"externals/dng_sdk/source/dng_jpeg_memory_source.cpp",
"externals/dng_sdk/source/dng_lens_correction.cpp",
"externals/dng_sdk/source/dng_linearization_info.cpp",
"externals/dng_sdk/source/dng_lossless_jpeg.cpp",
"externals/dng_sdk/source/dng_matrix.cpp",
"externals/dng_sdk/source/dng_memory.cpp",
"externals/dng_sdk/source/dng_memory_stream.cpp",
"externals/dng_sdk/source/dng_misc_opcodes.cpp",
"externals/dng_sdk/source/dng_mosaic_info.cpp",
"externals/dng_sdk/source/dng_mutex.cpp",
"externals/dng_sdk/source/dng_negative.cpp",
"externals/dng_sdk/source/dng_opcode_list.cpp",
"externals/dng_sdk/source/dng_opcodes.cpp",
"externals/dng_sdk/source/dng_orientation.cpp",
"externals/dng_sdk/source/dng_parse_utils.cpp",
"externals/dng_sdk/source/dng_pixel_buffer.cpp",
"externals/dng_sdk/source/dng_point.cpp",
"externals/dng_sdk/source/dng_preview.cpp",
"externals/dng_sdk/source/dng_pthread.cpp",
"externals/dng_sdk/source/dng_rational.cpp",
"externals/dng_sdk/source/dng_read_image.cpp",
"externals/dng_sdk/source/dng_rect.cpp",
"externals/dng_sdk/source/dng_ref_counted_block.cpp",
"externals/dng_sdk/source/dng_reference.cpp",
"externals/dng_sdk/source/dng_render.cpp",
"externals/dng_sdk/source/dng_resample.cpp",
"externals/dng_sdk/source/dng_safe_arithmetic.cpp",
"externals/dng_sdk/source/dng_shared.cpp",
"externals/dng_sdk/source/dng_simple_image.cpp",
"externals/dng_sdk/source/dng_spline.cpp",
"externals/dng_sdk/source/dng_stream.cpp",
"externals/dng_sdk/source/dng_string.cpp",
"externals/dng_sdk/source/dng_string_list.cpp",
"externals/dng_sdk/source/dng_tag_types.cpp",
"externals/dng_sdk/source/dng_temperature.cpp",
"externals/dng_sdk/source/dng_tile_iterator.cpp",
"externals/dng_sdk/source/dng_tone_curve.cpp",
"externals/dng_sdk/source/dng_utils.cpp",
"externals/dng_sdk/source/dng_xy_coord.cpp",
],
hdrs = [
"externals/dng_sdk/source/RawEnvironment.h",
"externals/dng_sdk/source/dng_1d_function.h",
"externals/dng_sdk/source/dng_1d_table.h",
"externals/dng_sdk/source/dng_abort_sniffer.h",
"externals/dng_sdk/source/dng_area_task.h",
"externals/dng_sdk/source/dng_assertions.h",
"externals/dng_sdk/source/dng_auto_ptr.h",
"externals/dng_sdk/source/dng_bad_pixels.h",
"externals/dng_sdk/source/dng_bottlenecks.h",
"externals/dng_sdk/source/dng_camera_profile.h",
"externals/dng_sdk/source/dng_classes.h",
"externals/dng_sdk/source/dng_color_space.h",
"externals/dng_sdk/source/dng_color_spec.h",
"externals/dng_sdk/source/dng_date_time.h",
"externals/dng_sdk/source/dng_errors.h",
"externals/dng_sdk/source/dng_exceptions.h",
"externals/dng_sdk/source/dng_exif.h",
"externals/dng_sdk/source/dng_fast_module.h",
"externals/dng_sdk/source/dng_file_stream.h",
"externals/dng_sdk/source/dng_filter_task.h",
"externals/dng_sdk/source/dng_fingerprint.h",
"externals/dng_sdk/source/dng_flags.h",
"externals/dng_sdk/source/dng_gain_map.h",
"externals/dng_sdk/source/dng_globals.h",
"externals/dng_sdk/source/dng_host.h",
"externals/dng_sdk/source/dng_hue_sat_map.h",
"externals/dng_sdk/source/dng_ifd.h",
"externals/dng_sdk/source/dng_image.h",
"externals/dng_sdk/source/dng_image_writer.h",
"externals/dng_sdk/source/dng_info.h",
"externals/dng_sdk/source/dng_iptc.h",
"externals/dng_sdk/source/dng_jpeg_image.h",
"externals/dng_sdk/source/dng_jpeg_memory_source.h",
"externals/dng_sdk/source/dng_jpeglib.h",
"externals/dng_sdk/source/dng_lens_correction.h",
"externals/dng_sdk/source/dng_linearization_info.h",
"externals/dng_sdk/source/dng_lossless_jpeg.h",
"externals/dng_sdk/source/dng_matrix.h",
"externals/dng_sdk/source/dng_memory.h",
"externals/dng_sdk/source/dng_memory_stream.h",
"externals/dng_sdk/source/dng_misc_opcodes.h",
"externals/dng_sdk/source/dng_mosaic_info.h",
"externals/dng_sdk/source/dng_mutex.h",
"externals/dng_sdk/source/dng_negative.h",
"externals/dng_sdk/source/dng_opcode_list.h",
"externals/dng_sdk/source/dng_opcodes.h",
"externals/dng_sdk/source/dng_orientation.h",
"externals/dng_sdk/source/dng_parse_utils.h",
"externals/dng_sdk/source/dng_pixel_buffer.h",
"externals/dng_sdk/source/dng_point.h",
"externals/dng_sdk/source/dng_preview.h",
"externals/dng_sdk/source/dng_pthread.h",
"externals/dng_sdk/source/dng_rational.h",
"externals/dng_sdk/source/dng_read_image.h",
"externals/dng_sdk/source/dng_rect.h",
"externals/dng_sdk/source/dng_ref_counted_block.h",
"externals/dng_sdk/source/dng_reference.h",
"externals/dng_sdk/source/dng_render.h",
"externals/dng_sdk/source/dng_resample.h",
"externals/dng_sdk/source/dng_safe_arithmetic.h",
"externals/dng_sdk/source/dng_sdk_limits.h",
"externals/dng_sdk/source/dng_shared.h",
"externals/dng_sdk/source/dng_simple_image.h",
"externals/dng_sdk/source/dng_spline.h",
"externals/dng_sdk/source/dng_stream.h",
"externals/dng_sdk/source/dng_string.h",
"externals/dng_sdk/source/dng_string_list.h",
"externals/dng_sdk/source/dng_tag_codes.h",
"externals/dng_sdk/source/dng_tag_types.h",
"externals/dng_sdk/source/dng_tag_values.h",
"externals/dng_sdk/source/dng_temperature.h",
"externals/dng_sdk/source/dng_tile_iterator.h",
"externals/dng_sdk/source/dng_tone_curve.h",
"externals/dng_sdk/source/dng_types.h",
"externals/dng_sdk/source/dng_uncopyable.h",
"externals/dng_sdk/source/dng_utils.h",
"externals/dng_sdk/source/dng_xy_coord.h",
],
copts = [
"-isystem third_party/externals/dng_sdk/source/",
],
defines = [
"qDNGBigEndian=0", # The GN rules had this defined publicly
] + selects.with_or({
("@platforms//cpu:x86_64", "@platforms//cpu:arm"): [
# DNG SDK uses __builtin_smulll_overflow() to detect 64x64 bit multiply overflow.
# On some platforms, the compiler implements this with __mulodi4().
# I can't quite figure out how to link that here, so instead here's a shim for
# __builtin_smulll_overflow() that multiplies normally assuming no overflow.
# Previously tracked in b/29412086.
# Currently, without this define, we see:
# Error: cannot initialize a parameter of type 'long long *' with an rvalue of type 'std::int64_t *' (aka 'long *')
"__builtin_smulll_overflow(x,y,p)=(*(p)=(x)*(y),false)",
],
"//conditions:default": [],
}),
local_defines = [
"qDNGReportErrors=0",
"qDNGThreadSafe=1",
"qDNGUseLibJPEG=1",
"qDNGUseXMP=0",
"qDNGValidate=0",
"qDNGValidateTarget=1",
"UNIX_ENV=1",
],
strip_include_prefix = "externals/dng_sdk/source/",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
deps = [
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
":libjpeg-turbo",
":zlib",
],
)
FREETYPE_DEFINES = ["FT2_BUILD_LIBRARY"] + select(
{
"//bazel/common_config_settings:cpu_wasm": [
# Use a trimmed down set of options to reduce code size.
"FT_CONFIG_MODULES_H=<include/freetype-no-type1/ftmodule.h>",
"FT_CONFIG_OPTIONS_H=<include/freetype-no-type1/ftoption.h>",
],
"//conditions:default": [
"FT_CONFIG_MODULES_H=<include/freetype-android/ftmodule.h>",
"FT_CONFIG_OPTIONS_H=<include/freetype-android/ftoption.h>",
],
},
)
cc_library(
name = "freetype2",
srcs = [
"externals/freetype/include/freetype/internal/autohint.h",
"externals/freetype/include/freetype/internal/cffotypes.h",
"externals/freetype/include/freetype/internal/cfftypes.h",
"externals/freetype/include/freetype/internal/compiler-macros.h",
"externals/freetype/include/freetype/internal/ftcalc.h",
"externals/freetype/include/freetype/internal/ftdebug.h",
"externals/freetype/include/freetype/internal/ftdrv.h",
"externals/freetype/include/freetype/internal/ftgloadr.h",
"externals/freetype/include/freetype/internal/fthash.h",
"externals/freetype/include/freetype/internal/ftmemory.h",
"externals/freetype/include/freetype/internal/ftobjs.h",
"externals/freetype/include/freetype/internal/ftpsprop.h",
"externals/freetype/include/freetype/internal/ftrfork.h",
"externals/freetype/include/freetype/internal/ftserv.h",
"externals/freetype/include/freetype/internal/ftstream.h",
"externals/freetype/include/freetype/internal/fttrace.h",
"externals/freetype/include/freetype/internal/ftvalid.h",
"externals/freetype/include/freetype/internal/psaux.h",
"externals/freetype/include/freetype/internal/pshints.h",
"externals/freetype/include/freetype/internal/services/svbdf.h",
"externals/freetype/include/freetype/internal/services/svcfftl.h",
"externals/freetype/include/freetype/internal/services/svcid.h",
"externals/freetype/include/freetype/internal/services/svfntfmt.h",
"externals/freetype/include/freetype/internal/services/svgldict.h",
"externals/freetype/include/freetype/internal/services/svgxval.h",
"externals/freetype/include/freetype/internal/services/svkern.h",
"externals/freetype/include/freetype/internal/services/svmetric.h",
"externals/freetype/include/freetype/internal/services/svmm.h",
"externals/freetype/include/freetype/internal/services/svotval.h",
"externals/freetype/include/freetype/internal/services/svpfr.h",
"externals/freetype/include/freetype/internal/services/svpostnm.h",
"externals/freetype/include/freetype/internal/services/svprop.h",
"externals/freetype/include/freetype/internal/services/svpscmap.h",
"externals/freetype/include/freetype/internal/services/svpsinfo.h",
"externals/freetype/include/freetype/internal/services/svsfnt.h",
"externals/freetype/include/freetype/internal/services/svttcmap.h",
"externals/freetype/include/freetype/internal/services/svtteng.h",
"externals/freetype/include/freetype/internal/services/svttglyf.h",
"externals/freetype/include/freetype/internal/services/svwinfnt.h",
"externals/freetype/include/freetype/internal/sfnt.h",
"externals/freetype/include/freetype/internal/svginterface.h",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/include/freetype/internal/t1types.h",
"externals/freetype/include/freetype/internal/tttypes.h",
"externals/freetype/include/freetype/internal/wofftypes.h",
"externals/freetype/include/freetype/otsvg.h",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/include/freetype/t1tables.h",
"externals/freetype/include/freetype/ttnameid.h",
"externals/freetype/include/freetype/tttables.h",
"externals/freetype/include/freetype/tttags.h",
"externals/freetype/src/autofit/afblue.h",
"externals/freetype/src/autofit/afcjk.h",
"externals/freetype/src/autofit/afcover.h",
"externals/freetype/src/autofit/afdummy.h",
"externals/freetype/src/autofit/aferrors.h",
"externals/freetype/src/autofit/afglobal.h",
"externals/freetype/src/autofit/afhints.h",
"externals/freetype/src/autofit/afindic.h",
"externals/freetype/src/autofit/aflatin.h",
"externals/freetype/src/autofit/afloader.h",
"externals/freetype/src/autofit/afmodule.h",
"externals/freetype/src/autofit/afranges.h",
"externals/freetype/src/autofit/afscript.h",
"externals/freetype/src/autofit/afshaper.h",
"externals/freetype/src/autofit/afstyles.h",
"externals/freetype/src/autofit/aftypes.h",
"externals/freetype/src/autofit/afws-decl.h",
"externals/freetype/src/autofit/afws-iter.h",
"externals/freetype/src/autofit/autofit.c",
"externals/freetype/src/base/ftbase.c",
"externals/freetype/src/base/ftbase.h",
"externals/freetype/src/base/ftbbox.c",
"externals/freetype/src/base/ftbitmap.c",
"externals/freetype/src/base/ftdebug.c",
"externals/freetype/src/base/ftfstype.c",
"externals/freetype/src/base/ftgasp.c",
"externals/freetype/src/base/ftglyph.c",
"externals/freetype/src/base/ftinit.c",
"externals/freetype/src/base/ftmm.c",
"externals/freetype/src/base/ftpatent.c",
"externals/freetype/src/base/ftstroke.c",
"externals/freetype/src/base/ftsynth.c",
"externals/freetype/src/base/ftsystem.c",
"externals/freetype/src/base/fttype1.c",
"externals/freetype/src/base/ftwinfnt.c",
"externals/freetype/src/base/md5.h",
"externals/freetype/src/cff/cff.c",
"externals/freetype/src/cff/cffcmap.h",
"externals/freetype/src/cff/cffdrivr.h",
"externals/freetype/src/cff/cfferrs.h",
"externals/freetype/src/cff/cffgload.h",
"externals/freetype/src/cff/cffload.h",
"externals/freetype/src/cff/cffobjs.h",
"externals/freetype/src/cff/cffparse.h",
"externals/freetype/src/cff/cfftoken.h",
"externals/freetype/src/cid/ciderrs.h",
"externals/freetype/src/cid/cidgload.h",
"externals/freetype/src/cid/cidload.h",
"externals/freetype/src/cid/cidobjs.h",
"externals/freetype/src/cid/cidparse.h",
"externals/freetype/src/cid/cidriver.h",
"externals/freetype/src/cid/cidtoken.h",
"externals/freetype/src/cid/type1cid.c",
"externals/freetype/src/gzip/crc32.h",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/src/gzip/ftgzip.c",
"externals/freetype/src/gzip/ftzconf.h",
"externals/freetype/src/gzip/inffast.h",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/src/gzip/inffixed.h",
"externals/freetype/src/gzip/inflate.h",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/src/gzip/inftrees.h",
"externals/freetype/src/gzip/zlib.h",
"externals/freetype/src/gzip/zutil.h",
"externals/freetype/src/psaux/afmparse.h",
"externals/freetype/src/psaux/cffdecode.h",
"externals/freetype/src/psaux/psarrst.h",
"externals/freetype/src/psaux/psaux.c",
"externals/freetype/src/psaux/psauxerr.h",
"externals/freetype/src/psaux/psauxmod.h",
"externals/freetype/src/psaux/psblues.h",
"externals/freetype/src/psaux/psconv.h",
"externals/freetype/src/psaux/pserror.h",
"externals/freetype/src/psaux/psfixed.h",
"externals/freetype/src/psaux/psfont.h",
"externals/freetype/src/psaux/psft.h",
"externals/freetype/src/psaux/psglue.h",
"externals/freetype/src/psaux/pshints.h",
"externals/freetype/src/psaux/psintrp.h",
"externals/freetype/src/psaux/psobjs.h",
"externals/freetype/src/psaux/psread.h",
"externals/freetype/src/psaux/psstack.h",
"externals/freetype/src/psaux/pstypes.h",
"externals/freetype/src/psaux/t1cmap.h",
"externals/freetype/src/psaux/t1decode.h",
"externals/freetype/src/pshinter/pshalgo.h",
"externals/freetype/src/pshinter/pshglob.h",
"externals/freetype/src/pshinter/pshinter.c",
"externals/freetype/src/pshinter/pshmod.h",
"externals/freetype/src/pshinter/pshnterr.h",
"externals/freetype/src/pshinter/pshrec.h",
"externals/freetype/src/psnames/psmodule.h",
"externals/freetype/src/psnames/psnamerr.h",
"externals/freetype/src/psnames/psnames.c",
"externals/freetype/src/psnames/pstables.h",
"externals/freetype/src/raster/ftmisc.h",
"externals/freetype/src/raster/ftraster.h",
"externals/freetype/src/raster/ftrend1.h",
"externals/freetype/src/raster/raster.c",
"externals/freetype/src/raster/rasterrs.h",
"externals/freetype/src/sfnt/pngshim.h",
"externals/freetype/src/sfnt/sfdriver.h",
"externals/freetype/src/sfnt/sferrors.h",
"externals/freetype/src/sfnt/sfnt.c",
"externals/freetype/src/sfnt/sfobjs.h",
"externals/freetype/src/sfnt/sfwoff.h",
"externals/freetype/src/sfnt/sfwoff2.h",
"externals/freetype/src/sfnt/ttbdf.h",
"externals/freetype/src/sfnt/ttcmap.h",
"externals/freetype/src/sfnt/ttcmapc.h",
"externals/freetype/src/sfnt/ttcolr.h",
"externals/freetype/src/sfnt/ttcpal.h",
"externals/freetype/src/sfnt/ttkern.h",
"externals/freetype/src/sfnt/ttload.h",
"externals/freetype/src/sfnt/ttmtx.h",
"externals/freetype/src/sfnt/ttpost.h",
"externals/freetype/src/sfnt/ttsbit.h",
"externals/freetype/src/sfnt/woff2tags.h",
"externals/freetype/src/smooth/ftgrays.h",
"externals/freetype/src/smooth/ftsmerrs.h",
"externals/freetype/src/smooth/ftsmooth.h",
"externals/freetype/src/smooth/smooth.c",
"externals/freetype/src/truetype/truetype.c",
"externals/freetype/src/truetype/ttdriver.h",
"externals/freetype/src/truetype/tterrors.h",
"externals/freetype/src/truetype/ttgload.h",
"externals/freetype/src/truetype/ttgxvar.h",
"externals/freetype/src/truetype/ttinterp.h",
"externals/freetype/src/truetype/ttobjs.h",
"externals/freetype/src/truetype/ttpload.h",
"externals/freetype/src/truetype/ttsubpix.h",
"externals/freetype/src/type1/t1afm.h",
"externals/freetype/src/type1/t1driver.h",
"externals/freetype/src/type1/t1errors.h",
"externals/freetype/src/type1/t1gload.h",
"externals/freetype/src/type1/t1load.h",
"externals/freetype/src/type1/t1objs.h",
"externals/freetype/src/type1/t1parse.h",
"externals/freetype/src/type1/t1tokens.h",
"externals/freetype/src/type1/type1.c",
"freetype2/include/freetype-android/ftmodule.h",
"freetype2/include/freetype-android/ftoption.h",
"freetype2/include/freetype-no-type1/ftmodule.h",
"freetype2/include/freetype-no-type1/ftoption.h",
],
hdrs = [
"externals/freetype/include/freetype/config/ftconfig.h",
"externals/freetype/include/freetype/config/ftheader.h",
"externals/freetype/include/freetype/config/ftmodule.h",
"externals/freetype/include/freetype/config/ftoption.h",
"externals/freetype/include/freetype/config/ftstdlib.h",
"externals/freetype/include/freetype/config/integer-types.h",
"externals/freetype/include/freetype/config/mac-support.h",
"externals/freetype/include/freetype/config/public-macros.h",
"externals/freetype/include/freetype/freetype.h",
"externals/freetype/include/freetype/ftadvanc.h",
"externals/freetype/include/freetype/ftbbox.h",
"externals/freetype/include/freetype/ftbdf.h",
"externals/freetype/include/freetype/ftbitmap.h",
"externals/freetype/include/freetype/ftbzip2.h",
"externals/freetype/include/freetype/ftcache.h",
"externals/freetype/include/freetype/ftchapters.h",
"externals/freetype/include/freetype/ftcid.h",
"externals/freetype/include/freetype/ftcolor.h",
"externals/freetype/include/freetype/ftdriver.h",
"externals/freetype/include/freetype/fterrdef.h",
"externals/freetype/include/freetype/fterrors.h",
"externals/freetype/include/freetype/ftfntfmt.h",
"externals/freetype/include/freetype/ftgasp.h",
"externals/freetype/include/freetype/ftglyph.h",
"externals/freetype/include/freetype/ftgxval.h",
"externals/freetype/include/freetype/ftgzip.h",
"externals/freetype/include/freetype/ftimage.h",
"externals/freetype/include/freetype/ftincrem.h",
"externals/freetype/include/freetype/ftlcdfil.h",
"externals/freetype/include/freetype/ftlist.h",
"externals/freetype/include/freetype/ftlogging.h",
"externals/freetype/include/freetype/ftlzw.h",
"externals/freetype/include/freetype/ftmac.h",
"externals/freetype/include/freetype/ftmm.h",
"externals/freetype/include/freetype/ftmodapi.h",
"externals/freetype/include/freetype/ftmoderr.h",
"externals/freetype/include/freetype/ftotval.h",
"externals/freetype/include/freetype/ftoutln.h",
"externals/freetype/include/freetype/ftparams.h",
"externals/freetype/include/freetype/ftpfr.h",
"externals/freetype/include/freetype/ftrender.h",
"externals/freetype/include/freetype/ftsizes.h",
"externals/freetype/include/freetype/ftsnames.h",
"externals/freetype/include/freetype/ftstroke.h",
"externals/freetype/include/freetype/ftsynth.h",
"externals/freetype/include/freetype/ftsystem.h",
"externals/freetype/include/freetype/fttrigon.h",
"externals/freetype/include/freetype/fttypes.h",
"externals/freetype/include/freetype/ftwinfnt.h",
"externals/freetype/include/freetype/t1tables.h",
"externals/freetype/include/freetype/ttnameid.h",
"externals/freetype/include/freetype/tttables.h",
"externals/freetype/include/freetype/tttags.h",
"externals/freetype/include/ft2build.h",
],
copts = [
"-isystem third_party/externals/freetype/include",
"-isystem third_party/freetype2",
],
defines = [
# Make this define available to any client that has freetype2 as a dep.
"SK_FREETYPE_MINIMUM_RUNTIME_VERSION=(((FREETYPE_MAJOR)<<24)|((FREETYPE_MINOR)<<16)|((FREETYPE_PATCH)<<8))",
],
local_defines = FREETYPE_DEFINES,
strip_include_prefix = "externals/freetype/include/",
# Freetype includes a lot of .c files. We need to make those available for inclusion explicitly.
textual_hdrs = [
"externals/freetype/src/autofit/afblue.c",
"externals/freetype/src/autofit/afcjk.c",
"externals/freetype/src/autofit/afdummy.c",
"externals/freetype/src/autofit/afglobal.c",
"externals/freetype/src/autofit/afhints.c",
"externals/freetype/src/autofit/afindic.c",
"externals/freetype/src/autofit/aflatin.c",
"externals/freetype/src/autofit/afloader.c",
"externals/freetype/src/autofit/afmodule.c",
"externals/freetype/src/autofit/afranges.c",
"externals/freetype/src/autofit/afshaper.c",
"externals/freetype/src/base/ftadvanc.c",
"externals/freetype/src/base/ftbase.c",
"externals/freetype/src/base/ftcalc.c",
"externals/freetype/src/base/ftcolor.c",
"externals/freetype/src/base/ftdbgmem.c",
"externals/freetype/src/base/fterrors.c",
"externals/freetype/src/base/ftfntfmt.c",
"externals/freetype/src/base/ftgloadr.c",
"externals/freetype/src/base/fthash.c",
"externals/freetype/src/base/ftlcdfil.c",
"externals/freetype/src/base/ftmac.c",
"externals/freetype/src/base/ftobjs.c",
"externals/freetype/src/base/ftoutln.c",
"externals/freetype/src/base/ftpsprop.c",
"externals/freetype/src/base/ftrfork.c",
"externals/freetype/src/base/ftsnames.c",
"externals/freetype/src/base/ftstream.c",
"externals/freetype/src/base/fttrigon.c",
"externals/freetype/src/base/ftutil.c",
"externals/freetype/src/cff/cffcmap.c",
"externals/freetype/src/cff/cffdrivr.c",
"externals/freetype/src/cff/cffgload.c",
"externals/freetype/src/cff/cffload.c",
"externals/freetype/src/cff/cffobjs.c",
"externals/freetype/src/cff/cffparse.c",
"externals/freetype/src/cid/cidgload.c",
"externals/freetype/src/cid/cidload.c",
"externals/freetype/src/cid/cidobjs.c",
"externals/freetype/src/cid/cidparse.c",
"externals/freetype/src/cid/cidriver.c",
"externals/freetype/src/gzip/adler32.c",
"externals/freetype/src/gzip/crc32.c",
"externals/freetype/src/gzip/inffast.c",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/src/gzip/inflate.c",
"externals/freetype/src/gzip/inftrees.c",
"externals/freetype/src/gzip/zutil.c",
"externals/freetype/src/psaux/afmparse.c",
"externals/freetype/src/psaux/cffdecode.c",
"externals/freetype/src/psaux/psarrst.c",
"externals/freetype/src/psaux/psauxmod.c",
"externals/freetype/src/psaux/psblues.c",
"externals/freetype/src/psaux/psconv.c",
"externals/freetype/src/psaux/pserror.c",
"externals/freetype/src/psaux/psfont.c",
"externals/freetype/src/psaux/psft.c",
"externals/freetype/src/psaux/pshints.c",
"externals/freetype/src/psaux/psintrp.c",
"externals/freetype/src/psaux/psobjs.c",
"externals/freetype/src/psaux/psread.c",
"externals/freetype/src/psaux/psstack.c",
"externals/freetype/src/psaux/t1cmap.c",
"externals/freetype/src/psaux/t1decode.c",
"externals/freetype/src/pshinter/pshalgo.c",
"externals/freetype/src/pshinter/pshglob.c",
"externals/freetype/src/pshinter/pshmod.c",
"externals/freetype/src/pshinter/pshrec.c",
"externals/freetype/src/psnames/psmodule.c",
"externals/freetype/src/raster/ftraster.c",
"externals/freetype/src/raster/ftrend1.c",
"externals/freetype/src/sfnt/pngshim.c",
"externals/freetype/src/sfnt/sfdriver.c",
"externals/freetype/src/sfnt/sfobjs.c",
"externals/freetype/src/sfnt/sfwoff.c",
"externals/freetype/src/sfnt/sfwoff2.c",
"externals/freetype/src/sfnt/ttbdf.c",
"externals/freetype/src/sfnt/ttcmap.c",
"externals/freetype/src/sfnt/ttcolr.c",
"externals/freetype/src/sfnt/ttcpal.c",
"externals/freetype/src/sfnt/ttkern.c",
"externals/freetype/src/sfnt/ttload.c",
"externals/freetype/src/sfnt/ttmtx.c",
"externals/freetype/src/sfnt/ttpost.c",
"externals/freetype/src/sfnt/ttsbit.c",
"externals/freetype/src/sfnt/ttsvg.c",
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
"externals/freetype/src/sfnt/woff2tags.c",
"externals/freetype/src/smooth/ftgrays.c",
"externals/freetype/src/smooth/ftsmooth.c",
"externals/freetype/src/truetype/ttdriver.c",
"externals/freetype/src/truetype/ttgload.c",
"externals/freetype/src/truetype/ttgxvar.c",
"externals/freetype/src/truetype/ttinterp.c",
"externals/freetype/src/truetype/ttobjs.c",
"externals/freetype/src/truetype/ttpload.c",
"externals/freetype/src/truetype/ttsubpix.c",
"externals/freetype/src/type1/t1afm.c",
"externals/freetype/src/type1/t1driver.c",
"externals/freetype/src/type1/t1gload.c",
"externals/freetype/src/type1/t1load.c",
"externals/freetype/src/type1/t1objs.c",
"externals/freetype/src/type1/t1parse.c",
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
[canvaskit] Add Freetype/Fonts to Bazel Build This re-works src/ports/BUILD.bazel to work like our other BUILD files, i.e. one rule "srcs" that brings in the necessary private filegroups. To work around an abort with LLVM [1], we have to go back to an earlier version of emscripten (temporarily?). Future work should look at using transitions [2] to allow various executables (e.g. CanvasKit, DM) to set their own set of Bazel flags, w/o the build invokers having to specify them. These transitions might be able to handle more complex cases that we currently use if statements in GN to deal with. The Freetype build rule was created by taking the BUILD.gn rule, adding in all the sources listed there and then playing compile-whack-a-mole to add in all the headers and included .c files. Suggested Review Order: - third_party/BUILD.bazel to see freetype build rules - bazel/common_config_settings/ to see treatment of fontmgr like codecs (many possible) and fontmgr_factory (only one). - src/ports/BUILD.bazel - BUILD.bazel - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that calls tools/embed_resources.py to produce the .cpp file containing the embedded font data. - Everything else. [1] https://github.com/emscripten-core/emscripten/issues/15528 [2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts Bug: skia:12541 Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-16 19:09:44 +00:00
deps = [
":libpng", # TODO(kjlubick) add brotli option
[infra] Add Bazel rules for codecs. This ports the third_party BUILD.gn files related to codecs (with a best-effort on arm/SIMD stuff). This includes: - libpng - libjpeg-turbo - libwebp - wuffs (gif) - libgifcodec - dng_sdk and piex (raw codec) This expands the string_flag_with_values macro to allow multiple values to be set at once. This was added in Bazel 5.0.0, however the latest pre-release version of that has a bug [1] which slows down compilation dramatically. This was fixed at ToT, but not released. As a result, I started using the Bazel 6 pre-release (via bazelisk). The macro select_multi makes writing select() where multiple elements could be on possible/easier. One can try compiling certain codecs by running: bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec Suggested Review Order: - bazel/macros.bzl - bazel/common_config_settings/defs.bzl and its BUILD.bazel to see how the codec options are defined. - BUILD.bazel to see how the codec settings are used. - src/codec/BUILD.bazel to see the inclusion of Skia files to deal with specific codecs. - third_party/BUILD.bazel (while referencing the corresponding BUILD.gn files, such as third_party/libwebp/BUILD.gn) - Everything else. Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 17:50:02 +00:00
],
)
ICU_HDRS = [
"externals/icu/source/common/bmpset.h",
"externals/icu/source/common/brkeng.h",
"externals/icu/source/common/bytesinkutil.h",
"externals/icu/source/common/capi_helper.h",
"externals/icu/source/common/charstr.h",
"externals/icu/source/common/charstrmap.h",
"externals/icu/source/common/cmemory.h",
"externals/icu/source/common/cpputils.h",
"externals/icu/source/common/cstr.h",
"externals/icu/source/common/cstring.h",
"externals/icu/source/common/cwchar.h",
"externals/icu/source/common/dictbe.h",
"externals/icu/source/common/dictionarydata.h",
"externals/icu/source/common/hash.h",
"externals/icu/source/common/icuplugimp.h",
"externals/icu/source/common/localeprioritylist.h",
"externals/icu/source/common/localsvc.h",
"externals/icu/source/common/locbased.h",
"externals/icu/source/common/locdistance.h",
"externals/icu/source/common/loclikelysubtags.h",
"externals/icu/source/common/locmap.h",
"externals/icu/source/common/locutil.h",
"externals/icu/source/common/lsr.h",
"externals/icu/source/common/messageimpl.h",
"externals/icu/source/common/msvcres.h",
"externals/icu/source/common/mutex.h",
"externals/icu/source/common/norm2_nfc_data.h",
"externals/icu/source/common/norm2allmodes.h",
"externals/icu/source/common/normalizer2impl.h",
"externals/icu/source/common/patternprops.h",
"externals/icu/source/common/pluralmap.h",
"externals/icu/source/common/propname.h",
"externals/icu/source/common/propname_data.h",
"externals/icu/source/common/propsvec.h",
"externals/icu/source/common/punycode.h",
"externals/icu/source/common/putilimp.h",
"externals/icu/source/common/rbbi_cache.h",
"externals/icu/source/common/rbbidata.h",
"externals/icu/source/common/rbbinode.h",
"externals/icu/source/common/rbbirb.h",
"externals/icu/source/common/rbbirpt.h",
"externals/icu/source/common/rbbiscan.h",
"externals/icu/source/common/rbbisetb.h",
"externals/icu/source/common/rbbitblb.h",
"externals/icu/source/common/resource.h",
"externals/icu/source/common/restrace.h",
"externals/icu/source/common/ruleiter.h",
"externals/icu/source/common/serv.h",
"externals/icu/source/common/servloc.h",
"externals/icu/source/common/servnotf.h",
"externals/icu/source/common/sharedobject.h",
"externals/icu/source/common/sprpimpl.h",
"externals/icu/source/common/static_unicode_sets.h",
"externals/icu/source/common/uarrsort.h",
"externals/icu/source/common/uassert.h",
"externals/icu/source/common/ubidi_props.h",
"externals/icu/source/common/ubidi_props_data.h",
"externals/icu/source/common/ubidiimp.h",
"externals/icu/source/common/ubrkimpl.h",
"externals/icu/source/common/ucase.h",
"externals/icu/source/common/ucase_props_data.h",
"externals/icu/source/common/ucasemap_imp.h",
"externals/icu/source/common/uchar_props_data.h",
"externals/icu/source/common/ucln.h",
"externals/icu/source/common/ucln_cmn.h",
"externals/icu/source/common/ucln_imp.h",
"externals/icu/source/common/ucmndata.h",
"externals/icu/source/common/ucnv_bld.h",
"externals/icu/source/common/ucnv_cnv.h",
"externals/icu/source/common/ucnv_ext.h",
"externals/icu/source/common/ucnv_imp.h",
"externals/icu/source/common/ucnv_io.h",
"externals/icu/source/common/ucnvmbcs.h",
"externals/icu/source/common/ucol_data.h",
"externals/icu/source/common/ucol_swp.h",
"externals/icu/source/common/ucptrie_impl.h",
"externals/icu/source/common/ucurrimp.h",
"externals/icu/source/common/udatamem.h",
"externals/icu/source/common/udataswp.h",
"externals/icu/source/common/uelement.h",
"externals/icu/source/common/uenumimp.h",
"externals/icu/source/common/uhash.h",
"externals/icu/source/common/uinvchar.h",
"externals/icu/source/common/ulayout_props.h",
"externals/icu/source/common/ulist.h",
"externals/icu/source/common/ulocimp.h",
"externals/icu/source/common/umapfile.h",
"externals/icu/source/common/umutex.h",
"externals/icu/source/common/unicode/appendable.h",
"externals/icu/source/common/unicode/brkiter.h",
"externals/icu/source/common/unicode/bytestream.h",
"externals/icu/source/common/unicode/bytestrie.h",
"externals/icu/source/common/unicode/bytestriebuilder.h",
"externals/icu/source/common/unicode/caniter.h",
"externals/icu/source/common/unicode/casemap.h",
"externals/icu/source/common/unicode/char16ptr.h",
"externals/icu/source/common/unicode/chariter.h",
"externals/icu/source/common/unicode/dbbi.h",
"externals/icu/source/common/unicode/docmain.h",
"externals/icu/source/common/unicode/dtintrv.h",
"externals/icu/source/common/unicode/edits.h",
"externals/icu/source/common/unicode/enumset.h",
"externals/icu/source/common/unicode/errorcode.h",
"externals/icu/source/common/unicode/filteredbrk.h",
"externals/icu/source/common/unicode/icudataver.h",
"externals/icu/source/common/unicode/icuplug.h",
"externals/icu/source/common/unicode/idna.h",
"externals/icu/source/common/unicode/localebuilder.h",
"externals/icu/source/common/unicode/localematcher.h",
"externals/icu/source/common/unicode/localpointer.h",
"externals/icu/source/common/unicode/locdspnm.h",
"externals/icu/source/common/unicode/locid.h",
"externals/icu/source/common/unicode/messagepattern.h",
"externals/icu/source/common/unicode/normalizer2.h",
"externals/icu/source/common/unicode/normlzr.h",
"externals/icu/source/common/unicode/parseerr.h",
"externals/icu/source/common/unicode/parsepos.h",
"externals/icu/source/common/unicode/platform.h",
"externals/icu/source/common/unicode/ptypes.h",
"externals/icu/source/common/unicode/putil.h",
"externals/icu/source/common/unicode/rbbi.h",
"externals/icu/source/common/unicode/rep.h",
"externals/icu/source/common/unicode/resbund.h",
"externals/icu/source/common/unicode/schriter.h",
"externals/icu/source/common/unicode/simpleformatter.h",
"externals/icu/source/common/unicode/std_string.h",
"externals/icu/source/common/unicode/strenum.h",
"externals/icu/source/common/unicode/stringoptions.h",
"externals/icu/source/common/unicode/stringpiece.h",
"externals/icu/source/common/unicode/stringtriebuilder.h",
"externals/icu/source/common/unicode/symtable.h",
"externals/icu/source/common/unicode/ubidi.h",
"externals/icu/source/common/unicode/ubiditransform.h",
"externals/icu/source/common/unicode/ubrk.h",
"externals/icu/source/common/unicode/ucasemap.h",
"externals/icu/source/common/unicode/ucat.h",
"externals/icu/source/common/unicode/uchar.h",
"externals/icu/source/common/unicode/ucharstrie.h",
"externals/icu/source/common/unicode/ucharstriebuilder.h",
"externals/icu/source/common/unicode/uchriter.h",
"externals/icu/source/common/unicode/uclean.h",
"externals/icu/source/common/unicode/ucnv.h",
"externals/icu/source/common/unicode/ucnv_cb.h",
"externals/icu/source/common/unicode/ucnv_err.h",
"externals/icu/source/common/unicode/ucnvsel.h",
"externals/icu/source/common/unicode/uconfig.h",
"externals/icu/source/common/unicode/ucpmap.h",
"externals/icu/source/common/unicode/ucptrie.h",
"externals/icu/source/common/unicode/ucurr.h",
"externals/icu/source/common/unicode/udata.h",
"externals/icu/source/common/unicode/udisplaycontext.h",
"externals/icu/source/common/unicode/uenum.h",
"externals/icu/source/common/unicode/uidna.h",
"externals/icu/source/common/unicode/uiter.h",
"externals/icu/source/common/unicode/uldnames.h",
"externals/icu/source/common/unicode/uloc.h",
"externals/icu/source/common/unicode/umachine.h",
"externals/icu/source/common/unicode/umisc.h",
"externals/icu/source/common/unicode/umutablecptrie.h",
"externals/icu/source/common/unicode/unifilt.h",
"externals/icu/source/common/unicode/unifunct.h",
"externals/icu/source/common/unicode/unimatch.h",
"externals/icu/source/common/unicode/uniset.h",
"externals/icu/source/common/unicode/unistr.h",
"externals/icu/source/common/unicode/unorm.h",
"externals/icu/source/common/unicode/unorm2.h",
"externals/icu/source/common/unicode/uobject.h",
"externals/icu/source/common/unicode/urename.h",
"externals/icu/source/common/unicode/urep.h",
"externals/icu/source/common/unicode/ures.h",
"externals/icu/source/common/unicode/uscript.h",
"externals/icu/source/common/unicode/uset.h",
"externals/icu/source/common/unicode/usetiter.h",
"externals/icu/source/common/unicode/ushape.h",
"externals/icu/source/common/unicode/usprep.h",
"externals/icu/source/common/unicode/ustring.h",
"externals/icu/source/common/unicode/ustringtrie.h",
"externals/icu/source/common/unicode/utext.h",
"externals/icu/source/common/unicode/utf.h",
"externals/icu/source/common/unicode/utf16.h",
"externals/icu/source/common/unicode/utf32.h",
"externals/icu/source/common/unicode/utf8.h",
"externals/icu/source/common/unicode/utf_old.h",
"externals/icu/source/common/unicode/utrace.h",
"externals/icu/source/common/unicode/utypes.h",
"externals/icu/source/common/unicode/uvernum.h",
"externals/icu/source/common/unicode/uversion.h",
"externals/icu/source/common/unifiedcache.h",
"externals/icu/source/common/uniquecharstr.h",
"externals/icu/source/common/unisetspan.h",
"externals/icu/source/common/unistrappender.h",
"externals/icu/source/common/unormimp.h",
"externals/icu/source/common/uposixdefs.h",
"externals/icu/source/common/uprops.h",
"externals/icu/source/common/uresdata.h",
"externals/icu/source/common/uresimp.h",
"externals/icu/source/common/ureslocs.h",
"externals/icu/source/common/usc_impl.h",
"externals/icu/source/common/uset_imp.h",
"externals/icu/source/common/ustr_cnv.h",
"externals/icu/source/common/ustr_imp.h",
"externals/icu/source/common/ustrenum.h",
"externals/icu/source/common/ustrfmt.h",
"externals/icu/source/common/util.h",
"externals/icu/source/common/utracimp.h",
"externals/icu/source/common/utrie.h",
"externals/icu/source/common/utrie2.h",
"externals/icu/source/common/utrie2_impl.h",
"externals/icu/source/common/utypeinfo.h",
"externals/icu/source/common/uvector.h",
"externals/icu/source/common/uvectr32.h",
"externals/icu/source/common/uvectr64.h",
"externals/icu/source/common/wintz.h",
"externals/icu/source/i18n/anytrans.h",
"externals/icu/source/i18n/astro.h",
"externals/icu/source/i18n/bocsu.h",
"externals/icu/source/i18n/brktrans.h",
"externals/icu/source/i18n/buddhcal.h",
"externals/icu/source/i18n/casetrn.h",
"externals/icu/source/i18n/cecal.h",
"externals/icu/source/i18n/chnsecal.h",
"externals/icu/source/i18n/collation.h",
"externals/icu/source/i18n/collationbuilder.h",
"externals/icu/source/i18n/collationcompare.h",
"externals/icu/source/i18n/collationdata.h",
"externals/icu/source/i18n/collationdatabuilder.h",
"externals/icu/source/i18n/collationdatareader.h",
"externals/icu/source/i18n/collationdatawriter.h",
"externals/icu/source/i18n/collationfastlatin.h",
"externals/icu/source/i18n/collationfastlatinbuilder.h",
"externals/icu/source/i18n/collationfcd.h",
"externals/icu/source/i18n/collationiterator.h",
"externals/icu/source/i18n/collationkeys.h",
"externals/icu/source/i18n/collationroot.h",
"externals/icu/source/i18n/collationrootelements.h",
"externals/icu/source/i18n/collationruleparser.h",
"externals/icu/source/i18n/collationsets.h",
"externals/icu/source/i18n/collationsettings.h",
"externals/icu/source/i18n/collationtailoring.h",
"externals/icu/source/i18n/collationweights.h",
"externals/icu/source/i18n/collunsafe.h",
"externals/icu/source/i18n/coptccal.h",
"externals/icu/source/i18n/cpdtrans.h",
"externals/icu/source/i18n/csdetect.h",
"externals/icu/source/i18n/csmatch.h",
"externals/icu/source/i18n/csr2022.h",
"externals/icu/source/i18n/csrecog.h",
"externals/icu/source/i18n/csrmbcs.h",
"externals/icu/source/i18n/csrsbcs.h",
"externals/icu/source/i18n/csrucode.h",
"externals/icu/source/i18n/csrutf8.h",
"externals/icu/source/i18n/currfmt.h",
"externals/icu/source/i18n/dangical.h",
"externals/icu/source/i18n/dayperiodrules.h",
"externals/icu/source/i18n/decContext.h",
"externals/icu/source/i18n/decNumber.h",
"externals/icu/source/i18n/decNumberLocal.h",
"externals/icu/source/i18n/double-conversion-bignum-dtoa.h",
"externals/icu/source/i18n/double-conversion-bignum.h",
"externals/icu/source/i18n/double-conversion-cached-powers.h",
"externals/icu/source/i18n/double-conversion-diy-fp.h",
"externals/icu/source/i18n/double-conversion-double-to-string.h",
"externals/icu/source/i18n/double-conversion-fast-dtoa.h",
"externals/icu/source/i18n/double-conversion-ieee.h",
"externals/icu/source/i18n/double-conversion-string-to-double.h",
"externals/icu/source/i18n/double-conversion-strtod.h",
"externals/icu/source/i18n/double-conversion-utils.h",
"externals/icu/source/i18n/double-conversion.h",
"externals/icu/source/i18n/dt_impl.h",
"externals/icu/source/i18n/dtitv_impl.h",
"externals/icu/source/i18n/dtptngen_impl.h",
"externals/icu/source/i18n/erarules.h",
"externals/icu/source/i18n/esctrn.h",
"externals/icu/source/i18n/ethpccal.h",
"externals/icu/source/i18n/fmtableimp.h",
"externals/icu/source/i18n/formatted_string_builder.h",
"externals/icu/source/i18n/formattedval_impl.h",
"externals/icu/source/i18n/fphdlimp.h",
"externals/icu/source/i18n/funcrepl.h",
"externals/icu/source/i18n/gregoimp.h",
"externals/icu/source/i18n/hebrwcal.h",
"externals/icu/source/i18n/indiancal.h",
"externals/icu/source/i18n/inputext.h",
"externals/icu/source/i18n/islamcal.h",
"externals/icu/source/i18n/japancal.h",
"externals/icu/source/i18n/measunit_impl.h",
"externals/icu/source/i18n/msgfmt_impl.h",
"externals/icu/source/i18n/name2uni.h",
"externals/icu/source/i18n/nfrlist.h",
"externals/icu/source/i18n/nfrs.h",
"externals/icu/source/i18n/nfrule.h",
"externals/icu/source/i18n/nfsubs.h",
"externals/icu/source/i18n/nortrans.h",
"externals/icu/source/i18n/nultrans.h",
"externals/icu/source/i18n/number_affixutils.h",
"externals/icu/source/i18n/number_asformat.h",
"externals/icu/source/i18n/number_compact.h",
"externals/icu/source/i18n/number_currencysymbols.h",
"externals/icu/source/i18n/number_decimalquantity.h",
"externals/icu/source/i18n/number_decimfmtprops.h",
"externals/icu/source/i18n/number_decnum.h",
"externals/icu/source/i18n/number_formatimpl.h",
"externals/icu/source/i18n/number_longnames.h",
"externals/icu/source/i18n/number_mapper.h",
"externals/icu/source/i18n/number_microprops.h",
"externals/icu/source/i18n/number_modifiers.h",
"externals/icu/source/i18n/number_multiplier.h",
"externals/icu/source/i18n/number_patternmodifier.h",
"externals/icu/source/i18n/number_patternstring.h",
"externals/icu/source/i18n/number_roundingutils.h",
"externals/icu/source/i18n/number_scientific.h",
"externals/icu/source/i18n/number_skeletons.h",
"externals/icu/source/i18n/number_types.h",
"externals/icu/source/i18n/number_usageprefs.h",
"externals/icu/source/i18n/number_utils.h",
"externals/icu/source/i18n/number_utypes.h",
"externals/icu/source/i18n/numparse_affixes.h",
"externals/icu/source/i18n/numparse_compositions.h",
"externals/icu/source/i18n/numparse_currency.h",
"externals/icu/source/i18n/numparse_decimal.h",
"externals/icu/source/i18n/numparse_impl.h",
"externals/icu/source/i18n/numparse_scientific.h",
"externals/icu/source/i18n/numparse_symbols.h",
"externals/icu/source/i18n/numparse_types.h",
"externals/icu/source/i18n/numparse_utils.h",
"externals/icu/source/i18n/numparse_validators.h",
"externals/icu/source/i18n/numrange_impl.h",
"externals/icu/source/i18n/numsys_impl.h",
"externals/icu/source/i18n/olsontz.h",
"externals/icu/source/i18n/persncal.h",
"externals/icu/source/i18n/pluralranges.h",
"externals/icu/source/i18n/plurrule_impl.h",
"externals/icu/source/i18n/quant.h",
"externals/icu/source/i18n/quantityformatter.h",
"externals/icu/source/i18n/rbt.h",
"externals/icu/source/i18n/rbt_data.h",
"externals/icu/source/i18n/rbt_pars.h",
"externals/icu/source/i18n/rbt_rule.h",
"externals/icu/source/i18n/rbt_set.h",
"externals/icu/source/i18n/regexcmp.h",
"externals/icu/source/i18n/regexcst.h",
"externals/icu/source/i18n/regeximp.h",
"externals/icu/source/i18n/regexst.h",
"externals/icu/source/i18n/regextxt.h",
"externals/icu/source/i18n/region_impl.h",
"externals/icu/source/i18n/reldtfmt.h",
"externals/icu/source/i18n/remtrans.h",
"externals/icu/source/i18n/scriptset.h",
"externals/icu/source/i18n/selfmtimpl.h",
"externals/icu/source/i18n/sharedbreakiterator.h",
"externals/icu/source/i18n/sharedcalendar.h",
"externals/icu/source/i18n/shareddateformatsymbols.h",
"externals/icu/source/i18n/sharednumberformat.h",
"externals/icu/source/i18n/sharedpluralrules.h",
"externals/icu/source/i18n/smpdtfst.h",
"externals/icu/source/i18n/standardplural.h",
"externals/icu/source/i18n/string_segment.h",
"externals/icu/source/i18n/strmatch.h",
"externals/icu/source/i18n/strrepl.h",
"externals/icu/source/i18n/taiwncal.h",
"externals/icu/source/i18n/titletrn.h",
"externals/icu/source/i18n/tolowtrn.h",
"externals/icu/source/i18n/toupptrn.h",
"externals/icu/source/i18n/transreg.h",
"externals/icu/source/i18n/tridpars.h",
"externals/icu/source/i18n/tzgnames.h",
"externals/icu/source/i18n/tznames_impl.h",
"externals/icu/source/i18n/ucln_in.h",
"externals/icu/source/i18n/ucol_imp.h",
"externals/icu/source/i18n/uitercollationiterator.h",
"externals/icu/source/i18n/umsg_imp.h",
"externals/icu/source/i18n/unesctrn.h",
"externals/icu/source/i18n/uni2name.h",
"externals/icu/source/i18n/unicode/alphaindex.h",
"externals/icu/source/i18n/unicode/basictz.h",
"externals/icu/source/i18n/unicode/calendar.h",
"externals/icu/source/i18n/unicode/choicfmt.h",
"externals/icu/source/i18n/unicode/coleitr.h",
"externals/icu/source/i18n/unicode/coll.h",
"externals/icu/source/i18n/unicode/compactdecimalformat.h",
"externals/icu/source/i18n/unicode/curramt.h",
"externals/icu/source/i18n/unicode/currpinf.h",
"externals/icu/source/i18n/unicode/currunit.h",
"externals/icu/source/i18n/unicode/datefmt.h",
"externals/icu/source/i18n/unicode/dcfmtsym.h",
"externals/icu/source/i18n/unicode/decimfmt.h",
"externals/icu/source/i18n/unicode/dtfmtsym.h",
"externals/icu/source/i18n/unicode/dtitvfmt.h",
"externals/icu/source/i18n/unicode/dtitvinf.h",
"externals/icu/source/i18n/unicode/dtptngen.h",
"externals/icu/source/i18n/unicode/dtrule.h",
"externals/icu/source/i18n/unicode/fieldpos.h",
"externals/icu/source/i18n/unicode/fmtable.h",
"externals/icu/source/i18n/unicode/format.h",
"externals/icu/source/i18n/unicode/formattedvalue.h",
"externals/icu/source/i18n/unicode/fpositer.h",
"externals/icu/source/i18n/unicode/gender.h",
"externals/icu/source/i18n/unicode/gregocal.h",
"externals/icu/source/i18n/unicode/listformatter.h",
"externals/icu/source/i18n/unicode/measfmt.h",
"externals/icu/source/i18n/unicode/measunit.h",
"externals/icu/source/i18n/unicode/measure.h",
"externals/icu/source/i18n/unicode/msgfmt.h",
"externals/icu/source/i18n/unicode/nounit.h",
"externals/icu/source/i18n/unicode/numberformatter.h",
"externals/icu/source/i18n/unicode/numberrangeformatter.h",
"externals/icu/source/i18n/unicode/numfmt.h",
"externals/icu/source/i18n/unicode/numsys.h",
"externals/icu/source/i18n/unicode/plurfmt.h",
"externals/icu/source/i18n/unicode/plurrule.h",
"externals/icu/source/i18n/unicode/rbnf.h",
"externals/icu/source/i18n/unicode/rbtz.h",
"externals/icu/source/i18n/unicode/regex.h",
"externals/icu/source/i18n/unicode/region.h",
"externals/icu/source/i18n/unicode/reldatefmt.h",
"externals/icu/source/i18n/unicode/scientificnumberformatter.h",
"externals/icu/source/i18n/unicode/search.h",
"externals/icu/source/i18n/unicode/selfmt.h",
"externals/icu/source/i18n/unicode/simpletz.h",
"externals/icu/source/i18n/unicode/smpdtfmt.h",
"externals/icu/source/i18n/unicode/sortkey.h",
"externals/icu/source/i18n/unicode/stsearch.h",
"externals/icu/source/i18n/unicode/tblcoll.h",
"externals/icu/source/i18n/unicode/timezone.h",
"externals/icu/source/i18n/unicode/tmunit.h",
"externals/icu/source/i18n/unicode/tmutamt.h",
"externals/icu/source/i18n/unicode/tmutfmt.h",
"externals/icu/source/i18n/unicode/translit.h",
"externals/icu/source/i18n/unicode/tzfmt.h",
"externals/icu/source/i18n/unicode/tznames.h",
"externals/icu/source/i18n/unicode/tzrule.h",
"externals/icu/source/i18n/unicode/tztrans.h",
"externals/icu/source/i18n/unicode/ucal.h",
"externals/icu/source/i18n/unicode/ucol.h",
"externals/icu/source/i18n/unicode/ucoleitr.h",
"externals/icu/source/i18n/unicode/ucsdet.h",
"externals/icu/source/i18n/unicode/udat.h",
"externals/icu/source/i18n/unicode/udateintervalformat.h",
"externals/icu/source/i18n/unicode/udatpg.h",
"externals/icu/source/i18n/unicode/ufieldpositer.h",
"externals/icu/source/i18n/unicode/uformattable.h",
"externals/icu/source/i18n/unicode/uformattedvalue.h",
"externals/icu/source/i18n/unicode/ugender.h",
"externals/icu/source/i18n/unicode/ulistformatter.h",
"externals/icu/source/i18n/unicode/ulocdata.h",
"externals/icu/source/i18n/unicode/umsg.h",
"externals/icu/source/i18n/unicode/unirepl.h",
"externals/icu/source/i18n/unicode/unum.h",
"externals/icu/source/i18n/unicode/unumberformatter.h",
"externals/icu/source/i18n/unicode/unumberrangeformatter.h",
"externals/icu/source/i18n/unicode/unumsys.h",
"externals/icu/source/i18n/unicode/upluralrules.h",
"externals/icu/source/i18n/unicode/uregex.h",
"externals/icu/source/i18n/unicode/uregion.h",
"externals/icu/source/i18n/unicode/ureldatefmt.h",
"externals/icu/source/i18n/unicode/usearch.h",
"externals/icu/source/i18n/unicode/uspoof.h",
"externals/icu/source/i18n/unicode/utmscale.h",
"externals/icu/source/i18n/unicode/utrans.h",
"externals/icu/source/i18n/unicode/vtzone.h",
"externals/icu/source/i18n/units_complexconverter.h",
"externals/icu/source/i18n/units_converter.h",
"externals/icu/source/i18n/units_data.h",
"externals/icu/source/i18n/units_router.h",
"externals/icu/source/i18n/uspoof_conf.h",
"externals/icu/source/i18n/uspoof_impl.h",
"externals/icu/source/i18n/usrchimp.h",
"externals/icu/source/i18n/utf16collationiterator.h",
"externals/icu/source/i18n/utf8collationiterator.h",
"externals/icu/source/i18n/vzone.h",
"externals/icu/source/i18n/windtfmt.h",
"externals/icu/source/i18n/winnmfmt.h",
"externals/icu/source/i18n/wintzimpl.h",
"externals/icu/source/i18n/zonemeta.h",
"externals/icu/source/i18n/zrule.h",
"externals/icu/source/i18n/ztrans.h",
"icu/SkLoadICU.h",
]
ICU_SRCS = [
"externals/icu/source/common/bmpset.cpp",
"externals/icu/source/common/brkeng.cpp",
"externals/icu/source/common/brkiter.cpp",
"externals/icu/source/common/bytesinkutil.cpp",
"externals/icu/source/common/bytestream.cpp",
"externals/icu/source/common/bytestrie.cpp",
"externals/icu/source/common/bytestriebuilder.cpp",
"externals/icu/source/common/bytestrieiterator.cpp",
"externals/icu/source/common/caniter.cpp",
"externals/icu/source/common/characterproperties.cpp",
"externals/icu/source/common/chariter.cpp",
"externals/icu/source/common/charstr.cpp",
"externals/icu/source/common/cmemory.cpp",
"externals/icu/source/common/cstr.cpp",
"externals/icu/source/common/cstring.cpp",
"externals/icu/source/common/cwchar.cpp",
"externals/icu/source/common/dictbe.cpp",
"externals/icu/source/common/dictionarydata.cpp",
"externals/icu/source/common/dtintrv.cpp",
"externals/icu/source/common/edits.cpp",
"externals/icu/source/common/errorcode.cpp",
"externals/icu/source/common/filteredbrk.cpp",
"externals/icu/source/common/filterednormalizer2.cpp",
"externals/icu/source/common/icudataver.cpp",
"externals/icu/source/common/icuplug.cpp",
"externals/icu/source/common/loadednormalizer2impl.cpp",
"externals/icu/source/common/localebuilder.cpp",
"externals/icu/source/common/locavailable.cpp",
"externals/icu/source/common/locbased.cpp",
"externals/icu/source/common/locdispnames.cpp",
"externals/icu/source/common/locdspnm.cpp",
"externals/icu/source/common/locid.cpp",
"externals/icu/source/common/loclikely.cpp",
"externals/icu/source/common/locmap.cpp",
"externals/icu/source/common/locresdata.cpp",
"externals/icu/source/common/locutil.cpp",
"externals/icu/source/common/messagepattern.cpp",
"externals/icu/source/common/normalizer2.cpp",
"externals/icu/source/common/normalizer2impl.cpp",
"externals/icu/source/common/normlzr.cpp",
"externals/icu/source/common/parsepos.cpp",
"externals/icu/source/common/patternprops.cpp",
"externals/icu/source/common/pluralmap.cpp",
"externals/icu/source/common/propname.cpp",
"externals/icu/source/common/propsvec.cpp",
"externals/icu/source/common/punycode.cpp",
"externals/icu/source/common/putil.cpp",
"externals/icu/source/common/rbbi.cpp",
"externals/icu/source/common/rbbi_cache.cpp",
"externals/icu/source/common/rbbidata.cpp",
"externals/icu/source/common/rbbinode.cpp",
"externals/icu/source/common/rbbirb.cpp",
"externals/icu/source/common/rbbiscan.cpp",
"externals/icu/source/common/rbbisetb.cpp",
"externals/icu/source/common/rbbistbl.cpp",
"externals/icu/source/common/rbbitblb.cpp",
"externals/icu/source/common/resbund.cpp",
"externals/icu/source/common/resbund_cnv.cpp",
"externals/icu/source/common/resource.cpp",
"externals/icu/source/common/ruleiter.cpp",
"externals/icu/source/common/schriter.cpp",
"externals/icu/source/common/serv.cpp",
"externals/icu/source/common/servlk.cpp",
"externals/icu/source/common/servlkf.cpp",
"externals/icu/source/common/servls.cpp",
"externals/icu/source/common/servnotf.cpp",
"externals/icu/source/common/servrbf.cpp",
"externals/icu/source/common/servslkf.cpp",
"externals/icu/source/common/sharedobject.cpp",
"externals/icu/source/common/simpleformatter.cpp",
"externals/icu/source/common/static_unicode_sets.cpp",
"externals/icu/source/common/stringpiece.cpp",
"externals/icu/source/common/stringtriebuilder.cpp",
"externals/icu/source/common/uarrsort.cpp",
"externals/icu/source/common/ubidi.cpp",
"externals/icu/source/common/ubidi_props.cpp",
"externals/icu/source/common/ubidiln.cpp",
"externals/icu/source/common/ubiditransform.cpp",
"externals/icu/source/common/ubidiwrt.cpp",
"externals/icu/source/common/ubrk.cpp",
"externals/icu/source/common/ucase.cpp",
"externals/icu/source/common/ucasemap.cpp",
"externals/icu/source/common/ucasemap_titlecase_brkiter.cpp",
"externals/icu/source/common/ucat.cpp",
"externals/icu/source/common/uchar.cpp",
"externals/icu/source/common/ucharstrie.cpp",
"externals/icu/source/common/ucharstriebuilder.cpp",
"externals/icu/source/common/ucharstrieiterator.cpp",
"externals/icu/source/common/uchriter.cpp",
"externals/icu/source/common/ucln_cmn.cpp",
"externals/icu/source/common/ucmndata.cpp",
"externals/icu/source/common/ucnv.cpp",
"externals/icu/source/common/ucnv2022.cpp",
"externals/icu/source/common/ucnv_bld.cpp",
"externals/icu/source/common/ucnv_cb.cpp",
"externals/icu/source/common/ucnv_cnv.cpp",
"externals/icu/source/common/ucnv_ct.cpp",
"externals/icu/source/common/ucnv_err.cpp",
"externals/icu/source/common/ucnv_ext.cpp",
"externals/icu/source/common/ucnv_io.cpp",
"externals/icu/source/common/ucnv_lmb.cpp",
"externals/icu/source/common/ucnv_set.cpp",
"externals/icu/source/common/ucnv_u16.cpp",
"externals/icu/source/common/ucnv_u32.cpp",
"externals/icu/source/common/ucnv_u7.cpp",
"externals/icu/source/common/ucnv_u8.cpp",
"externals/icu/source/common/ucnvbocu.cpp",
"externals/icu/source/common/ucnvdisp.cpp",
"externals/icu/source/common/ucnvhz.cpp",
"externals/icu/source/common/ucnvisci.cpp",
"externals/icu/source/common/ucnvlat1.cpp",
"externals/icu/source/common/ucnvmbcs.cpp",
"externals/icu/source/common/ucnvscsu.cpp",
"externals/icu/source/common/ucnvsel.cpp",
"externals/icu/source/common/ucol_swp.cpp",
"externals/icu/source/common/ucptrie.cpp",
"externals/icu/source/common/ucurr.cpp",
"externals/icu/source/common/udata.cpp",
"externals/icu/source/common/udatamem.cpp",
"externals/icu/source/common/udataswp.cpp",
"externals/icu/source/common/uenum.cpp",
"externals/icu/source/common/uhash.cpp",
"externals/icu/source/common/uhash_us.cpp",
"externals/icu/source/common/uidna.cpp",
"externals/icu/source/common/uinit.cpp",
"externals/icu/source/common/uinvchar.cpp",
"externals/icu/source/common/uiter.cpp",
"externals/icu/source/common/ulist.cpp",
"externals/icu/source/common/uloc.cpp",
"externals/icu/source/common/uloc_keytype.cpp",
"externals/icu/source/common/uloc_tag.cpp",
"externals/icu/source/common/umapfile.cpp",
"externals/icu/source/common/umath.cpp",
"externals/icu/source/common/umutablecptrie.cpp",
"externals/icu/source/common/umutex.cpp",
"externals/icu/source/common/unames.cpp",
"externals/icu/source/common/unifiedcache.cpp",
"externals/icu/source/common/unifilt.cpp",
"externals/icu/source/common/unifunct.cpp",
"externals/icu/source/common/uniset.cpp",
"externals/icu/source/common/uniset_closure.cpp",
"externals/icu/source/common/uniset_props.cpp",
"externals/icu/source/common/unisetspan.cpp",
"externals/icu/source/common/unistr.cpp",
"externals/icu/source/common/unistr_case.cpp",
"externals/icu/source/common/unistr_case_locale.cpp",
"externals/icu/source/common/unistr_cnv.cpp",
"externals/icu/source/common/unistr_props.cpp",
"externals/icu/source/common/unistr_titlecase_brkiter.cpp",
"externals/icu/source/common/unorm.cpp",
"externals/icu/source/common/unormcmp.cpp",
"externals/icu/source/common/uobject.cpp",
"externals/icu/source/common/uprops.cpp",
"externals/icu/source/common/ures_cnv.cpp",
"externals/icu/source/common/uresbund.cpp",
"externals/icu/source/common/uresdata.cpp",
"externals/icu/source/common/usc_impl.cpp",
"externals/icu/source/common/uscript.cpp",
"externals/icu/source/common/uscript_props.cpp",
"externals/icu/source/common/uset.cpp",
"externals/icu/source/common/uset_props.cpp",
"externals/icu/source/common/usetiter.cpp",
"externals/icu/source/common/ushape.cpp",
"externals/icu/source/common/usprep.cpp",
"externals/icu/source/common/ustack.cpp",
"externals/icu/source/common/ustr_cnv.cpp",
"externals/icu/source/common/ustr_titlecase_brkiter.cpp",
"externals/icu/source/common/ustr_wcs.cpp",
"externals/icu/source/common/ustrcase.cpp",
"externals/icu/source/common/ustrcase_locale.cpp",
"externals/icu/source/common/ustrenum.cpp",
"externals/icu/source/common/ustrfmt.cpp",
"externals/icu/source/common/ustring.cpp",
"externals/icu/source/common/ustrtrns.cpp",
"externals/icu/source/common/utext.cpp",
"externals/icu/source/common/utf_impl.cpp",
"externals/icu/source/common/util.cpp",
"externals/icu/source/common/util_props.cpp",
"externals/icu/source/common/utrace.cpp",
"externals/icu/source/common/utrie.cpp",
"externals/icu/source/common/utrie2.cpp",
"externals/icu/source/common/utrie2_builder.cpp",
"externals/icu/source/common/utrie_swap.cpp",
"externals/icu/source/common/uts46.cpp",
"externals/icu/source/common/utypes.cpp",
"externals/icu/source/common/uvector.cpp",
"externals/icu/source/common/uvectr32.cpp",
"externals/icu/source/common/uvectr64.cpp",
"externals/icu/source/common/wintz.cpp",
"externals/icu/source/i18n/alphaindex.cpp",
"externals/icu/source/i18n/anytrans.cpp",
"externals/icu/source/i18n/astro.cpp",
"externals/icu/source/i18n/basictz.cpp",
"externals/icu/source/i18n/bocsu.cpp",
"externals/icu/source/i18n/brktrans.cpp",
"externals/icu/source/i18n/buddhcal.cpp",
"externals/icu/source/i18n/calendar.cpp",
"externals/icu/source/i18n/casetrn.cpp",
"externals/icu/source/i18n/cecal.cpp",
"externals/icu/source/i18n/chnsecal.cpp",
"externals/icu/source/i18n/choicfmt.cpp",
"externals/icu/source/i18n/coleitr.cpp",
"externals/icu/source/i18n/coll.cpp",
"externals/icu/source/i18n/collation.cpp",
"externals/icu/source/i18n/collationbuilder.cpp",
"externals/icu/source/i18n/collationcompare.cpp",
"externals/icu/source/i18n/collationdata.cpp",
"externals/icu/source/i18n/collationdatabuilder.cpp",
"externals/icu/source/i18n/collationdatareader.cpp",
"externals/icu/source/i18n/collationdatawriter.cpp",
"externals/icu/source/i18n/collationfastlatin.cpp",
"externals/icu/source/i18n/collationfastlatinbuilder.cpp",
"externals/icu/source/i18n/collationfcd.cpp",
"externals/icu/source/i18n/collationiterator.cpp",
"externals/icu/source/i18n/collationkeys.cpp",
"externals/icu/source/i18n/collationroot.cpp",
"externals/icu/source/i18n/collationrootelements.cpp",
"externals/icu/source/i18n/collationruleparser.cpp",
"externals/icu/source/i18n/collationsets.cpp",
"externals/icu/source/i18n/collationsettings.cpp",
"externals/icu/source/i18n/collationtailoring.cpp",
"externals/icu/source/i18n/collationweights.cpp",
"externals/icu/source/i18n/compactdecimalformat.cpp",
"externals/icu/source/i18n/coptccal.cpp",
"externals/icu/source/i18n/cpdtrans.cpp",
"externals/icu/source/i18n/csdetect.cpp",
"externals/icu/source/i18n/csmatch.cpp",
"externals/icu/source/i18n/csr2022.cpp",
"externals/icu/source/i18n/csrecog.cpp",
"externals/icu/source/i18n/csrmbcs.cpp",
"externals/icu/source/i18n/csrsbcs.cpp",
"externals/icu/source/i18n/csrucode.cpp",
"externals/icu/source/i18n/csrutf8.cpp",
"externals/icu/source/i18n/curramt.cpp",
"externals/icu/source/i18n/currfmt.cpp",
"externals/icu/source/i18n/currpinf.cpp",
"externals/icu/source/i18n/currunit.cpp",
"externals/icu/source/i18n/dangical.cpp",
"externals/icu/source/i18n/datefmt.cpp",
"externals/icu/source/i18n/dayperiodrules.cpp",
"externals/icu/source/i18n/dcfmtsym.cpp",
"externals/icu/source/i18n/decContext.cpp",
"externals/icu/source/i18n/decimfmt.cpp",
"externals/icu/source/i18n/decNumber.cpp",
"externals/icu/source/i18n/double-conversion-bignum-dtoa.cpp",
"externals/icu/source/i18n/double-conversion-bignum.cpp",
"externals/icu/source/i18n/double-conversion-cached-powers.cpp",
"externals/icu/source/i18n/double-conversion-fast-dtoa.cpp",
"externals/icu/source/i18n/double-conversion-strtod.cpp",
"externals/icu/source/i18n/dtfmtsym.cpp",
"externals/icu/source/i18n/dtitvfmt.cpp",
"externals/icu/source/i18n/dtitvinf.cpp",
"externals/icu/source/i18n/dtptngen.cpp",
"externals/icu/source/i18n/dtrule.cpp",
"externals/icu/source/i18n/erarules.cpp",
"externals/icu/source/i18n/esctrn.cpp",
"externals/icu/source/i18n/ethpccal.cpp",
"externals/icu/source/i18n/fmtable.cpp",
"externals/icu/source/i18n/fmtable_cnv.cpp",
"externals/icu/source/i18n/format.cpp",
"externals/icu/source/i18n/fphdlimp.cpp",
"externals/icu/source/i18n/fpositer.cpp",
"externals/icu/source/i18n/funcrepl.cpp",
"externals/icu/source/i18n/gender.cpp",
"externals/icu/source/i18n/gregocal.cpp",
"externals/icu/source/i18n/gregoimp.cpp",
"externals/icu/source/i18n/hebrwcal.cpp",
"externals/icu/source/i18n/indiancal.cpp",
"externals/icu/source/i18n/inputext.cpp",
"externals/icu/source/i18n/islamcal.cpp",
"externals/icu/source/i18n/japancal.cpp",
"externals/icu/source/i18n/listformatter.cpp",
"externals/icu/source/i18n/measfmt.cpp",
"externals/icu/source/i18n/measunit.cpp",
"externals/icu/source/i18n/measure.cpp",
"externals/icu/source/i18n/msgfmt.cpp",
"externals/icu/source/i18n/name2uni.cpp",
"externals/icu/source/i18n/nfrs.cpp",
"externals/icu/source/i18n/nfrule.cpp",
"externals/icu/source/i18n/nfsubs.cpp",
"externals/icu/source/i18n/nortrans.cpp",
"externals/icu/source/i18n/nultrans.cpp",
"externals/icu/source/i18n/number_affixutils.cpp",
"externals/icu/source/i18n/number_asformat.cpp",
"externals/icu/source/i18n/number_capi.cpp",
"externals/icu/source/i18n/number_compact.cpp",
"externals/icu/source/i18n/number_currencysymbols.cpp",
"externals/icu/source/i18n/number_decimalquantity.cpp",
"externals/icu/source/i18n/number_decimfmtprops.cpp",
"externals/icu/source/i18n/number_fluent.cpp",
"externals/icu/source/i18n/number_formatimpl.cpp",
"externals/icu/source/i18n/number_grouping.cpp",
"externals/icu/source/i18n/number_integerwidth.cpp",
"externals/icu/source/i18n/number_longnames.cpp",
"externals/icu/source/i18n/number_mapper.cpp",
"externals/icu/source/i18n/number_modifiers.cpp",
"externals/icu/source/i18n/number_multiplier.cpp",
"externals/icu/source/i18n/number_notation.cpp",
"externals/icu/source/i18n/number_padding.cpp",
"externals/icu/source/i18n/number_patternmodifier.cpp",
"externals/icu/source/i18n/number_patternstring.cpp",
"externals/icu/source/i18n/number_rounding.cpp",
"externals/icu/source/i18n/number_scientific.cpp",
"externals/icu/source/i18n/number_skeletons.cpp",
"externals/icu/source/i18n/number_utils.cpp",
"externals/icu/source/i18n/numfmt.cpp",
"externals/icu/source/i18n/numparse_affixes.cpp",
"externals/icu/source/i18n/numparse_compositions.cpp",
"externals/icu/source/i18n/numparse_currency.cpp",
"externals/icu/source/i18n/numparse_decimal.cpp",
"externals/icu/source/i18n/numparse_impl.cpp",
"externals/icu/source/i18n/numparse_parsednumber.cpp",
"externals/icu/source/i18n/numparse_scientific.cpp",
"externals/icu/source/i18n/numparse_symbols.cpp",
"externals/icu/source/i18n/numparse_validators.cpp",
"externals/icu/source/i18n/numrange_fluent.cpp",
"externals/icu/source/i18n/numrange_impl.cpp",
"externals/icu/source/i18n/numsys.cpp",
"externals/icu/source/i18n/olsontz.cpp",
"externals/icu/source/i18n/persncal.cpp",
"externals/icu/source/i18n/plurfmt.cpp",
"externals/icu/source/i18n/plurrule.cpp",
"externals/icu/source/i18n/quant.cpp",
"externals/icu/source/i18n/quantityformatter.cpp",
"externals/icu/source/i18n/rbnf.cpp",
"externals/icu/source/i18n/rbt.cpp",
"externals/icu/source/i18n/rbt_data.cpp",
"externals/icu/source/i18n/rbt_pars.cpp",
"externals/icu/source/i18n/rbt_rule.cpp",
"externals/icu/source/i18n/rbt_set.cpp",
"externals/icu/source/i18n/rbtz.cpp",
"externals/icu/source/i18n/regexcmp.cpp",
"externals/icu/source/i18n/regeximp.cpp",
"externals/icu/source/i18n/regexst.cpp",
"externals/icu/source/i18n/regextxt.cpp",
"externals/icu/source/i18n/region.cpp",
"externals/icu/source/i18n/reldatefmt.cpp",
"externals/icu/source/i18n/reldtfmt.cpp",
"externals/icu/source/i18n/rematch.cpp",
"externals/icu/source/i18n/remtrans.cpp",
"externals/icu/source/i18n/repattrn.cpp",
"externals/icu/source/i18n/rulebasedcollator.cpp",
"externals/icu/source/i18n/scientificnumberformatter.cpp",
"externals/icu/source/i18n/scriptset.cpp",
"externals/icu/source/i18n/search.cpp",
"externals/icu/source/i18n/selfmt.cpp",
"externals/icu/source/i18n/sharedbreakiterator.cpp",
"externals/icu/source/i18n/simpletz.cpp",
"externals/icu/source/i18n/smpdtfmt.cpp",
"externals/icu/source/i18n/smpdtfst.cpp",
"externals/icu/source/i18n/sortkey.cpp",
"externals/icu/source/i18n/standardplural.cpp",
"externals/icu/source/i18n/strmatch.cpp",
"externals/icu/source/i18n/strrepl.cpp",
"externals/icu/source/i18n/stsearch.cpp",
"externals/icu/source/i18n/taiwncal.cpp",
"externals/icu/source/i18n/timezone.cpp",
"externals/icu/source/i18n/titletrn.cpp",
"externals/icu/source/i18n/tmunit.cpp",
"externals/icu/source/i18n/tmutamt.cpp",
"externals/icu/source/i18n/tmutfmt.cpp",
"externals/icu/source/i18n/tolowtrn.cpp",
"externals/icu/source/i18n/toupptrn.cpp",
"externals/icu/source/i18n/translit.cpp",
"externals/icu/source/i18n/transreg.cpp",
"externals/icu/source/i18n/tridpars.cpp",
"externals/icu/source/i18n/tzfmt.cpp",
"externals/icu/source/i18n/tzgnames.cpp",
"externals/icu/source/i18n/tznames.cpp",
"externals/icu/source/i18n/tznames_impl.cpp",
"externals/icu/source/i18n/tzrule.cpp",
"externals/icu/source/i18n/tztrans.cpp",
"externals/icu/source/i18n/ucal.cpp",
"externals/icu/source/i18n/ucln_in.cpp",
"externals/icu/source/i18n/ucol.cpp",
"externals/icu/source/i18n/ucol_res.cpp",
"externals/icu/source/i18n/ucol_sit.cpp",
"externals/icu/source/i18n/ucoleitr.cpp",
"externals/icu/source/i18n/ucsdet.cpp",
"externals/icu/source/i18n/udat.cpp",
"externals/icu/source/i18n/udateintervalformat.cpp",
"externals/icu/source/i18n/udatpg.cpp",
"externals/icu/source/i18n/ufieldpositer.cpp",
"externals/icu/source/i18n/uitercollationiterator.cpp",
"externals/icu/source/i18n/ulistformatter.cpp",
"externals/icu/source/i18n/ulocdata.cpp",
"externals/icu/source/i18n/umsg.cpp",
"externals/icu/source/i18n/unesctrn.cpp",
"externals/icu/source/i18n/uni2name.cpp",
"externals/icu/source/i18n/unum.cpp",
"externals/icu/source/i18n/unumsys.cpp",
"externals/icu/source/i18n/upluralrules.cpp",
"externals/icu/source/i18n/uregex.cpp",
"externals/icu/source/i18n/uregexc.cpp",
"externals/icu/source/i18n/uregion.cpp",
"externals/icu/source/i18n/usearch.cpp",
"externals/icu/source/i18n/uspoof.cpp",
"externals/icu/source/i18n/uspoof_build.cpp",
"externals/icu/source/i18n/uspoof_conf.cpp",
"externals/icu/source/i18n/uspoof_impl.cpp",
"externals/icu/source/i18n/utf16collationiterator.cpp",
"externals/icu/source/i18n/utf8collationiterator.cpp",
"externals/icu/source/i18n/utmscale.cpp",
"externals/icu/source/i18n/utrans.cpp",
"externals/icu/source/i18n/vtzone.cpp",
"externals/icu/source/i18n/vzone.cpp",
"externals/icu/source/i18n/windtfmt.cpp",
"externals/icu/source/i18n/winnmfmt.cpp",
"externals/icu/source/i18n/wintzimpl.cpp",
"externals/icu/source/i18n/zonemeta.cpp",
"externals/icu/source/i18n/zrule.cpp",
"externals/icu/source/i18n/ztrans.cpp",
"externals/icu/source/common/appendable.cpp",
] + select({
"@platforms//os:windows": [
"externals/icu/source/stubdata/stubdata.cpp",
"icu/SkLoadICU.cpp",
],
"//bazel/common_config_settings:cpu_wasm": ["generated_icu_wasm_dat.cpp"],
"@platforms//os:android": ["generated_icu_android_dat.S"],
"@platforms//os:ios": ["generated_icu_ios_dat.S"],
"//conditions:default": ["generated_icu_common_dat.S"],
})
cc_library(
name = "icu",
srcs = ICU_SRCS,
hdrs = ICU_HDRS,
copts = [
"-Wno-deprecated-declarations",
"-Wno-unused-but-set-variable",
"-Wno-unused-function",
],
defines = [
"U_USING_ICU_NAMESPACE=0",
"U_DISABLE_RENAMING",
"SK_USING_THIRD_PARTY_ICU",
],
includes = [
"externals/icu/source/common",
"externals/icu/source/i18n",
"icu",
],
local_defines = [
# http://userguide.icu-project.org/howtouseicu
"U_COMMON_IMPLEMENTATION",
"U_STATIC_IMPLEMENTATION",
"U_ENABLE_DYLOAD=0",
"U_I18N_IMPLEMENTATION",
# If we don't set this to zero, ICU will set it to 600,
# which makes Macs set _POSIX_C_SOURCE=200112L,
# which makes Macs set __DARWIN_C_LEVEL=_POSIX_C_SOURCE instead of =__DARWIN_C_FULL,
# which makes <time.h> not expose timespec_get,
# which makes recent libc++ <ctime> not #include-able with -std=c++17.
"_XOPEN_SOURCE=0",
] + select({
# Tell ICU that we are a 32 bit platform, otherwise,
# double-conversion-utils.h doesn't know how to operate.
"//bazel/common_config_settings:cpu_wasm": ["__i386__"],
"//conditions:default": [],
}),
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
)
_icu_version_major_num = "69" # defined in source/common/unicode/uvernum.h
genrule(
name = "create_icu_wasm_data_cpp",
# For WASM, we use a super stripped down version, the same as what flutter uses.
srcs = ["externals/icu/flutter/icudtl.dat"],
outs = ["generated_icu_wasm_dat.cpp"],
cmd = "$(location :make_data_cpp) " +
"icudt" + _icu_version_major_num + "_dat " +
# We need to specify the absolute path from the root
"third_party/externals/icu/flutter/icudtl.dat " +
# The $@ means substitute in the one and only output location, which will be located
# in //bazel-out.
"$@",
tools = [":make_data_cpp"],
)
# We need to make a separate genrule per input because cmd cannot be based on a select()
genrule(
name = "create_icu_common_data_asm",
srcs = ["externals/icu/common/icudtl.dat"],
outs = ["generated_icu_common_dat.S"],
cmd = "$(location :make_data_assembly) " +
# We need to specify the absolute path from the root
"third_party/externals/icu/common/icudtl.dat " +
# The $@ means substitute in the one and only output location, which will be located
# in //bazel-out.
"$@",
tools = [":make_data_assembly"],
)
genrule(
name = "create_icu_android_data_asm",
srcs = ["externals/icu/android/icudtl.dat"],
outs = ["generated_icu_android_dat.S"],
cmd = "$(location :make_data_assembly) " +
# We need to specify the absolute path from the root
"third_party/externals/icu/common/icudtl.dat " +
# The $@ means substitute in the one and only output location, which will be located
# in //bazel-out.
"$@",
tools = [":make_data_assembly"],
)
genrule(
name = "create_icu_ios_data_asm",
srcs = ["externals/icu/ios/icudtl.dat"],
outs = ["generated_icu_ios_dat.S"],
cmd = "$(location :make_data_assembly) " +
# We need to specify the absolute path from the root
"third_party/externals/icu/common/icudtl.dat " +
# The $@ means substitute in the one and only output location, which will be located
# in //bazel-out.
"$@",
tools = [":make_data_assembly"],
)
py_binary(
name = "make_data_assembly",
srcs = ["externals/icu/scripts/make_data_assembly.py"],
)
py_binary(
name = "make_data_cpp",
srcs = ["icu/make_data_cpp.py"],
)
HARFBUZZ_HDRS = [
"externals/harfbuzz/src/hb-aat-layout.h",
"externals/harfbuzz/src/hb-blob.h",
"externals/harfbuzz/src/hb-buffer.h",
"externals/harfbuzz/src/hb-common.h",
"externals/harfbuzz/src/hb-deprecated.h",
"externals/harfbuzz/src/hb-face.h",
"externals/harfbuzz/src/hb-font.h",
"externals/harfbuzz/src/hb-map.h",
"externals/harfbuzz/src/hb-ot-font.h",
"externals/harfbuzz/src/hb-ot-layout.h",
"externals/harfbuzz/src/hb-ot-math.h",
"externals/harfbuzz/src/hb-ot-metrics.h",
"externals/harfbuzz/src/hb-ot-shape.h",
"externals/harfbuzz/src/hb-ot-var.h",
"externals/harfbuzz/src/hb-ot.h",
"externals/harfbuzz/src/hb-set.h",
"externals/harfbuzz/src/hb-shape-plan.h",
"externals/harfbuzz/src/hb-shape.h",
"externals/harfbuzz/src/hb-style.h",
"externals/harfbuzz/src/hb-subset.h",
"externals/harfbuzz/src/hb-unicode.h",
"externals/harfbuzz/src/hb-version.h",
"externals/harfbuzz/src/hb.h",
]
HARFBUZZ_SRCS = [
"externals/harfbuzz/src/hb-aat-layout-ankr-table.hh",
"externals/harfbuzz/src/hb-aat-layout-bsln-table.hh",
"externals/harfbuzz/src/hb-aat-layout-common.hh",
"externals/harfbuzz/src/hb-aat-layout-feat-table.hh",
"externals/harfbuzz/src/hb-aat-layout-just-table.hh",
"externals/harfbuzz/src/hb-aat-layout-kerx-table.hh",
"externals/harfbuzz/src/hb-aat-layout-morx-table.hh",
"externals/harfbuzz/src/hb-aat-layout-opbd-table.hh",
"externals/harfbuzz/src/hb-aat-layout-trak-table.hh",
"externals/harfbuzz/src/hb-aat-layout.cc",
"externals/harfbuzz/src/hb-aat-layout.hh",
"externals/harfbuzz/src/hb-aat-ltag-table.hh",
"externals/harfbuzz/src/hb-aat-map.cc",
"externals/harfbuzz/src/hb-aat-map.hh",
"externals/harfbuzz/src/hb-aat.h",
"externals/harfbuzz/src/hb-algs.hh",
"externals/harfbuzz/src/hb-array.hh",
"externals/harfbuzz/src/hb-atomic.hh",
"externals/harfbuzz/src/hb-bimap.hh",
"externals/harfbuzz/src/hb-bit-page.hh",
"externals/harfbuzz/src/hb-bit-set-invertible.hh",
"externals/harfbuzz/src/hb-bit-set.hh",
"externals/harfbuzz/src/hb-blob.cc",
"externals/harfbuzz/src/hb-blob.hh",
"externals/harfbuzz/src/hb-buffer-deserialize-json.hh",
"externals/harfbuzz/src/hb-buffer-deserialize-text.hh",
"externals/harfbuzz/src/hb-buffer-serialize.cc",
"externals/harfbuzz/src/hb-buffer-verify.cc",
"externals/harfbuzz/src/hb-buffer.cc",
"externals/harfbuzz/src/hb-buffer.hh",
"externals/harfbuzz/src/hb-cache.hh",
"externals/harfbuzz/src/hb-cff-interp-common.hh",
"externals/harfbuzz/src/hb-cff-interp-cs-common.hh",
"externals/harfbuzz/src/hb-cff-interp-dict-common.hh",
"externals/harfbuzz/src/hb-cff1-interp-cs.hh",
"externals/harfbuzz/src/hb-cff2-interp-cs.hh",
"externals/harfbuzz/src/hb-common.cc",
"externals/harfbuzz/src/hb-config.hh",
"externals/harfbuzz/src/hb-debug.hh",
"externals/harfbuzz/src/hb-dispatch.hh",
"externals/harfbuzz/src/hb-draw.cc",
"externals/harfbuzz/src/hb-draw.h",
"externals/harfbuzz/src/hb-draw.hh",
"externals/harfbuzz/src/hb-face.cc",
"externals/harfbuzz/src/hb-face.hh",
"externals/harfbuzz/src/hb-font.cc",
"externals/harfbuzz/src/hb-font.hh",
"externals/harfbuzz/src/hb-iter.hh",
"externals/harfbuzz/src/hb-kern.hh",
"externals/harfbuzz/src/hb-machinery.hh",
"externals/harfbuzz/src/hb-map.cc",
"externals/harfbuzz/src/hb-map.hh",
"externals/harfbuzz/src/hb-meta.hh",
"externals/harfbuzz/src/hb-ms-feature-ranges.hh",
"externals/harfbuzz/src/hb-mutex.hh",
"externals/harfbuzz/src/hb-null.hh",
"externals/harfbuzz/src/hb-number-parser.hh",
"externals/harfbuzz/src/hb-number.cc",
"externals/harfbuzz/src/hb-number.hh",
"externals/harfbuzz/src/hb-object.hh",
"externals/harfbuzz/src/hb-open-file.hh",
"externals/harfbuzz/src/hb-open-type.hh",
"externals/harfbuzz/src/hb-ot-cff-common.hh",
"externals/harfbuzz/src/hb-ot-cff1-std-str.hh",
"externals/harfbuzz/src/hb-ot-cff1-table.cc",
"externals/harfbuzz/src/hb-ot-cff1-table.hh",
"externals/harfbuzz/src/hb-ot-cff2-table.cc",
"externals/harfbuzz/src/hb-ot-cff2-table.hh",
"externals/harfbuzz/src/hb-ot-cmap-table.hh",
"externals/harfbuzz/src/hb-ot-color-cbdt-table.hh",
"externals/harfbuzz/src/hb-ot-color-colr-table.hh",
"externals/harfbuzz/src/hb-ot-color-colrv1-closure.hh",
"externals/harfbuzz/src/hb-ot-color-cpal-table.hh",
"externals/harfbuzz/src/hb-ot-color-sbix-table.hh",
"externals/harfbuzz/src/hb-ot-color-svg-table.hh",
"externals/harfbuzz/src/hb-ot-color.cc",
"externals/harfbuzz/src/hb-ot-color.h",
"externals/harfbuzz/src/hb-ot-deprecated.h",
"externals/harfbuzz/src/hb-ot-face-table-list.hh",
"externals/harfbuzz/src/hb-ot-face.cc",
"externals/harfbuzz/src/hb-ot-face.hh",
"externals/harfbuzz/src/hb-ot-font.cc",
"externals/harfbuzz/src/hb-ot-gasp-table.hh",
"externals/harfbuzz/src/hb-ot-glyf-table.hh",
"externals/harfbuzz/src/hb-ot-hdmx-table.hh",
"externals/harfbuzz/src/hb-ot-head-table.hh",
"externals/harfbuzz/src/hb-ot-hhea-table.hh",
"externals/harfbuzz/src/hb-ot-hmtx-table.hh",
"externals/harfbuzz/src/hb-ot-kern-table.hh",
"externals/harfbuzz/src/hb-ot-layout-base-table.hh",
"externals/harfbuzz/src/hb-ot-layout-common.hh",
"externals/harfbuzz/src/hb-ot-layout-gdef-table.hh",
"externals/harfbuzz/src/hb-ot-layout-gpos-table.hh",
"externals/harfbuzz/src/hb-ot-layout-gsub-table.hh",
"externals/harfbuzz/src/hb-ot-layout-gsubgpos.hh",
"externals/harfbuzz/src/hb-ot-layout-jstf-table.hh",
"externals/harfbuzz/src/hb-ot-layout.cc",
"externals/harfbuzz/src/hb-ot-layout.hh",
"externals/harfbuzz/src/hb-ot-map.cc",
"externals/harfbuzz/src/hb-ot-map.hh",
"externals/harfbuzz/src/hb-ot-math-table.hh",
"externals/harfbuzz/src/hb-ot-math.cc",
"externals/harfbuzz/src/hb-ot-maxp-table.hh",
"externals/harfbuzz/src/hb-ot-meta-table.hh",
"externals/harfbuzz/src/hb-ot-meta.cc",
"externals/harfbuzz/src/hb-ot-meta.h",
"externals/harfbuzz/src/hb-ot-metrics.cc",
"externals/harfbuzz/src/hb-ot-metrics.hh",
"externals/harfbuzz/src/hb-ot-name-language-static.hh",
"externals/harfbuzz/src/hb-ot-name-language.hh",
"externals/harfbuzz/src/hb-ot-name-table.hh",
"externals/harfbuzz/src/hb-ot-name.cc",
"externals/harfbuzz/src/hb-ot-name.h",
"externals/harfbuzz/src/hb-ot-os2-table.hh",
"externals/harfbuzz/src/hb-ot-os2-unicode-ranges.hh",
"externals/harfbuzz/src/hb-ot-post-macroman.hh",
"externals/harfbuzz/src/hb-ot-post-table-v2subset.hh",
"externals/harfbuzz/src/hb-ot-post-table.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-arabic-fallback.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-arabic-joining-list.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-arabic-table.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-arabic.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-arabic.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-default.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-hangul.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-hebrew.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-indic-machine.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-indic-table.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-indic.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-indic.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-khmer-machine.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-khmer.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-khmer.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-myanmar.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-myanmar.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-syllabic.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-syllabic.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-thai.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-use-machine.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-use-table.hh",
"externals/harfbuzz/src/hb-ot-shape-complex-use.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc",
"externals/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.hh",
"externals/harfbuzz/src/hb-ot-shape-complex.hh",
"externals/harfbuzz/src/hb-ot-shape-fallback.cc",
"externals/harfbuzz/src/hb-ot-shape-fallback.hh",
"externals/harfbuzz/src/hb-ot-shape-normalize.cc",
"externals/harfbuzz/src/hb-ot-shape-normalize.hh",
"externals/harfbuzz/src/hb-ot-shape.cc",
"externals/harfbuzz/src/hb-ot-shape.hh",
"externals/harfbuzz/src/hb-ot-stat-table.hh",
"externals/harfbuzz/src/hb-ot-tag-table.hh",
"externals/harfbuzz/src/hb-ot-tag.cc",
"externals/harfbuzz/src/hb-ot-var-avar-table.hh",
"externals/harfbuzz/src/hb-ot-var-common.hh",
"externals/harfbuzz/src/hb-ot-var-fvar-table.hh",
"externals/harfbuzz/src/hb-ot-var-gvar-table.hh",
"externals/harfbuzz/src/hb-ot-var-hvar-table.hh",
"externals/harfbuzz/src/hb-ot-var-mvar-table.hh",
"externals/harfbuzz/src/hb-ot-var.cc",
"externals/harfbuzz/src/hb-ot-vorg-table.hh",
"externals/harfbuzz/src/hb-pool.hh",
"externals/harfbuzz/src/hb-priority-queue.hh",
"externals/harfbuzz/src/hb-repacker.hh",
"externals/harfbuzz/src/hb-sanitize.hh",
"externals/harfbuzz/src/hb-serialize.hh",
"externals/harfbuzz/src/hb-set-digest.hh",
"externals/harfbuzz/src/hb-set.cc",
"externals/harfbuzz/src/hb-set.hh",
"externals/harfbuzz/src/hb-shape-plan.cc",
"externals/harfbuzz/src/hb-shape-plan.hh",
"externals/harfbuzz/src/hb-shape.cc",
"externals/harfbuzz/src/hb-shaper-impl.hh",
"externals/harfbuzz/src/hb-shaper-list.hh",
"externals/harfbuzz/src/hb-shaper.cc",
"externals/harfbuzz/src/hb-shaper.hh",
"externals/harfbuzz/src/hb-static.cc",
"externals/harfbuzz/src/hb-string-array.hh",
"externals/harfbuzz/src/hb-subset-cff-common.cc",
"externals/harfbuzz/src/hb-subset-cff-common.hh",
"externals/harfbuzz/src/hb-subset-cff1.cc",
"externals/harfbuzz/src/hb-subset-cff1.hh",
"externals/harfbuzz/src/hb-subset-cff2.cc",
"externals/harfbuzz/src/hb-subset-cff2.hh",
"externals/harfbuzz/src/hb-subset-input.cc",
"externals/harfbuzz/src/hb-subset-input.hh",
"externals/harfbuzz/src/hb-subset-plan.cc",
"externals/harfbuzz/src/hb-subset-plan.hh",
"externals/harfbuzz/src/hb-subset.cc",
"externals/harfbuzz/src/hb-subset.hh",
"externals/harfbuzz/src/hb-ucd-table.hh",
"externals/harfbuzz/src/hb-ucd.cc",
"externals/harfbuzz/src/hb-unicode-emoji-table.hh",
"externals/harfbuzz/src/hb-unicode.cc",
"externals/harfbuzz/src/hb-unicode.hh",
"externals/harfbuzz/src/hb-utf.hh",
"externals/harfbuzz/src/hb-vector.hh",
"externals/harfbuzz/src/hb.hh",
"harfbuzz/config-override.h",
]
cc_library(
name = "harfbuzz",
srcs = HARFBUZZ_SRCS,
hdrs = HARFBUZZ_HDRS,
includes = [
"externals/harfbuzz/src",
"harfbuzz",
],
local_defines = [
"HAVE_OT",
"HAVE_CONFIG_OVERRIDE_H",
"HB_NO_FALLBACK_SHAPE",
"HB_NO_WIN1256",
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
)
[bazel] Compile gms for wasm and WebGL PS 1 is re-generating existing BUILD.bazel files PS 2 is generating BUILD.bazel files for tests/gms PS 3+ makes modifications to build all of the gms and tests. It is recommended to view this CL with just a diff between PS 2 and the end, due to the large amount of generated changes in PS 1 and 2. We make a filegroup for the gms and tests because they need to be compiled as one large blob in order for the registries to work. Maybe in the future we will break these up, but at least for WASM/JS, the overhead of starting a browser for each new test would likely grind things to a halt, so we just group them all together for now. It's also the most similar to what we currently do. In gm/BUILD.bazel and tests/BUILD.bazel, we add a cc_library that encapsulates all of the deps of the tests, so we can easily include that the build. These were discovered via trial and error, not anything automatic or systematic. The is_skia_dev_build config_setting is very similar to the GN equivalent from which it was based. The list of gms and tests to skip (e.g. which are incompatible with WASM) was determined by building the wasm bundle: modules/canvaskit$ make bazel_gms_release tools/run-wasm-gm-tests$ make run_local_debug # Don't forget to click the button on the screen after the # browser loads This way of invoking the tests will be replace soon with `bazel test <something>`. As such, I didn't bother fully documenting the current way. Suggested review order: - modules/canvaskit/BUILD.bazel taking note that we always use profiling-funcs to make the stacktraces human readable. - gm/BUILD.bazel and tests/BUILD.bazel to see the lists of gms/tests. Notice the tests are roughly partitioned because we don't support things like vulkan/PDF in the wasm build and we will want a way to not build certain tests for certain configurations - tools/* noting some of the cc_libraries added to make dependencies easier to add when needed. - All other files. Change-Id: I43059cd93c28af1c4c12b93d6ebd9c46a12d381f Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506256 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-09 18:14:25 +00:00
cc_library(
name = "etc1",
srcs = [
"etc1/etc1.cpp",
],
hdrs = [
"etc1/etc1.h",
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
)
cc_library(
name = "vulkanmemoryallocator",
srcs = [
"vulkanmemoryallocator/GrVulkanMemoryAllocator.cpp",
"vulkanmemoryallocator/include/vk_mem_alloc.h",
],
hdrs = [
"vulkanmemoryallocator/GrVulkanMemoryAllocator.h",
],
includes = [
"vulkanmemoryallocator",
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
visibility = ["//:__subpackages__"],
deps = [
"//include/third_party:skias_vulkan_headers",
],
)
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
py_binary(
name = "dawn_json_generator",
[bazel] Add RBE support using hermetic Linux Clang toolchain A new RBE worker-pool called gce_linux was created in conjunction with this CL. See https://docs.google.com/document/d/14xMZCKews69SSTfULhE8HDUzT5XvPwZ4CvRufEvcZ74/edit# for some details on that. Note: everything under bazel/rbe/gce_linux was autogenerated and can be ignored from manual review. It basically specifies what files are on the RBE image that are necessary for running Bazel. Testing it out can be done by authenticating for RBE gcloud auth application-default login --no-browser Then, run make -C bazel rbe_known_good_builds to test it out. On my 4 core laptop with an empty local cache, but a warm remote cache, the build took <2 min instead of the 10+ minutes it would have [1]. The folder structure in //bazel/rbe is meant to let us have multiple remote configurations there, e.g. //bazel/rbe/gce_windows. Suggested Review Order: - bazel/rbe/README.md - bazel/rbe/gce_linux_container/Dockerfile to see the bare-bones RBE image. - bazel/rbe/BUILD.bazel to see a custom platform defined. It is nearly identical to the autogenerated one in bazel/rbe/gce_linux/config/BUILD, with one extra field to force the gce_linux pool to be used. - .bazelrc to see the settings needed to make --config=linux-rbe work. The naming convention was inspired by SkCMS's setup [2], and allows us to have some common RBE settings (i.e. config:remote) and some specialized ones for the given host machine (e.g. config:linux-rbe) A very important, but subtle configuration, is on line 86 of .bazelrc where we say to use our hermetic toolchain and not whatever C++ compiler and headers are on the host machine (aka the RBE container). - toolchain/build_toolchain.bzl to see some additional dependencies needed in the toolchain (to run IWYU) which I had installed locally but didn't realize were important. - third_party/BUILD.bazel to see an example of how failing to specify all files can result in something that works locally, but fails remotely. --execution_log_json_file=/tmp/execlog.json helped debug these issues. - All other files. [1] http://go/scrcast/NjM1ODE4MDI0NzM3MTc3Nnw3ODViZmFkMi1iOA [2] https://skia.googlesource.com/skcms/+/30c8e303800c256febb03a09fdcda7f75d119b1b/.bazelrc#20 Change-Id: Ia0a9e6a06c1a13071949ab402dc5d897df6b12e1 Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524359 Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-03-25 18:59:33 +00:00
srcs = [
"externals/dawn/generator/dawn_json_generator.py",
"externals/dawn/generator/generator_lib.py",
],
[bazel] Use hermetic Python with jinja2+MarkupSafe The file generation logic that dawn [1] uses to make some source files requires jinja2, which also requires MarkupSafe. The GN build handles this by specifying those repos in DEPS, checking them out at a certain git hash, and then providing them via a command line arg [2]. We do not have to do it this way in Bazel to have reproducible builds. This CL specifies an exact version (verified by sha256) of those two deps and then uses a hermetic version of Python 3.9 to run all py_binary commands. Previously, we would rely on the system Python (and installed libraries). That happened to work on my machine, but not on other machines without jinja2 and MarkupSafe installed. After this CL, it should work on machines that do not have python even installed. I chose the same jinja2 version used by Dawn [3], which was 2.11.3. Then I chose the newest version of MarkupSafe that was compatible with jinja2 (2.0.1). If we have other python scripts that need external deps, we should be able to specify them in the py_binary that needs them and in requirements.txt. Then, the pip_install() step in WORKSPACE.bazel will download them and make them available. [1] https://dawn.googlesource.com/dawn.git/+/refs/heads/main/docs/dawn/overview.md [2] https://dawn.googlesource.com/dawn.git/+/e45ff6a4b3c2f06dade68ec0f01ddc3bfd70c282/generator/generator_lib.gni#77 [3] https://chromium.googlesource.com/chromium/src/third_party/jinja2/+/ee69aa00ee8536f61db6a451f3858745cf587de6 Change-Id: I3d0074f3003de179400e239e00107c34f35f4901 Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524217 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-03-25 16:36:17 +00:00
deps = [
requirement("jinja2"),
# jinja2 has a dep on MarkupSafe. Declaring MarkupSafe here is not necessary, but it makes
# the link easier to find than searching the Bazel cache for generated deps.
requirement("MarkupSafe"),
],
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
)
genrule(
name = "generate_webgpu_cpp",
srcs = [
"externals/dawn/generator/templates/api_cpp.h",
"externals/dawn/generator/templates/api_cpp_print.h",
"externals/dawn/generator/templates/BSD_LICENSE",
"externals/dawn/dawn.json",
"externals/dawn/dawn_wire.json",
],
outs = [
"externals/dawn/include/dawn/webgpu_cpp.h",
"externals/dawn/include/dawn/webgpu_cpp_print.h",
],
cmd = "$(location :dawn_json_generator) " +
"--dawn-json $(location externals/dawn/dawn.json) " +
"--wire-json $(location externals/dawn/dawn_wire.json) " +
"--template-dir $$(dirname $(location externals/dawn/generator/templates/api_cpp.h)) " +
"--targets cpp_headers " +
"--output-dir $(RULEDIR)/externals/dawn",
tools = [":dawn_json_generator"],
)
genrule(
name = "generate_webgpu",
srcs = [
"externals/dawn/generator/templates/api.h",
"externals/dawn/generator/templates/dawn_proc_table.h",
"externals/dawn/generator/templates/BSD_LICENSE",
"externals/dawn/dawn.json",
"externals/dawn/dawn_wire.json",
],
outs = [
"externals/dawn/include/dawn/webgpu.h",
"externals/dawn/include/dawn/dawn_proc_table.h",
],
cmd = "$(location :dawn_json_generator) " +
"--dawn-json $(location externals/dawn/dawn.json) " +
"--wire-json $(location externals/dawn/dawn_wire.json) " +
"--template-dir $$(dirname $(location externals/dawn/generator/templates/api.h)) " +
"--targets headers " +
"--output-dir $(RULEDIR)/externals/dawn",
tools = [":dawn_json_generator"],
)
genrule(
name = "generate_proc",
srcs = [
"externals/dawn/dawn.json",
"externals/dawn/dawn_wire.json",
"externals/dawn/generator/templates/BSD_LICENSE",
"externals/dawn/generator/templates/dawn_proc.c",
"externals/dawn/generator/templates/dawn_thread_dispatch_proc.cpp",
],
outs = [
"externals/dawn/src/dawn/dawn_proc.c",
"externals/dawn/src/dawn/dawn_thread_dispatch_proc.cpp",
],
cmd = "$(location :dawn_json_generator) " +
"--dawn-json $(location externals/dawn/dawn.json) " +
"--wire-json $(location externals/dawn/dawn_wire.json) " +
"--template-dir $$(dirname $(location externals/dawn/generator/templates/BSD_LICENSE)) " +
"--targets proc " +
"--output-dir $(RULEDIR)/externals/dawn",
tools = [":dawn_json_generator"],
)
genrule(
name = "generate_dawn_cpp",
srcs = [
"externals/dawn/dawn.json",
"externals/dawn/dawn_wire.json",
"externals/dawn/generator/templates/BSD_LICENSE",
"externals/dawn/generator/templates/api_cpp.cpp",
],
outs = [
"externals/dawn/src/dawn/webgpu_cpp.cpp",
],
cmd = "$(location :dawn_json_generator) " +
"--dawn-json $(location externals/dawn/dawn.json) " +
"--wire-json $(location externals/dawn/dawn_wire.json) " +
"--template-dir $$(dirname $(location externals/dawn/generator/templates/BSD_LICENSE)) " +
"--targets cpp " +
"--output-dir $(RULEDIR)/externals/dawn",
tools = [":dawn_json_generator"],
)
genrule(
name = "generate_utils",
srcs = [
"externals/dawn/dawn.json",
"externals/dawn/dawn_wire.json",
"externals/dawn/generator/templates/BSD_LICENSE",
"externals/dawn/generator/templates/dawn/native/ChainUtils.cpp",
"externals/dawn/generator/templates/dawn/native/ChainUtils.h",
"externals/dawn/generator/templates/dawn/native/ObjectType.cpp",
"externals/dawn/generator/templates/dawn/native/ObjectType.h",
"externals/dawn/generator/templates/dawn/native/ProcTable.cpp",
"externals/dawn/generator/templates/dawn/native/ValidationUtils.cpp",
"externals/dawn/generator/templates/dawn/native/ValidationUtils.h",
"externals/dawn/generator/templates/dawn/native/api_absl_format.cpp",
"externals/dawn/generator/templates/dawn/native/api_absl_format.h",
"externals/dawn/generator/templates/dawn/native/api_structs.cpp",
"externals/dawn/generator/templates/dawn/native/api_structs.h",
"externals/dawn/generator/templates/dawn/native/dawn_platform.h",
],
outs = [
"externals/dawn/src/dawn/native/ChainUtils_autogen.cpp",
"externals/dawn/src/dawn/native/ChainUtils_autogen.h",
"externals/dawn/src/dawn/native/ObjectType_autogen.cpp",
"externals/dawn/src/dawn/native/ObjectType_autogen.h",
"externals/dawn/src/dawn/native/ProcTable.cpp",
"externals/dawn/src/dawn/native/ValidationUtils_autogen.cpp",
"externals/dawn/src/dawn/native/ValidationUtils_autogen.h",
"externals/dawn/src/dawn/native/dawn_platform_autogen.h",
"externals/dawn/src/dawn/native/webgpu_absl_format_autogen.cpp",
"externals/dawn/src/dawn/native/webgpu_absl_format_autogen.h",
"externals/dawn/src/dawn/native/wgpu_structs_autogen.cpp",
"externals/dawn/src/dawn/native/wgpu_structs_autogen.h",
],
cmd = "$(location :dawn_json_generator) " +
"--dawn-json $(location externals/dawn/dawn.json) " +
"--wire-json $(location externals/dawn/dawn_wire.json) " +
"--template-dir $$(dirname $(location externals/dawn/generator/templates/BSD_LICENSE)) " +
"--targets native_utils " +
"--output-dir $(RULEDIR)/externals/dawn",
tools = [":dawn_json_generator"],
)
DAWN_HDRS = [
"externals/dawn/include/dawn/EnumClassBitmasks.h",
"externals/dawn/include/dawn/dawn_proc.h",
"externals/dawn/include/dawn/dawn_thread_dispatch_proc.h",
"externals/dawn/include/dawn/dawn_wsi.h",
"externals/dawn/include/dawn/native/D3D12Backend.h",
"externals/dawn/include/dawn/native/DawnNative.h",
"externals/dawn/include/dawn/native/MetalBackend.h",
"externals/dawn/include/dawn/native/NullBackend.h",
"externals/dawn/include/dawn/native/OpenGLBackend.h",
"externals/dawn/include/dawn/native/VulkanBackend.h",
"externals/dawn/include/dawn/native/dawn_native_export.h",
"externals/dawn/include/dawn/platform/DawnPlatform.h",
"externals/dawn/include/dawn/platform/dawn_platform_export.h",
"externals/dawn/include/dawn/wire/Wire.h",
"externals/dawn/include/dawn/wire/WireClient.h",
"externals/dawn/include/dawn/wire/WireServer.h",
"externals/dawn/include/dawn/wire/dawn_wire_export.h",
"externals/dawn/include/webgpu/webgpu.h",
"externals/dawn/include/webgpu/webgpu_cpp.h",
]
DAWN_SRCS = [
# Generated files
"externals/dawn/include/dawn/webgpu.h",
"externals/dawn/include/dawn/webgpu_cpp.h",
"externals/dawn/include/dawn/dawn_proc_table.h",
# From externals/dawn/src/dawn/native/BUILD.gn:sources
"externals/dawn/src/dawn/native/DawnNative.cpp",
"externals/dawn/src/dawn/native/Adapter.cpp",
"externals/dawn/src/dawn/native/Adapter.h",
"externals/dawn/src/dawn/native/AsyncTask.cpp",
"externals/dawn/src/dawn/native/AsyncTask.h",
"externals/dawn/src/dawn/native/AttachmentState.cpp",
"externals/dawn/src/dawn/native/AttachmentState.h",
"externals/dawn/src/dawn/native/BackendConnection.cpp",
"externals/dawn/src/dawn/native/BackendConnection.h",
"externals/dawn/src/dawn/native/BindGroup.cpp",
"externals/dawn/src/dawn/native/BindGroup.h",
"externals/dawn/src/dawn/native/BindGroupLayout.cpp",
"externals/dawn/src/dawn/native/BindGroupLayout.h",
"externals/dawn/src/dawn/native/BindGroupTracker.h",
"externals/dawn/src/dawn/native/BindingInfo.cpp",
"externals/dawn/src/dawn/native/BindingInfo.h",
"externals/dawn/src/dawn/native/BuddyAllocator.cpp",
"externals/dawn/src/dawn/native/BuddyAllocator.h",
"externals/dawn/src/dawn/native/BuddyMemoryAllocator.cpp",
"externals/dawn/src/dawn/native/BuddyMemoryAllocator.h",
"externals/dawn/src/dawn/native/Buffer.cpp",
"externals/dawn/src/dawn/native/Buffer.h",
"externals/dawn/src/dawn/native/CachedObject.cpp",
"externals/dawn/src/dawn/native/CachedObject.h",
"externals/dawn/src/dawn/native/CallbackTaskManager.cpp",
"externals/dawn/src/dawn/native/CallbackTaskManager.h",
"externals/dawn/src/dawn/native/CommandAllocator.cpp",
"externals/dawn/src/dawn/native/CommandAllocator.h",
"externals/dawn/src/dawn/native/CommandBuffer.cpp",
"externals/dawn/src/dawn/native/CommandBuffer.h",
"externals/dawn/src/dawn/native/CommandBufferStateTracker.cpp",
"externals/dawn/src/dawn/native/CommandBufferStateTracker.h",
"externals/dawn/src/dawn/native/CommandEncoder.cpp",
"externals/dawn/src/dawn/native/CommandEncoder.h",
"externals/dawn/src/dawn/native/CommandValidation.cpp",
"externals/dawn/src/dawn/native/CommandValidation.h",
"externals/dawn/src/dawn/native/Commands.cpp",
"externals/dawn/src/dawn/native/Commands.h",
"externals/dawn/src/dawn/native/CacheKey.cpp",
"externals/dawn/src/dawn/native/CacheKey.h",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
"externals/dawn/src/dawn/native/CompilationMessages.cpp",
"externals/dawn/src/dawn/native/CompilationMessages.h",
"externals/dawn/src/dawn/native/ComputePassEncoder.cpp",
"externals/dawn/src/dawn/native/ComputePassEncoder.h",
"externals/dawn/src/dawn/native/ComputePipeline.cpp",
"externals/dawn/src/dawn/native/ComputePipeline.h",
"externals/dawn/src/dawn/native/CopyTextureForBrowserHelper.cpp",
"externals/dawn/src/dawn/native/CopyTextureForBrowserHelper.h",
"externals/dawn/src/dawn/native/CreatePipelineAsyncTask.cpp",
"externals/dawn/src/dawn/native/CreatePipelineAsyncTask.h",
"externals/dawn/src/dawn/native/Device.cpp",
"externals/dawn/src/dawn/native/Device.h",
"externals/dawn/src/dawn/native/DynamicUploader.cpp",
"externals/dawn/src/dawn/native/DynamicUploader.h",
"externals/dawn/src/dawn/native/EncodingContext.cpp",
"externals/dawn/src/dawn/native/EncodingContext.h",
"externals/dawn/src/dawn/native/EnumClassBitmasks.h",
"externals/dawn/src/dawn/native/EnumMaskIterator.h",
"externals/dawn/src/dawn/native/Error.cpp",
"externals/dawn/src/dawn/native/Error.h",
"externals/dawn/src/dawn/native/ErrorData.cpp",
"externals/dawn/src/dawn/native/ErrorData.h",
"externals/dawn/src/dawn/native/ErrorInjector.cpp",
"externals/dawn/src/dawn/native/ErrorInjector.h",
"externals/dawn/src/dawn/native/ErrorScope.cpp",
"externals/dawn/src/dawn/native/ErrorScope.h",
"externals/dawn/src/dawn/native/ExternalTexture.cpp",
"externals/dawn/src/dawn/native/ExternalTexture.h",
"externals/dawn/src/dawn/native/Features.cpp",
"externals/dawn/src/dawn/native/Features.h",
"externals/dawn/src/dawn/native/Format.cpp",
"externals/dawn/src/dawn/native/Format.h",
"externals/dawn/src/dawn/native/Forward.h",
"externals/dawn/src/dawn/native/IndirectDrawMetadata.cpp",
"externals/dawn/src/dawn/native/IndirectDrawMetadata.h",
"externals/dawn/src/dawn/native/IndirectDrawValidationEncoder.cpp",
"externals/dawn/src/dawn/native/IndirectDrawValidationEncoder.h",
"externals/dawn/src/dawn/native/Instance.cpp",
"externals/dawn/src/dawn/native/Instance.h",
"externals/dawn/src/dawn/native/IntegerTypes.h",
"externals/dawn/src/dawn/native/InternalPipelineStore.cpp",
"externals/dawn/src/dawn/native/InternalPipelineStore.h",
"externals/dawn/src/dawn/native/Limits.cpp",
"externals/dawn/src/dawn/native/Limits.h",
"externals/dawn/src/dawn/native/ObjectBase.cpp",
"externals/dawn/src/dawn/native/ObjectBase.h",
"externals/dawn/src/dawn/native/ObjectContentHasher.cpp",
"externals/dawn/src/dawn/native/ObjectContentHasher.h",
"externals/dawn/src/dawn/native/PassResourceUsage.h",
"externals/dawn/src/dawn/native/PassResourceUsageTracker.cpp",
"externals/dawn/src/dawn/native/PassResourceUsageTracker.h",
"externals/dawn/src/dawn/native/PerStage.cpp",
"externals/dawn/src/dawn/native/PerStage.h",
"externals/dawn/src/dawn/native/PersistentCache.cpp",
"externals/dawn/src/dawn/native/PersistentCache.h",
"externals/dawn/src/dawn/native/Pipeline.cpp",
"externals/dawn/src/dawn/native/Pipeline.h",
"externals/dawn/src/dawn/native/PipelineLayout.cpp",
"externals/dawn/src/dawn/native/PipelineLayout.h",
"externals/dawn/src/dawn/native/PooledResourceMemoryAllocator.cpp",
"externals/dawn/src/dawn/native/PooledResourceMemoryAllocator.h",
"externals/dawn/src/dawn/native/ProgrammableEncoder.cpp",
"externals/dawn/src/dawn/native/ProgrammableEncoder.h",
"externals/dawn/src/dawn/native/QueryHelper.cpp",
"externals/dawn/src/dawn/native/QueryHelper.h",
"externals/dawn/src/dawn/native/QuerySet.cpp",
"externals/dawn/src/dawn/native/QuerySet.h",
"externals/dawn/src/dawn/native/Queue.cpp",
"externals/dawn/src/dawn/native/Queue.h",
"externals/dawn/src/dawn/native/RenderBundle.cpp",
"externals/dawn/src/dawn/native/RenderBundle.h",
"externals/dawn/src/dawn/native/RenderBundleEncoder.cpp",
"externals/dawn/src/dawn/native/RenderBundleEncoder.h",
"externals/dawn/src/dawn/native/RenderEncoderBase.cpp",
"externals/dawn/src/dawn/native/RenderEncoderBase.h",
"externals/dawn/src/dawn/native/RenderPassEncoder.cpp",
"externals/dawn/src/dawn/native/RenderPassEncoder.h",
"externals/dawn/src/dawn/native/RenderPipeline.cpp",
"externals/dawn/src/dawn/native/RenderPipeline.h",
"externals/dawn/src/dawn/native/ResourceHeap.h",
"externals/dawn/src/dawn/native/ResourceHeapAllocator.h",
"externals/dawn/src/dawn/native/ResourceMemoryAllocation.cpp",
"externals/dawn/src/dawn/native/ResourceMemoryAllocation.h",
"externals/dawn/src/dawn/native/RingBufferAllocator.cpp",
"externals/dawn/src/dawn/native/RingBufferAllocator.h",
"externals/dawn/src/dawn/native/Sampler.cpp",
"externals/dawn/src/dawn/native/Sampler.h",
"externals/dawn/src/dawn/native/ScratchBuffer.cpp",
"externals/dawn/src/dawn/native/ScratchBuffer.h",
"externals/dawn/src/dawn/native/ShaderModule.cpp",
"externals/dawn/src/dawn/native/ShaderModule.h",
"externals/dawn/src/dawn/native/StagingBuffer.cpp",
"externals/dawn/src/dawn/native/StagingBuffer.h",
"externals/dawn/src/dawn/native/Subresource.cpp",
"externals/dawn/src/dawn/native/Subresource.h",
"externals/dawn/src/dawn/native/SubresourceStorage.h",
"externals/dawn/src/dawn/native/Surface.cpp",
"externals/dawn/src/dawn/native/Surface.h",
"externals/dawn/src/dawn/native/SwapChain.cpp",
"externals/dawn/src/dawn/native/SwapChain.h",
"externals/dawn/src/dawn/native/Texture.cpp",
"externals/dawn/src/dawn/native/Texture.h",
"externals/dawn/src/dawn/native/TintUtils.cpp",
"externals/dawn/src/dawn/native/TintUtils.h",
"externals/dawn/src/dawn/native/ToBackend.h",
"externals/dawn/src/dawn/native/Toggles.cpp",
"externals/dawn/src/dawn/native/Toggles.h",
"externals/dawn/src/dawn/native/VertexFormat.cpp",
"externals/dawn/src/dawn/native/VertexFormat.h",
"externals/dawn/src/dawn/native/dawn_platform.h",
"externals/dawn/src/dawn/native/utils/WGPUHelpers.cpp",
"externals/dawn/src/dawn/native/utils/WGPUHelpers.h",
"externals/dawn/src/dawn/native/webgpu_absl_format.cpp",
"externals/dawn/src/dawn/native/webgpu_absl_format.h",
# From externals/dawn/src/dawn/native/BUILD.gn:utils_gen
"externals/dawn/src/dawn/native/ChainUtils_autogen.cpp",
"externals/dawn/src/dawn/native/ChainUtils_autogen.h",
"externals/dawn/src/dawn/native/ObjectType_autogen.cpp",
"externals/dawn/src/dawn/native/ObjectType_autogen.h",
"externals/dawn/src/dawn/native/ProcTable.cpp",
"externals/dawn/src/dawn/native/ValidationUtils_autogen.cpp",
"externals/dawn/src/dawn/native/ValidationUtils_autogen.h",
"externals/dawn/src/dawn/native/webgpu_absl_format_autogen.cpp",
"externals/dawn/src/dawn/native/webgpu_absl_format_autogen.h",
"externals/dawn/src/dawn/native/dawn_platform_autogen.h",
"externals/dawn/src/dawn/native/wgpu_structs_autogen.cpp",
"externals/dawn/src/dawn/native/wgpu_structs_autogen.h",
# From externals/dawn/src/dawn/common/BUILD.gn:common
"externals/dawn/src/dawn/common/Alloc.h",
"externals/dawn/src/dawn/common/Assert.cpp",
"externals/dawn/src/dawn/common/Assert.h",
"externals/dawn/src/dawn/common/BitSetIterator.h",
"externals/dawn/src/dawn/common/Compiler.h",
"externals/dawn/src/dawn/common/ConcurrentCache.h",
"externals/dawn/src/dawn/common/Constants.h",
"externals/dawn/src/dawn/common/CoreFoundationRef.h",
"externals/dawn/src/dawn/common/DynamicLib.cpp",
"externals/dawn/src/dawn/common/DynamicLib.h",
"externals/dawn/src/dawn/common/GPUInfo.cpp",
"externals/dawn/src/dawn/common/GPUInfo.h",
"externals/dawn/src/dawn/common/HashUtils.h",
"externals/dawn/src/dawn/common/IOKitRef.h",
"externals/dawn/src/dawn/common/LinkedList.h",
"externals/dawn/src/dawn/common/Log.cpp",
"externals/dawn/src/dawn/common/Log.h",
"externals/dawn/src/dawn/common/Math.cpp",
"externals/dawn/src/dawn/common/Math.h",
"externals/dawn/src/dawn/common/NSRef.h",
"externals/dawn/src/dawn/common/NonCopyable.h",
"externals/dawn/src/dawn/common/PlacementAllocated.h",
"externals/dawn/src/dawn/common/Platform.h",
"externals/dawn/src/dawn/common/Preprocessor.h",
"externals/dawn/src/dawn/common/RefBase.h",
"externals/dawn/src/dawn/common/RefCounted.cpp",
"externals/dawn/src/dawn/common/RefCounted.h",
"externals/dawn/src/dawn/common/Result.cpp",
"externals/dawn/src/dawn/common/Result.h",
"externals/dawn/src/dawn/common/SerialMap.h",
"externals/dawn/src/dawn/common/SerialQueue.h",
"externals/dawn/src/dawn/common/SerialStorage.h",
"externals/dawn/src/dawn/common/SlabAllocator.cpp",
"externals/dawn/src/dawn/common/SlabAllocator.h",
"externals/dawn/src/dawn/common/StackContainer.h",
"externals/dawn/src/dawn/common/SwapChainUtils.h",
"externals/dawn/src/dawn/common/SystemUtils.cpp",
"externals/dawn/src/dawn/common/SystemUtils.h",
"externals/dawn/src/dawn/common/TypeTraits.h",
"externals/dawn/src/dawn/common/TypedInteger.h",
"externals/dawn/src/dawn/common/UnderlyingType.h",
"externals/dawn/src/dawn/common/ityp_array.h",
"externals/dawn/src/dawn/common/ityp_bitset.h",
"externals/dawn/src/dawn/common/ityp_span.h",
"externals/dawn/src/dawn/common/ityp_stack_vec.h",
"externals/dawn/src/dawn/common/ityp_vector.h",
"externals/dawn/src/dawn/common/vulkan_platform.h",
"externals/dawn/src/dawn/common/xlib_with_undefs.h",
# From externals/dawn/src/dawn/platform/BUILD.gn:platform
"externals/dawn/include/dawn/platform/DawnPlatform.h",
"externals/dawn/include/dawn/platform/dawn_platform_export.h",
"externals/dawn/src/dawn/platform/DawnPlatform.cpp",
"externals/dawn/src/dawn/platform/WorkerThread.cpp",
"externals/dawn/src/dawn/platform/WorkerThread.h",
"externals/dawn/src/dawn/platform/tracing/EventTracer.cpp",
"externals/dawn/src/dawn/platform/tracing/EventTracer.h",
"externals/dawn/src/dawn/platform/tracing/TraceEvent.h",
]
DAWN_VULKAN_SRCS = [
# From externals/dawn/src/dawn/native/BUILD.gn:sources (dawn_enable_vulkan)
"externals/dawn/src/dawn/native/SpirvValidation.cpp",
"externals/dawn/src/dawn/native/SpirvValidation.h",
"externals/dawn/src/dawn/native/vulkan/AdapterVk.cpp",
"externals/dawn/src/dawn/native/vulkan/AdapterVk.h",
"externals/dawn/src/dawn/native/vulkan/BackendVk.cpp",
"externals/dawn/src/dawn/native/vulkan/BackendVk.h",
"externals/dawn/src/dawn/native/vulkan/BindGroupLayoutVk.cpp",
"externals/dawn/src/dawn/native/vulkan/BindGroupLayoutVk.h",
"externals/dawn/src/dawn/native/vulkan/BindGroupVk.cpp",
"externals/dawn/src/dawn/native/vulkan/BindGroupVk.h",
"externals/dawn/src/dawn/native/vulkan/BufferVk.cpp",
"externals/dawn/src/dawn/native/vulkan/BufferVk.h",
"externals/dawn/src/dawn/native/vulkan/CommandBufferVk.cpp",
"externals/dawn/src/dawn/native/vulkan/CommandBufferVk.h",
"externals/dawn/src/dawn/native/vulkan/CommandRecordingContext.h",
"externals/dawn/src/dawn/native/vulkan/ComputePipelineVk.cpp",
"externals/dawn/src/dawn/native/vulkan/ComputePipelineVk.h",
"externals/dawn/src/dawn/native/vulkan/DescriptorSetAllocation.h",
"externals/dawn/src/dawn/native/vulkan/DescriptorSetAllocator.cpp",
"externals/dawn/src/dawn/native/vulkan/DescriptorSetAllocator.h",
"externals/dawn/src/dawn/native/vulkan/DeviceVk.cpp",
"externals/dawn/src/dawn/native/vulkan/DeviceVk.h",
"externals/dawn/src/dawn/native/vulkan/ExternalHandle.h",
"externals/dawn/src/dawn/native/vulkan/FencedDeleter.cpp",
"externals/dawn/src/dawn/native/vulkan/FencedDeleter.h",
"externals/dawn/src/dawn/native/vulkan/Forward.h",
"externals/dawn/src/dawn/native/vulkan/NativeSwapChainImplVk.cpp",
"externals/dawn/src/dawn/native/vulkan/NativeSwapChainImplVk.h",
"externals/dawn/src/dawn/native/vulkan/PipelineLayoutVk.cpp",
"externals/dawn/src/dawn/native/vulkan/PipelineLayoutVk.h",
"externals/dawn/src/dawn/native/vulkan/QuerySetVk.cpp",
"externals/dawn/src/dawn/native/vulkan/QuerySetVk.h",
"externals/dawn/src/dawn/native/vulkan/QueueVk.cpp",
"externals/dawn/src/dawn/native/vulkan/QueueVk.h",
"externals/dawn/src/dawn/native/vulkan/RenderPassCache.cpp",
"externals/dawn/src/dawn/native/vulkan/RenderPassCache.h",
"externals/dawn/src/dawn/native/vulkan/RenderPipelineVk.cpp",
"externals/dawn/src/dawn/native/vulkan/RenderPipelineVk.h",
"externals/dawn/src/dawn/native/vulkan/ResourceHeapVk.cpp",
"externals/dawn/src/dawn/native/vulkan/ResourceHeapVk.h",
"externals/dawn/src/dawn/native/vulkan/ResourceMemoryAllocatorVk.cpp",
"externals/dawn/src/dawn/native/vulkan/ResourceMemoryAllocatorVk.h",
"externals/dawn/src/dawn/native/vulkan/SamplerVk.cpp",
"externals/dawn/src/dawn/native/vulkan/SamplerVk.h",
"externals/dawn/src/dawn/native/vulkan/ShaderModuleVk.cpp",
"externals/dawn/src/dawn/native/vulkan/ShaderModuleVk.h",
"externals/dawn/src/dawn/native/vulkan/StagingBufferVk.cpp",
"externals/dawn/src/dawn/native/vulkan/StagingBufferVk.h",
"externals/dawn/src/dawn/native/vulkan/SwapChainVk.cpp",
"externals/dawn/src/dawn/native/vulkan/SwapChainVk.h",
"externals/dawn/src/dawn/native/vulkan/TextureVk.cpp",
"externals/dawn/src/dawn/native/vulkan/TextureVk.h",
"externals/dawn/src/dawn/native/vulkan/UtilsVulkan.cpp",
"externals/dawn/src/dawn/native/vulkan/UtilsVulkan.h",
"externals/dawn/src/dawn/native/vulkan/VulkanBackend.cpp",
"externals/dawn/src/dawn/native/vulkan/VulkanError.cpp",
"externals/dawn/src/dawn/native/vulkan/VulkanError.h",
"externals/dawn/src/dawn/native/vulkan/VulkanExtensions.cpp",
"externals/dawn/src/dawn/native/vulkan/VulkanExtensions.h",
"externals/dawn/src/dawn/native/vulkan/VulkanFunctions.cpp",
"externals/dawn/src/dawn/native/vulkan/VulkanFunctions.h",
"externals/dawn/src/dawn/native/vulkan/VulkanInfo.cpp",
"externals/dawn/src/dawn/native/vulkan/VulkanInfo.h",
"externals/dawn/src/dawn/native/vulkan/external_memory/MemoryService.h",
"externals/dawn/src/dawn/native/vulkan/external_semaphore/SemaphoreService.h",
]
DAWN_VULKAN_LINUX_SRCS = [
# From externals/dawn/src/dawn/native/BUILD.gn:sources (dawn_enable_vulkan && is_linux)
"externals/dawn/src/dawn/native/vulkan/external_memory/MemoryServiceOpaqueFD.cpp",
"externals/dawn/src/dawn/native/vulkan/external_semaphore/SemaphoreServiceFD.cpp",
]
DAWN_VULKAN_DEFINES = [
# From externals/dawn/src/dawn/common/BUILD.gn:internal_config
"DAWN_ENABLE_BACKEND_VULKAN",
]
cc_library(
name = "dawn_native",
srcs = DAWN_SRCS + DAWN_VULKAN_SRCS + DAWN_VULKAN_LINUX_SRCS,
hdrs = DAWN_HDRS,
copts = [
# List this as a copt, so as not to propogate it to dependents
# Skia has its own vulkan headers and we do not want these to
# interfere/override those.
"-isystem third_party/externals/vulkan-headers/include",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
],
defines = DAWN_VULKAN_DEFINES,
includes = [
"externals/dawn/include",
"externals/dawn/src",
],
visibility = ["//visibility:private"], # only used by :dawn
deps = [
# Dawn specifically depends on externals/dawn/src/tint:libtint
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
":tint",
"@abseil_cpp//absl/strings:str_format",
":vulkan_headers",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
],
)
cc_library(
name = "dawn_cpp",
srcs = [
# From externals/dawn/src/dawn/BUILD.gn#cpp
"externals/dawn/include/dawn/webgpu.h",
"externals/dawn/include/dawn/EnumClassBitmasks.h",
"externals/dawn/include/dawn/webgpu_cpp.h",
"externals/dawn/src/dawn/webgpu_cpp.cpp",
],
includes = [
"externals/dawn/include",
],
visibility = ["//visibility:private"], # only used by :dawn
)
cc_library(
name = "dawn_proc",
srcs = [
# From externals/dawn/src/dawn/BUILD.gn#proc
"externals/dawn/include/dawn/webgpu.h",
"externals/dawn/include/dawn/dawn_proc.h",
"externals/dawn/include/dawn/dawn_thread_dispatch_proc.h",
"externals/dawn/include/dawn/dawn_proc_table.h",
"externals/dawn/src/dawn/dawn_proc.c",
"externals/dawn/src/dawn/dawn_thread_dispatch_proc.cpp",
],
includes = [
"externals/dawn/include",
],
visibility = ["//visibility:private"], # only used by :dawn
)
cc_library(
name = "dawn",
visibility = ["//:__subpackages__"],
deps = select({
# Emscripten provides the dawn files necessary as system headers.
"//bazel/common_config_settings:cpu_wasm": [],
"//conditions:default": [
":dawn_cpp",
":dawn_native",
":dawn_proc",
],
}),
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
)
TINT_HDRS = [
"externals/dawn/include/tint/tint.h",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
]
TINT_SRCS = [
# From externals/dawn/src/tint/BUILD.gn:libtint_core_all_src
"externals/dawn/src/tint/ast/access.cc",
"externals/dawn/src/tint/ast/access.h",
"externals/dawn/src/tint/ast/alias.cc",
"externals/dawn/src/tint/ast/alias.h",
"externals/dawn/src/tint/ast/array.cc",
"externals/dawn/src/tint/ast/array.h",
"externals/dawn/src/tint/ast/assignment_statement.cc",
"externals/dawn/src/tint/ast/assignment_statement.h",
"externals/dawn/src/tint/ast/ast_type.cc",
"externals/dawn/src/tint/ast/atomic.cc",
"externals/dawn/src/tint/ast/atomic.h",
"externals/dawn/src/tint/ast/attribute.cc",
"externals/dawn/src/tint/ast/attribute.h",
"externals/dawn/src/tint/ast/binary_expression.cc",
"externals/dawn/src/tint/ast/binary_expression.h",
"externals/dawn/src/tint/ast/binding_attribute.cc",
"externals/dawn/src/tint/ast/binding_attribute.h",
"externals/dawn/src/tint/ast/bitcast_expression.cc",
"externals/dawn/src/tint/ast/bitcast_expression.h",
"externals/dawn/src/tint/ast/block_statement.cc",
"externals/dawn/src/tint/ast/block_statement.h",
"externals/dawn/src/tint/ast/bool.cc",
"externals/dawn/src/tint/ast/bool.h",
"externals/dawn/src/tint/ast/bool_literal_expression.cc",
"externals/dawn/src/tint/ast/bool_literal_expression.h",
"externals/dawn/src/tint/ast/break_statement.cc",
"externals/dawn/src/tint/ast/break_statement.h",
"externals/dawn/src/tint/ast/builtin.cc",
"externals/dawn/src/tint/ast/builtin.h",
"externals/dawn/src/tint/ast/builtin_attribute.cc",
"externals/dawn/src/tint/ast/builtin_attribute.h",
"externals/dawn/src/tint/ast/call_expression.cc",
"externals/dawn/src/tint/ast/call_expression.h",
"externals/dawn/src/tint/ast/call_statement.cc",
"externals/dawn/src/tint/ast/call_statement.h",
"externals/dawn/src/tint/ast/case_statement.cc",
"externals/dawn/src/tint/ast/case_statement.h",
"externals/dawn/src/tint/ast/compound_assignment_statement.cc",
"externals/dawn/src/tint/ast/compound_assignment_statement.h",
"externals/dawn/src/tint/ast/continue_statement.cc",
"externals/dawn/src/tint/ast/continue_statement.h",
"externals/dawn/src/tint/ast/depth_multisampled_texture.cc",
"externals/dawn/src/tint/ast/depth_multisampled_texture.h",
"externals/dawn/src/tint/ast/depth_texture.cc",
"externals/dawn/src/tint/ast/depth_texture.h",
"externals/dawn/src/tint/ast/disable_validation_attribute.cc",
"externals/dawn/src/tint/ast/disable_validation_attribute.h",
"externals/dawn/src/tint/ast/discard_statement.cc",
"externals/dawn/src/tint/ast/discard_statement.h",
"externals/dawn/src/tint/ast/else_statement.cc",
"externals/dawn/src/tint/ast/else_statement.h",
"externals/dawn/src/tint/ast/expression.cc",
"externals/dawn/src/tint/ast/expression.h",
"externals/dawn/src/tint/ast/external_texture.cc",
"externals/dawn/src/tint/ast/external_texture.h",
"externals/dawn/src/tint/ast/f32.cc",
"externals/dawn/src/tint/ast/f32.h",
"externals/dawn/src/tint/ast/fallthrough_statement.cc",
"externals/dawn/src/tint/ast/fallthrough_statement.h",
"externals/dawn/src/tint/ast/float_literal_expression.cc",
"externals/dawn/src/tint/ast/float_literal_expression.h",
"externals/dawn/src/tint/ast/for_loop_statement.cc",
"externals/dawn/src/tint/ast/for_loop_statement.h",
"externals/dawn/src/tint/ast/function.cc",
"externals/dawn/src/tint/ast/function.h",
"externals/dawn/src/tint/ast/group_attribute.cc",
"externals/dawn/src/tint/ast/group_attribute.h",
"externals/dawn/src/tint/ast/i32.cc",
"externals/dawn/src/tint/ast/i32.h",
"externals/dawn/src/tint/ast/id_attribute.cc",
"externals/dawn/src/tint/ast/id_attribute.h",
"externals/dawn/src/tint/ast/identifier_expression.cc",
"externals/dawn/src/tint/ast/identifier_expression.h",
"externals/dawn/src/tint/ast/if_statement.cc",
"externals/dawn/src/tint/ast/if_statement.h",
"externals/dawn/src/tint/ast/index_accessor_expression.cc",
"externals/dawn/src/tint/ast/index_accessor_expression.h",
"externals/dawn/src/tint/ast/int_literal_expression.cc",
"externals/dawn/src/tint/ast/int_literal_expression.h",
"externals/dawn/src/tint/ast/internal_attribute.cc",
"externals/dawn/src/tint/ast/internal_attribute.h",
"externals/dawn/src/tint/ast/interpolate_attribute.cc",
"externals/dawn/src/tint/ast/interpolate_attribute.h",
"externals/dawn/src/tint/ast/invariant_attribute.cc",
"externals/dawn/src/tint/ast/invariant_attribute.h",
"externals/dawn/src/tint/ast/literal_expression.cc",
"externals/dawn/src/tint/ast/literal_expression.h",
"externals/dawn/src/tint/ast/location_attribute.cc",
"externals/dawn/src/tint/ast/location_attribute.h",
"externals/dawn/src/tint/ast/loop_statement.cc",
"externals/dawn/src/tint/ast/loop_statement.h",
"externals/dawn/src/tint/ast/matrix.cc",
"externals/dawn/src/tint/ast/matrix.h",
"externals/dawn/src/tint/ast/member_accessor_expression.cc",
"externals/dawn/src/tint/ast/member_accessor_expression.h",
"externals/dawn/src/tint/ast/module.cc",
"externals/dawn/src/tint/ast/module.h",
"externals/dawn/src/tint/ast/multisampled_texture.cc",
"externals/dawn/src/tint/ast/multisampled_texture.h",
"externals/dawn/src/tint/ast/node.cc",
"externals/dawn/src/tint/ast/node.h",
"externals/dawn/src/tint/ast/phony_expression.cc",
"externals/dawn/src/tint/ast/phony_expression.h",
"externals/dawn/src/tint/ast/pipeline_stage.cc",
"externals/dawn/src/tint/ast/pipeline_stage.h",
"externals/dawn/src/tint/ast/pointer.cc",
"externals/dawn/src/tint/ast/pointer.h",
"externals/dawn/src/tint/ast/return_statement.cc",
"externals/dawn/src/tint/ast/return_statement.h",
"externals/dawn/src/tint/ast/sampled_texture.cc",
"externals/dawn/src/tint/ast/sampled_texture.h",
"externals/dawn/src/tint/ast/sampler.cc",
"externals/dawn/src/tint/ast/sampler.h",
"externals/dawn/src/tint/ast/sint_literal_expression.cc",
"externals/dawn/src/tint/ast/sint_literal_expression.h",
"externals/dawn/src/tint/ast/stage_attribute.cc",
"externals/dawn/src/tint/ast/stage_attribute.h",
"externals/dawn/src/tint/ast/statement.cc",
"externals/dawn/src/tint/ast/statement.h",
"externals/dawn/src/tint/ast/storage_class.cc",
"externals/dawn/src/tint/ast/storage_class.h",
"externals/dawn/src/tint/ast/storage_texture.cc",
"externals/dawn/src/tint/ast/storage_texture.h",
"externals/dawn/src/tint/ast/stride_attribute.cc",
"externals/dawn/src/tint/ast/stride_attribute.h",
"externals/dawn/src/tint/ast/struct.cc",
"externals/dawn/src/tint/ast/struct.h",
"externals/dawn/src/tint/ast/struct_member.cc",
"externals/dawn/src/tint/ast/struct_member.h",
"externals/dawn/src/tint/ast/struct_member_align_attribute.cc",
"externals/dawn/src/tint/ast/struct_member_align_attribute.h",
"externals/dawn/src/tint/ast/struct_member_offset_attribute.cc",
"externals/dawn/src/tint/ast/struct_member_offset_attribute.h",
"externals/dawn/src/tint/ast/struct_member_size_attribute.cc",
"externals/dawn/src/tint/ast/struct_member_size_attribute.h",
"externals/dawn/src/tint/ast/switch_statement.cc",
"externals/dawn/src/tint/ast/switch_statement.h",
"externals/dawn/src/tint/ast/texture.cc",
"externals/dawn/src/tint/ast/texture.h",
"externals/dawn/src/tint/ast/traverse_expressions.h",
"externals/dawn/src/tint/ast/type.h",
"externals/dawn/src/tint/ast/type_decl.cc",
"externals/dawn/src/tint/ast/type_decl.h",
"externals/dawn/src/tint/ast/type_name.cc",
"externals/dawn/src/tint/ast/type_name.h",
"externals/dawn/src/tint/ast/u32.cc",
"externals/dawn/src/tint/ast/u32.h",
"externals/dawn/src/tint/ast/uint_literal_expression.cc",
"externals/dawn/src/tint/ast/uint_literal_expression.h",
"externals/dawn/src/tint/ast/unary_op.cc",
"externals/dawn/src/tint/ast/unary_op.h",
"externals/dawn/src/tint/ast/unary_op_expression.cc",
"externals/dawn/src/tint/ast/unary_op_expression.h",
"externals/dawn/src/tint/ast/variable.cc",
"externals/dawn/src/tint/ast/variable.h",
"externals/dawn/src/tint/ast/variable_decl_statement.cc",
"externals/dawn/src/tint/ast/variable_decl_statement.h",
"externals/dawn/src/tint/ast/vector.cc",
"externals/dawn/src/tint/ast/vector.h",
"externals/dawn/src/tint/ast/void.cc",
"externals/dawn/src/tint/ast/void.h",
"externals/dawn/src/tint/ast/workgroup_attribute.cc",
"externals/dawn/src/tint/ast/workgroup_attribute.h",
"externals/dawn/src/tint/builtin_table.cc",
"externals/dawn/src/tint/builtin_table.h",
"externals/dawn/src/tint/builtin_table.inl",
"externals/dawn/src/tint/castable.cc",
"externals/dawn/src/tint/castable.h",
"externals/dawn/src/tint/clone_context.cc",
"externals/dawn/src/tint/clone_context.h",
"externals/dawn/src/tint/debug.cc",
"externals/dawn/src/tint/debug.h",
"externals/dawn/src/tint/demangler.cc",
"externals/dawn/src/tint/demangler.h",
"externals/dawn/src/tint/diagnostic/diagnostic.cc",
"externals/dawn/src/tint/diagnostic/diagnostic.h",
"externals/dawn/src/tint/diagnostic/formatter.cc",
"externals/dawn/src/tint/diagnostic/formatter.h",
"externals/dawn/src/tint/diagnostic/printer.cc",
"externals/dawn/src/tint/diagnostic/printer.h",
"externals/dawn/src/tint/inspector/entry_point.cc",
"externals/dawn/src/tint/inspector/entry_point.h",
"externals/dawn/src/tint/inspector/inspector.cc",
"externals/dawn/src/tint/inspector/inspector.h",
"externals/dawn/src/tint/inspector/resource_binding.cc",
"externals/dawn/src/tint/inspector/resource_binding.h",
"externals/dawn/src/tint/inspector/scalar.cc",
"externals/dawn/src/tint/inspector/scalar.h",
"externals/dawn/src/tint/program.cc",
"externals/dawn/src/tint/program.h",
"externals/dawn/src/tint/program_builder.cc",
"externals/dawn/src/tint/program_builder.h",
"externals/dawn/src/tint/program_id.cc",
"externals/dawn/src/tint/program_id.h",
"externals/dawn/src/tint/reader/reader.cc",
"externals/dawn/src/tint/reader/reader.h",
"externals/dawn/src/tint/resolver/dependency_graph.cc",
"externals/dawn/src/tint/resolver/dependency_graph.h",
"externals/dawn/src/tint/resolver/resolver.cc",
"externals/dawn/src/tint/resolver/resolver.h",
"externals/dawn/src/tint/resolver/resolver_constants.cc",
"externals/dawn/src/tint/resolver/resolver_validation.cc",
"externals/dawn/src/tint/scope_stack.h",
"externals/dawn/src/tint/source.cc",
"externals/dawn/src/tint/source.h",
"externals/dawn/src/tint/symbol.cc",
"externals/dawn/src/tint/symbol.h",
"externals/dawn/src/tint/symbol_table.cc",
"externals/dawn/src/tint/symbol_table.h",
"externals/dawn/src/tint/text/unicode.cc",
"externals/dawn/src/tint/text/unicode.h",
"externals/dawn/src/tint/traits.h",
"externals/dawn/src/tint/transform/add_empty_entry_point.cc",
"externals/dawn/src/tint/transform/add_empty_entry_point.h",
"externals/dawn/src/tint/transform/add_spirv_block_attribute.cc",
"externals/dawn/src/tint/transform/add_spirv_block_attribute.h",
"externals/dawn/src/tint/transform/array_length_from_uniform.cc",
"externals/dawn/src/tint/transform/array_length_from_uniform.h",
"externals/dawn/src/tint/transform/binding_remapper.cc",
"externals/dawn/src/tint/transform/binding_remapper.h",
"externals/dawn/src/tint/transform/builtin_polyfill.cc",
"externals/dawn/src/tint/transform/builtin_polyfill.h",
"externals/dawn/src/tint/transform/calculate_array_length.cc",
"externals/dawn/src/tint/transform/calculate_array_length.h",
"externals/dawn/src/tint/transform/canonicalize_entry_point_io.cc",
"externals/dawn/src/tint/transform/canonicalize_entry_point_io.h",
"externals/dawn/src/tint/transform/combine_samplers.cc",
"externals/dawn/src/tint/transform/combine_samplers.h",
"externals/dawn/src/tint/transform/decompose_memory_access.cc",
"externals/dawn/src/tint/transform/decompose_memory_access.h",
"externals/dawn/src/tint/transform/decompose_strided_array.cc",
"externals/dawn/src/tint/transform/decompose_strided_array.h",
"externals/dawn/src/tint/transform/decompose_strided_matrix.cc",
"externals/dawn/src/tint/transform/decompose_strided_matrix.h",
"externals/dawn/src/tint/transform/expand_compound_assignment.cc",
"externals/dawn/src/tint/transform/expand_compound_assignment.h",
"externals/dawn/src/tint/transform/first_index_offset.cc",
"externals/dawn/src/tint/transform/first_index_offset.h",
"externals/dawn/src/tint/transform/fold_constants.cc",
"externals/dawn/src/tint/transform/fold_constants.h",
"externals/dawn/src/tint/transform/fold_trivial_single_use_lets.cc",
"externals/dawn/src/tint/transform/fold_trivial_single_use_lets.h",
"externals/dawn/src/tint/transform/for_loop_to_loop.cc",
"externals/dawn/src/tint/transform/for_loop_to_loop.h",
"externals/dawn/src/tint/transform/localize_struct_array_assignment.cc",
"externals/dawn/src/tint/transform/localize_struct_array_assignment.h",
"externals/dawn/src/tint/transform/loop_to_for_loop.cc",
"externals/dawn/src/tint/transform/loop_to_for_loop.h",
"externals/dawn/src/tint/transform/manager.cc",
"externals/dawn/src/tint/transform/manager.h",
"externals/dawn/src/tint/transform/module_scope_var_to_entry_point_param.cc",
"externals/dawn/src/tint/transform/module_scope_var_to_entry_point_param.h",
"externals/dawn/src/tint/transform/multiplanar_external_texture.cc",
"externals/dawn/src/tint/transform/multiplanar_external_texture.h",
"externals/dawn/src/tint/transform/num_workgroups_from_uniform.cc",
"externals/dawn/src/tint/transform/num_workgroups_from_uniform.h",
"externals/dawn/src/tint/transform/promote_initializers_to_const_var.cc",
"externals/dawn/src/tint/transform/promote_initializers_to_const_var.h",
"externals/dawn/src/tint/transform/promote_side_effects_to_decl.cc",
"externals/dawn/src/tint/transform/promote_side_effects_to_decl.h",
"externals/dawn/src/tint/transform/remove_phonies.cc",
"externals/dawn/src/tint/transform/remove_phonies.h",
"externals/dawn/src/tint/transform/remove_unreachable_statements.cc",
"externals/dawn/src/tint/transform/remove_unreachable_statements.h",
"externals/dawn/src/tint/transform/renamer.cc",
"externals/dawn/src/tint/transform/renamer.h",
"externals/dawn/src/tint/transform/robustness.cc",
"externals/dawn/src/tint/transform/robustness.h",
"externals/dawn/src/tint/transform/simplify_pointers.cc",
"externals/dawn/src/tint/transform/simplify_pointers.h",
"externals/dawn/src/tint/transform/single_entry_point.cc",
"externals/dawn/src/tint/transform/single_entry_point.h",
"externals/dawn/src/tint/transform/transform.cc",
"externals/dawn/src/tint/transform/transform.h",
"externals/dawn/src/tint/transform/unshadow.cc",
"externals/dawn/src/tint/transform/unshadow.h",
"externals/dawn/src/tint/transform/unwind_discard_functions.cc",
"externals/dawn/src/tint/transform/unwind_discard_functions.h",
"externals/dawn/src/tint/transform/utils/hoist_to_decl_before.cc",
"externals/dawn/src/tint/transform/utils/hoist_to_decl_before.h",
"externals/dawn/src/tint/transform/utils/get_insertion_point.cc",
"externals/dawn/src/tint/transform/utils/get_insertion_point.h",
"externals/dawn/src/tint/transform/var_for_dynamic_index.cc",
"externals/dawn/src/tint/transform/var_for_dynamic_index.h",
"externals/dawn/src/tint/transform/vectorize_scalar_matrix_constructors.cc",
"externals/dawn/src/tint/transform/vectorize_scalar_matrix_constructors.h",
"externals/dawn/src/tint/transform/vertex_pulling.cc",
"externals/dawn/src/tint/transform/vertex_pulling.h",
"externals/dawn/src/tint/transform/wrap_arrays_in_structs.cc",
"externals/dawn/src/tint/transform/wrap_arrays_in_structs.h",
"externals/dawn/src/tint/transform/zero_init_workgroup_memory.cc",
"externals/dawn/src/tint/transform/zero_init_workgroup_memory.h",
"externals/dawn/src/tint/utils/block_allocator.h",
"externals/dawn/src/tint/utils/concat.h",
"externals/dawn/src/tint/utils/crc32.h",
"externals/dawn/src/tint/utils/debugger.cc",
"externals/dawn/src/tint/utils/debugger.h",
"externals/dawn/src/tint/utils/defer.h",
"externals/dawn/src/tint/utils/enum_set.h",
"externals/dawn/src/tint/utils/hash.h",
"externals/dawn/src/tint/utils/map.h",
"externals/dawn/src/tint/utils/math.h",
"externals/dawn/src/tint/utils/reverse.h",
"externals/dawn/src/tint/utils/scoped_assignment.h",
"externals/dawn/src/tint/utils/string.h",
"externals/dawn/src/tint/utils/to_const_ptr_vec.h",
"externals/dawn/src/tint/utils/transform.h",
"externals/dawn/src/tint/utils/unique_allocator.h",
"externals/dawn/src/tint/utils/unique_vector.h",
"externals/dawn/src/tint/writer/append_vector.cc",
"externals/dawn/src/tint/writer/append_vector.h",
"externals/dawn/src/tint/writer/array_length_from_uniform_options.cc",
"externals/dawn/src/tint/writer/array_length_from_uniform_options.h",
"externals/dawn/src/tint/writer/float_to_string.cc",
"externals/dawn/src/tint/writer/float_to_string.h",
"externals/dawn/src/tint/writer/generate_external_texture_bindings.cc",
"externals/dawn/src/tint/writer/generate_external_texture_bindings.h",
"externals/dawn/src/tint/writer/text.cc",
"externals/dawn/src/tint/writer/text.h",
"externals/dawn/src/tint/writer/text_generator.cc",
"externals/dawn/src/tint/writer/text_generator.h",
"externals/dawn/src/tint/writer/writer.cc",
"externals/dawn/src/tint/writer/writer.h",
# From externals/dawn/src/tint/BUILD.gn:libtint_sem_src
"externals/dawn/src/tint/sem/array.cc",
"externals/dawn/src/tint/sem/array.h",
"externals/dawn/src/tint/sem/atomic_type.cc",
"externals/dawn/src/tint/sem/atomic_type.h",
"externals/dawn/src/tint/sem/behavior.cc",
"externals/dawn/src/tint/sem/behavior.h",
"externals/dawn/src/tint/sem/binding_point.h",
"externals/dawn/src/tint/sem/block_statement.cc",
"externals/dawn/src/tint/sem/block_statement.h",
"externals/dawn/src/tint/sem/bool_type.cc",
"externals/dawn/src/tint/sem/bool_type.h",
"externals/dawn/src/tint/sem/builtin.cc",
"externals/dawn/src/tint/sem/builtin.h",
"externals/dawn/src/tint/sem/builtin_type.cc",
"externals/dawn/src/tint/sem/builtin_type.h",
"externals/dawn/src/tint/sem/call.cc",
"externals/dawn/src/tint/sem/call.h",
"externals/dawn/src/tint/sem/call_target.cc",
"externals/dawn/src/tint/sem/call_target.h",
"externals/dawn/src/tint/sem/constant.cc",
"externals/dawn/src/tint/sem/constant.h",
"externals/dawn/src/tint/sem/depth_multisampled_texture_type.cc",
"externals/dawn/src/tint/sem/depth_multisampled_texture_type.h",
"externals/dawn/src/tint/sem/depth_texture_type.cc",
"externals/dawn/src/tint/sem/depth_texture_type.h",
"externals/dawn/src/tint/sem/expression.cc",
"externals/dawn/src/tint/sem/expression.h",
"externals/dawn/src/tint/sem/external_texture_type.cc",
"externals/dawn/src/tint/sem/external_texture_type.h",
"externals/dawn/src/tint/sem/f32_type.cc",
"externals/dawn/src/tint/sem/f32_type.h",
"externals/dawn/src/tint/sem/for_loop_statement.cc",
"externals/dawn/src/tint/sem/for_loop_statement.h",
"externals/dawn/src/tint/sem/function.cc",
"externals/dawn/src/tint/sem/function.h",
"externals/dawn/src/tint/sem/i32_type.cc",
"externals/dawn/src/tint/sem/i32_type.h",
"externals/dawn/src/tint/sem/if_statement.cc",
"externals/dawn/src/tint/sem/if_statement.h",
"externals/dawn/src/tint/sem/info.cc",
"externals/dawn/src/tint/sem/info.h",
"externals/dawn/src/tint/sem/loop_statement.cc",
"externals/dawn/src/tint/sem/loop_statement.h",
"externals/dawn/src/tint/sem/matrix_type.cc",
"externals/dawn/src/tint/sem/matrix_type.h",
"externals/dawn/src/tint/sem/member_accessor_expression.cc",
"externals/dawn/src/tint/sem/member_accessor_expression.h",
"externals/dawn/src/tint/sem/module.cc",
"externals/dawn/src/tint/sem/module.h",
"externals/dawn/src/tint/sem/multisampled_texture_type.cc",
"externals/dawn/src/tint/sem/multisampled_texture_type.h",
"externals/dawn/src/tint/sem/node.cc",
"externals/dawn/src/tint/sem/node.h",
"externals/dawn/src/tint/sem/parameter_usage.cc",
"externals/dawn/src/tint/sem/parameter_usage.h",
"externals/dawn/src/tint/sem/pipeline_stage_set.h",
"externals/dawn/src/tint/sem/pointer_type.cc",
"externals/dawn/src/tint/sem/pointer_type.h",
"externals/dawn/src/tint/sem/reference_type.cc",
"externals/dawn/src/tint/sem/reference_type.h",
"externals/dawn/src/tint/sem/sampled_texture_type.cc",
"externals/dawn/src/tint/sem/sampled_texture_type.h",
"externals/dawn/src/tint/sem/sampler_texture_pair.h",
"externals/dawn/src/tint/sem/sampler_type.cc",
"externals/dawn/src/tint/sem/sampler_type.h",
"externals/dawn/src/tint/sem/statement.cc",
"externals/dawn/src/tint/sem/statement.h",
"externals/dawn/src/tint/sem/storage_texture_type.cc",
"externals/dawn/src/tint/sem/storage_texture_type.h",
"externals/dawn/src/tint/sem/struct.cc",
"externals/dawn/src/tint/sem/struct.h",
"externals/dawn/src/tint/sem/switch_statement.cc",
"externals/dawn/src/tint/sem/switch_statement.h",
"externals/dawn/src/tint/sem/texture_type.cc",
"externals/dawn/src/tint/sem/texture_type.h",
"externals/dawn/src/tint/sem/type.cc",
"externals/dawn/src/tint/sem/type.h",
"externals/dawn/src/tint/sem/type_constructor.cc",
"externals/dawn/src/tint/sem/type_constructor.h",
"externals/dawn/src/tint/sem/type_conversion.cc",
"externals/dawn/src/tint/sem/type_conversion.h",
"externals/dawn/src/tint/sem/type_manager.cc",
"externals/dawn/src/tint/sem/type_manager.h",
"externals/dawn/src/tint/sem/type_mappings.h",
"externals/dawn/src/tint/sem/u32_type.cc",
"externals/dawn/src/tint/sem/u32_type.h",
"externals/dawn/src/tint/sem/variable.cc",
"externals/dawn/src/tint/sem/variable.h",
"externals/dawn/src/tint/sem/vector_type.cc",
"externals/dawn/src/tint/sem/vector_type.h",
"externals/dawn/src/tint/sem/void_type.cc",
"externals/dawn/src/tint/sem/void_type.h",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
# Dawn sets the following tint GN variables
# tint_build_spv_reader = true
# tint_build_spv_writer = true
# tint_build_wgsl_reader = true
# tint_build_wgsl_writer = true
# From externals/dawn/src/tint/BUILD.gn:libtint_spv_reader_src
"externals/dawn/src/tint/reader/spirv/construct.cc",
"externals/dawn/src/tint/reader/spirv/construct.h",
"externals/dawn/src/tint/reader/spirv/entry_point_info.cc",
"externals/dawn/src/tint/reader/spirv/entry_point_info.h",
"externals/dawn/src/tint/reader/spirv/enum_converter.cc",
"externals/dawn/src/tint/reader/spirv/enum_converter.h",
"externals/dawn/src/tint/reader/spirv/fail_stream.h",
"externals/dawn/src/tint/reader/spirv/function.cc",
"externals/dawn/src/tint/reader/spirv/function.h",
"externals/dawn/src/tint/reader/spirv/namer.cc",
"externals/dawn/src/tint/reader/spirv/namer.h",
"externals/dawn/src/tint/reader/spirv/parser.cc",
"externals/dawn/src/tint/reader/spirv/parser.h",
"externals/dawn/src/tint/reader/spirv/parser_impl.cc",
"externals/dawn/src/tint/reader/spirv/parser_impl.h",
"externals/dawn/src/tint/reader/spirv/parser_type.cc",
"externals/dawn/src/tint/reader/spirv/parser_type.h",
"externals/dawn/src/tint/reader/spirv/usage.cc",
"externals/dawn/src/tint/reader/spirv/usage.h",
# From externals/dawn/src/tint/BUILD.gn:libtint_spv_writer_src
"externals/dawn/src/tint/writer/spirv/binary_writer.cc",
"externals/dawn/src/tint/writer/spirv/binary_writer.h",
"externals/dawn/src/tint/writer/spirv/builder.cc",
"externals/dawn/src/tint/writer/spirv/builder.h",
"externals/dawn/src/tint/writer/spirv/function.cc",
"externals/dawn/src/tint/writer/spirv/function.h",
"externals/dawn/src/tint/writer/spirv/generator.cc",
"externals/dawn/src/tint/writer/spirv/generator.h",
"externals/dawn/src/tint/writer/spirv/instruction.cc",
"externals/dawn/src/tint/writer/spirv/instruction.h",
"externals/dawn/src/tint/writer/spirv/operand.cc",
"externals/dawn/src/tint/writer/spirv/operand.h",
"externals/dawn/src/tint/writer/spirv/scalar_constant.h",
# From externals/dawn/src/tint/BUILD.gn:libtint_wgsl_reader_src
"externals/dawn/src/tint/reader/wgsl/lexer.cc",
"externals/dawn/src/tint/reader/wgsl/lexer.h",
"externals/dawn/src/tint/reader/wgsl/parser.cc",
"externals/dawn/src/tint/reader/wgsl/parser.h",
"externals/dawn/src/tint/reader/wgsl/parser_impl.cc",
"externals/dawn/src/tint/reader/wgsl/parser_impl.h",
"externals/dawn/src/tint/reader/wgsl/parser_impl_detail.h",
"externals/dawn/src/tint/reader/wgsl/token.cc",
"externals/dawn/src/tint/reader/wgsl/token.h",
# From externals/dawn/src/tint/BUILD.gn:libtint_wgsl_writer_src
"externals/dawn/src/tint/writer/wgsl/generator.cc",
"externals/dawn/src/tint/writer/wgsl/generator.h",
"externals/dawn/src/tint/writer/wgsl/generator_impl.cc",
"externals/dawn/src/tint/writer/wgsl/generator_impl.h",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
]
cc_library(
name = "tint",
srcs = TINT_SRCS,
hdrs = TINT_HDRS,
defines = [
# From From externals/dawn/src/tint/BUILD.gn:tint_public_config, using the options
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
# set by Skia in //build_overrides/tint.gni
"TINT_BUILD_SPV_READER=1",
"TINT_BUILD_SPV_WRITER=1",
"TINT_BUILD_WGSL_READER=1",
"TINT_BUILD_WGSL_WRITER=1",
],
includes = [
"externals/dawn/",
"externals/dawn/include",
[bazel] Add support for Dawn (via Vulkan) sk_app has existing support for Dawn on top of Vulkan, and this adds support to build //example:hello_world_dawn and get this to run on Linux. Dawn depends on Tint and abseil-cpp. Tint further depends on spirv_tools and spirv_headers (for writing to the SPIR-V format). Dawn and Tint only have GN and CMake support, so we need to make our Bazel rules for them (see //third_party/BUILD.bazel). abseil-cpp and the SPIR-V libraries have Bazel support, so we can just include them (see //WORKSPACE.bazel). It is important that @spirv_headers be called that exactly because @spirv_tools depends on it by that name. The hand-crafted cc_library rules for Dawn and Tint were produced by reading the appropriate GN files and using the parts necessary for a supporting Vulkan+Linux. If we use Dawn for other backends (e.g. WebGPU), we will need to expand the Bazel rules. One day, we might contribute the Bazel rules to Dawn and Tint so they can support them and avoid breaking us if new files are added. Suggested Review Order - bazel/common_config_settings/BUILD.bazel to see introduction of new select-able option "has_gpu_backend" which cleans up some of our code that is enabled for any GPU backend. - src/*/BUILD.bazel to see has_gpu_backend rolled out. - WORKSPACE.bazel to see DEPS declared there (using the files in third_party/externals, which are brought in via tools/git-sync-deps). - third_party/BUILD.bazel which adds Dawn and Tint rules. It may be helpful to look in third_party/externals for the Dawn [1] and Tint [2] GN files. Especially interesting are the Python scripts [3] Dawn uses to generate some header and source files. - All other files. [1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183 [2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174 [3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774 Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-21 17:06:32 +00:00
],
visibility = ["//visibility:private"], # only used by :dawn
deps = [
# Tint specifically depends on externals/spirv-tools/BUILD.gn:spirv_opt
"@spirv_tools//:spirv_tools_opt",
# Tint requires "include/spirv/unified1/spirv.hpp11", which is provided
# by this rule
"@spirv_headers//:spirv_cpp11_headers",
],
)
cc_library(
name = "vulkan_headers",
hdrs = [
"externals/vulkan-headers/include/vulkan/vk_platform.h",
"externals/vulkan-headers/include/vulkan/vulkan.h",
"externals/vulkan-headers/include/vulkan/vulkan_core.h",
],
visibility = ["//visibility:private"], # only used by :dawn
)