719239cd69
Change-Id: I238d29ba0250224fa593845ae65192653f58faff Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528156 Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
297 lines
8.1 KiB
Python
297 lines
8.1 KiB
Python
# https://github.com/bazelbuild/bazel-skylib
|
|
load("@bazel_skylib//lib:selects.bzl", "selects")
|
|
load("//bazel:macros.bzl", "generated_cc_atom")
|
|
|
|
selects.config_setting_group(
|
|
name = "dawn_unix",
|
|
match_all = [
|
|
"//bazel/common_config_settings:dawn_backend",
|
|
"@platforms//os:linux",
|
|
],
|
|
)
|
|
|
|
selects.config_setting_group(
|
|
name = "gl_unix",
|
|
match_all = [
|
|
"//bazel/common_config_settings:gl_backend",
|
|
"@platforms//os:linux",
|
|
],
|
|
)
|
|
|
|
selects.config_setting_group(
|
|
name = "vulkan_unix",
|
|
match_all = [
|
|
"//bazel/common_config_settings:vulkan_backend",
|
|
"@platforms//os:linux",
|
|
],
|
|
)
|
|
|
|
cc_library(
|
|
name = "sk_app",
|
|
linkopts = select({
|
|
"@platforms//os:linux": [
|
|
"-lX11",
|
|
"-lxcb", # dep of X11
|
|
"-lXau", # dep of xcb
|
|
"-lXdmcp", # dep of xcb
|
|
],
|
|
"//conditions:default": [],
|
|
}) + selects.with_or({
|
|
(":dawn_unix", ":vulkan_unix"): ["-lX11-xcb"],
|
|
"//conditions:default": [],
|
|
}),
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":Application_hdr",
|
|
":CommandSet_src",
|
|
":RasterWindowContext_hdr",
|
|
":WindowContext_src",
|
|
":Window_src",
|
|
] + select({
|
|
"@platforms//os:linux": [
|
|
"//tools/sk_app/unix:RasterWindowContext_unix_src",
|
|
"//tools/sk_app/unix:Window_unix_src",
|
|
"//tools/sk_app/unix:keysym2ucs_src",
|
|
"//tools/sk_app/unix:main_unix_src",
|
|
],
|
|
# TODO(kjlubick) add Windows/Mac support
|
|
}) + select({
|
|
"//bazel/common_config_settings:dawn_backend": [
|
|
":DawnWindowContext_src",
|
|
],
|
|
"//bazel/common_config_settings:gl_backend": [
|
|
":GLWindowContext_src",
|
|
],
|
|
"//bazel/common_config_settings:vulkan_backend": [
|
|
":VulkanWindowContext_src",
|
|
"//tools/gpu/vk:VkTestUtils_src",
|
|
],
|
|
}) + select({
|
|
":dawn_unix": ["//tools/sk_app/unix:DawnVulkanWindowContext_unix_src"],
|
|
":gl_unix": ["//tools/sk_app/unix:GLWindowContext_unix_src"],
|
|
":vulkan_unix": ["//tools/sk_app/unix:VulkanWindowContext_unix_src"],
|
|
}),
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "Application_hdr",
|
|
hdrs = ["Application.h"],
|
|
enforce_iwyu = True,
|
|
visibility = ["//:__subpackages__"],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "CommandSet_hdr",
|
|
hdrs = ["CommandSet.h"],
|
|
enforce_iwyu = True,
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
"//include/core:SkString_hdr",
|
|
"//include/core:SkTypes_hdr",
|
|
"//include/private:SkTArray_hdr",
|
|
"//tools/skui:InputState_hdr",
|
|
"//tools/skui:Key_hdr",
|
|
"//tools/skui:ModifierKey_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "CommandSet_src",
|
|
srcs = ["CommandSet.cpp"],
|
|
enforce_iwyu = True,
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":CommandSet_hdr",
|
|
":Window_hdr",
|
|
"//include/core:SkCanvas_hdr",
|
|
"//include/core:SkFontTypes_hdr",
|
|
"//include/core:SkFont_hdr",
|
|
"//include/core:SkPaint_hdr",
|
|
"//include/core:SkScalar_hdr",
|
|
"//src/core:SkStringUtils_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "DawnWindowContext_hdr",
|
|
hdrs = ["DawnWindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
"//include/core:SkRefCnt_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
"//third_party:dawn",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "DawnWindowContext_src",
|
|
srcs = ["DawnWindowContext.cpp"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":DawnWindowContext_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
"//include/gpu:GrBackendSurface_hdr",
|
|
"//include/gpu:GrDirectContext_hdr",
|
|
"//src/core:SkAutoMalloc_hdr",
|
|
"//third_party:dawn",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "DisplayParams_hdr",
|
|
hdrs = ["DisplayParams.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
"//include/core:SkColorSpace_hdr",
|
|
"//include/core:SkImageInfo_hdr",
|
|
"//include/core:SkSurfaceProps_hdr",
|
|
"//include/gpu:GrContextOptions_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "GLWindowContext_hdr",
|
|
hdrs = ["GLWindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
"//include/core:SkRefCnt_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
"//include/gpu/gl:GrGLInterface_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "GLWindowContext_src",
|
|
srcs = ["GLWindowContext.cpp"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":GLWindowContext_hdr",
|
|
"//include/core:SkCanvas_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
"//include/gpu:GrBackendSurface_hdr",
|
|
"//include/gpu:GrDirectContext_hdr",
|
|
"//src/core:SkMathPriv_hdr",
|
|
"//src/gpu/ganesh:GrCaps_hdr",
|
|
"//src/gpu/ganesh:GrDirectContextPriv_hdr",
|
|
"//src/gpu/ganesh/gl:GrGLDefines_impl_hdr",
|
|
"//src/gpu/ganesh/gl:GrGLUtil_hdr",
|
|
"//src/image:SkImage_Base_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "GraphiteMetalWindowContext_hdr",
|
|
hdrs = ["GraphiteMetalWindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
"//include/core:SkRefCnt_hdr",
|
|
"//include/ports:SkCFObject_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "MetalWindowContext_hdr",
|
|
hdrs = ["MetalWindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
"//include/core:SkRefCnt_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
"//include/ports:SkCFObject_hdr",
|
|
"//include/private:GrMtlTypesPriv_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "RasterWindowContext_hdr",
|
|
hdrs = ["RasterWindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [":WindowContext_hdr"],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "VulkanWindowContext_hdr",
|
|
hdrs = ["VulkanWindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
"//include/core:SkTypes_hdr",
|
|
"//include/gpu/vk:GrVkBackendContext_hdr",
|
|
"//include/gpu/vk:GrVkVulkan_hdr",
|
|
"//src/gpu/ganesh/vk:GrVkInterface_hdr",
|
|
"//tools/gpu/vk:VkTestUtils_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "VulkanWindowContext_src",
|
|
srcs = ["VulkanWindowContext.cpp"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":VulkanWindowContext_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
"//include/gpu:GrBackendSemaphore_hdr",
|
|
"//include/gpu:GrBackendSurface_hdr",
|
|
"//include/gpu:GrDirectContext_hdr",
|
|
"//include/gpu/vk:GrVkExtensions_hdr",
|
|
"//include/gpu/vk:GrVkTypes_hdr",
|
|
"//src/core:SkAutoMalloc_hdr",
|
|
"//src/gpu/ganesh/vk:GrVkImage_hdr",
|
|
"//src/gpu/ganesh/vk:GrVkUtil_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "WindowContext_hdr",
|
|
hdrs = ["WindowContext.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":DisplayParams_hdr",
|
|
"//include/core:SkRefCnt_hdr",
|
|
"//include/core:SkSurfaceProps_hdr",
|
|
"//include/gpu:GrTypes_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "WindowContext_src",
|
|
srcs = ["WindowContext.cpp"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
"//experimental/graphite/include:Context_hdr",
|
|
"//experimental/graphite/include:Recorder_hdr",
|
|
"//include/gpu:GrDirectContext_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "Window_hdr",
|
|
hdrs = ["Window.h"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":DisplayParams_hdr",
|
|
"//include/core:SkRect_hdr",
|
|
"//include/core:SkTypes_hdr",
|
|
"//include/private:SkTDArray_hdr",
|
|
"//tools/skui:InputState_hdr",
|
|
"//tools/skui:Key_hdr",
|
|
"//tools/skui:ModifierKey_hdr",
|
|
],
|
|
)
|
|
|
|
generated_cc_atom(
|
|
name = "Window_src",
|
|
srcs = ["Window.cpp"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
":WindowContext_hdr",
|
|
":Window_hdr",
|
|
"//include/core:SkCanvas_hdr",
|
|
"//include/core:SkSurface_hdr",
|
|
],
|
|
)
|