46eaab3959
Ran the following commands: find -name "BUILD.bazel" -exec sed -i -e '1iload("//bazel:macros.bzl", "cc_library", "exports_files_legacy")\nexports_files_legacy()' {} + buildifier --lint=fix --mode=fix -r . This had the effect of making sure we can export all of our files in G3 (until we no longer have legacy targets) and making all of our cc_libraries shim-able. bazel/macros.bzl has the human-contributed changes, the rest were mechanical. Change-Id: I8e24e30e74b038cfd072cdbe4078bfd1d213dd46 Bug: skia:13211 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535359 Reviewed-by: Ben Wagner <bungeman@google.com>
299 lines
8.0 KiB
Python
299 lines
8.0 KiB
Python
load("//bazel:macros.bzl", "cc_library", "exports_files_legacy", "generated_cc_atom", "selects")
|
|
|
|
exports_files_legacy()
|
|
|
|
licenses(["notice"])
|
|
|
|
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/gpu/ganesh: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",
|
|
"//include/gpu:GrDirectContext_hdr",
|
|
"//include/gpu/graphite:Context_hdr",
|
|
"//include/gpu/graphite:Recorder_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",
|
|
],
|
|
)
|