blob: de9e3a3fdffd8a239e0f74cf9daca60ff18ab416 [file] [log] [blame]
load("//bazel:macros.bzl", "cc_library", "exports_files_legacy", "selects", "split_srcs_and_hdrs")
licenses(["notice"])
exports_files_legacy()
filegroup(
name = "txts",
srcs = [
"generated/sksl_compute.dehydrated.sksl",
"generated/sksl_frag.dehydrated.sksl",
"generated/sksl_gpu.dehydrated.sksl",
"generated/sksl_graphite_frag.dehydrated.sksl",
"generated/sksl_graphite_vert.dehydrated.sksl",
"generated/sksl_public.dehydrated.sksl",
"generated/sksl_rt_shader.dehydrated.sksl",
"generated/sksl_vert.dehydrated.sksl",
],
visibility = ["//:__subpackages__"],
)
CORE_SRCS = [
"SkSLAnalysis.cpp",
"SkSLAnalysis.h",
"SkSLBuiltinMap.cpp",
"SkSLBuiltinMap.h",
"SkSLBuiltinTypes.cpp",
"SkSLBuiltinTypes.h",
"SkSLCompiler.cpp",
"SkSLCompiler.h",
"SkSLConstantFolder.cpp",
"SkSLConstantFolder.h",
"SkSLContext.cpp",
"SkSLContext.h",
"SkSLDSLParser.cpp",
"SkSLDSLParser.h",
"SkSLDehydrator.cpp",
"SkSLDehydrator.h",
"SkSLErrorReporter.cpp",
"SkSLFileOutputStream.h",
"SkSLGLSL.h",
"SkSLInliner.cpp",
"SkSLInliner.h",
"SkSLIntrinsicList.h",
"SkSLLexer.cpp",
"SkSLLexer.h",
"SkSLMangler.cpp",
"SkSLMangler.h",
"SkSLMemoryLayout.h",
"SkSLMemoryPool.h",
"SkSLModifiersPool.h",
"SkSLOperator.cpp",
"SkSLOutputStream.cpp",
"SkSLOutputStream.h",
"SkSLParsedModule.h",
"SkSLPool.cpp",
"SkSLPool.h",
"SkSLPosition.cpp",
"SkSLProgramSettings.h",
"SkSLRehydrator.cpp",
"SkSLRehydrator.h",
"SkSLSampleUsage.cpp",
"SkSLSharedCompiler.cpp",
"SkSLSharedCompiler.h",
"SkSLString.cpp",
"SkSLStringStream.h",
"SkSLThreadContext.cpp",
"SkSLThreadContext.h",
"SkSLUtil.cpp",
"SkSLUtil.h",
"spirv.h",
]
split_srcs_and_hdrs(
name = "core",
files = CORE_SRCS,
)
selects.config_setting_group(
name = "use_sksl_gpu_srcs",
match_any = [
"//bazel/common_config_settings:has_gpu_backend",
"//bazel/common_config_settings:enable_skslc_true",
],
)
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__"],
)
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": [
"GLSL.std.450.h",
],
"//conditions:default": [],
}),
visibility = ["//src:__pkg__"],
)
cc_library(
name = "deps",
textual_hdrs = [
":txts",
],
visibility = ["//src:__pkg__"],
deps = [
"//src/sksl/codegen:deps",
] + select({
"//bazel/common_config_settings:enable_skslc_true": [
"@spirv_tools",
"@dawn//:tint",
],
"//conditions:default": [],
}),
)