| load("//bazel:macros.bzl", "bool_flag", "exports_files_legacy", "selects", "skia_cc_deps", "skia_filegroup", "split_srcs_and_hdrs") |
| |
| licenses(["notice"]) |
| |
| exports_files_legacy() |
| |
| skia_filegroup( |
| name = "txts", |
| srcs = [ |
| "generated/sksl_compute.minified.sksl", |
| "generated/sksl_compute.unoptimized.sksl", |
| "generated/sksl_frag.minified.sksl", |
| "generated/sksl_frag.unoptimized.sksl", |
| "generated/sksl_gpu.minified.sksl", |
| "generated/sksl_gpu.unoptimized.sksl", |
| "generated/sksl_graphite_frag.minified.sksl", |
| "generated/sksl_graphite_frag.unoptimized.sksl", |
| "generated/sksl_graphite_vert.minified.sksl", |
| "generated/sksl_graphite_vert.unoptimized.sksl", |
| "generated/sksl_public.minified.sksl", |
| "generated/sksl_public.unoptimized.sksl", |
| "generated/sksl_rt_shader.minified.sksl", |
| "generated/sksl_rt_shader.unoptimized.sksl", |
| "generated/sksl_shared.minified.sksl", |
| "generated/sksl_shared.unoptimized.sksl", |
| "generated/sksl_vert.minified.sksl", |
| "generated/sksl_vert.unoptimized.sksl", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "sksl_srcs", |
| srcs = [ |
| "sksl_compute.sksl", |
| "sksl_frag.sksl", |
| "sksl_gpu.sksl", |
| "sksl_graphite_frag.sksl", |
| "sksl_graphite_vert.sksl", |
| "sksl_public.sksl", |
| "sksl_rt_shader.sksl", |
| "sksl_shared.sksl", |
| "sksl_vert.sksl", |
| ], |
| visibility = ["//tools/sksl-minify:__pkg__"], |
| ) |
| |
| CORE_SRCS = [ |
| "SkSLAnalysis.cpp", |
| "SkSLAnalysis.h", |
| "SkSLBuiltinTypes.cpp", |
| "SkSLBuiltinTypes.h", |
| "SkSLCompiler.cpp", |
| "SkSLCompiler.h", |
| "SkSLConstantFolder.cpp", |
| "SkSLConstantFolder.h", |
| "SkSLContext.cpp", |
| "SkSLContext.h", |
| "SkSLErrorReporter.cpp", |
| "SkSLFileOutputStream.h", |
| "SkSLGLSL.h", |
| "SkSLInliner.cpp", |
| "SkSLInliner.h", |
| "SkSLIntrinsicList.cpp", |
| "SkSLIntrinsicList.h", |
| "SkSLLexer.cpp", |
| "SkSLLexer.h", |
| "SkSLMangler.cpp", |
| "SkSLMangler.h", |
| "SkSLMemoryLayout.h", |
| "SkSLMemoryPool.h", |
| "SkSLModifiersPool.h", |
| "SkSLModuleLoader.cpp", |
| "SkSLModuleLoader.h", |
| "SkSLOperator.cpp", |
| "SkSLOutputStream.cpp", |
| "SkSLOutputStream.h", |
| "SkSLParser.cpp", |
| "SkSLParser.h", |
| "SkSLPool.cpp", |
| "SkSLPool.h", |
| "SkSLPosition.cpp", |
| "SkSLProgramSettings.h", |
| "SkSLSampleUsage.cpp", |
| "SkSLString.cpp", |
| "SkSLStringStream.h", |
| "SkSLThreadContext.cpp", |
| "SkSLThreadContext.h", |
| "SkSLUtil.cpp", |
| "SkSLUtil.h", |
| "spirv.h", |
| ] |
| |
| split_srcs_and_hdrs( |
| name = "core", |
| files = CORE_SRCS, |
| ) |
| |
| skia_filegroup( |
| name = "gpu_hdrs", |
| srcs = [ |
| "GLSL.std.450.h", |
| ], |
| ) |
| |
| selects.config_setting_group( |
| name = "needs_sksl", |
| match_any = [ |
| "//src/gpu:has_gpu_backend", |
| ":enable_sksl_true", |
| ], |
| visibility = ["//:__subpackages__"], |
| ) |
| |
| selects.config_setting_group( |
| name = "use_sksl_gpu_srcs", |
| match_any = [ |
| "//src/gpu:has_gpu_backend", |
| ":enable_skslc_true", |
| ], |
| visibility = ["//:__subpackages__"], |
| ) |
| |
| bool_flag( |
| name = "enable_sksl", |
| default = False, |
| ) |
| |
| bool_flag( |
| name = "enable_skslc", |
| default = False, |
| ) |
| |
| bool_flag( |
| name = "enable_sksl_tracing", |
| default = False, |
| ) |
| |
| skia_filegroup( |
| name = "srcs", |
| srcs = [ |
| ":core_srcs", |
| "//src/sksl/analysis:srcs", |
| "//src/sksl/codegen:srcs", |
| "//src/sksl/dsl:srcs", |
| "//src/sksl/ir:srcs", |
| "//src/sksl/tracing:srcs", |
| "//src/sksl/transform:srcs", |
| ], |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "private_hdrs", |
| srcs = [ |
| ":core_hdrs", |
| "//src/sksl/analysis:private_hdrs", |
| "//src/sksl/codegen:private_hdrs", |
| "//src/sksl/dsl:private_hdrs", |
| "//src/sksl/ir:private_hdrs", |
| "//src/sksl/tracing:private_hdrs", |
| "//src/sksl/transform:private_hdrs", |
| ] + select({ |
| ":use_sksl_gpu_srcs": [":gpu_hdrs"], |
| "//conditions:default": [], |
| }), |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_cc_deps( |
| name = "deps", |
| textual_hdrs = [ |
| ":txts", |
| ], |
| visibility = ["//src:__pkg__"], |
| deps = [ |
| "//src/sksl/codegen:deps", |
| ] + select({ |
| "//src/sksl:enable_skslc_true": [ |
| "@spirv_tools", |
| "@dawn//:tint", |
| "//tools:get_executable_path", |
| ], |
| "//conditions:default": [], |
| }), |
| ) |