skia2/example/BUILD.bazel
Jorge Betancourt c327d1054a reland "set up GL sample app to build through Bazel Mac toolchain"
https://skia-review.googlesource.com/c/skia/+/549897

G3 error fixed with:
https://critique.corp.google.com/cl/456234733

Introduces tracking bug:
https://bugs.chromium.org/p/skia/issues/detail?id=13452

Suggested review order.
1) tools/sk_app/* and src/gpu/ganesh/*
sets up the actual target to be built by the toolchain
2) toolchain/* and .bazelrc
changes to the mac hermetic toolchain, including support for framework dependencies, objc compilation, and dynamic lib dependency resolution

Change-Id: Id31e0adb134d385cbb4af6818f2c25c4fdae9598
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551881
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-06-21 19:22:16 +00:00

107 lines
2.8 KiB
Python

load("//bazel:macros.bzl", "exports_files_legacy")
load("//bazel:cc_binary_with_flags.bzl", "cc_binary_with_flags")
licenses(["notice"])
exports_files_legacy()
cc_binary_with_flags(
name = "hello_world_gl",
testonly = True,
srcs = [
"HelloWorld.cpp",
"HelloWorld.h",
],
# These flags are defined in //bazel/common_config_settings/BUILD.bazel
set_flags = {
# Use the GL backend with the normal GL standard (as opposed to WebGL or GLES)
"gpu_backend": [
"gl_backend",
],
"with_gl_standard": [
"gl_standard",
],
# Load fonts from the standard system directory (e.g. "/usr/share/fonts/")
# as defined in //src/ports/SkFontMgr_custom_directory_factory.cpp
"fontmgr_factory": [
"custom_directory_fontmgr_factory",
],
},
deps = [
"//:skia_public",
] + select({
"@platforms//os:macos": ["//tools/sk_app:sk_app_objc"],
"@platforms//os:linux": ["//tools/sk_app:sk_app"],
"//conditions:default": [],
}),
)
cc_binary_with_flags(
name = "hello_world_vulkan",
testonly = True,
srcs = [
"HelloWorld.cpp",
"HelloWorld.h",
],
# These flags are defined in //bazel/common_config_settings/BUILD.bazel
set_flags = {
"gpu_backend": [
"vulkan_backend",
],
# Load fonts from the standard system directory (e.g. "/usr/share/fonts/")
# as defined in //src/ports/SkFontMgr_custom_directory_factory.cpp
"fontmgr_factory": [
"custom_directory_fontmgr_factory",
],
},
deps = [
"//:skia_public",
"//tools/sk_app",
],
)
cc_binary_with_flags(
name = "hello_world_dawn",
testonly = True,
srcs = [
"HelloWorld.cpp",
"HelloWorld.h",
],
# These flags are defined in //bazel/common_config_settings/BUILD.bazel
set_flags = {
"gpu_backend": [
"dawn_backend",
],
# Load fonts from the standard system directory (e.g. "/usr/share/fonts/")
# as defined in //src/ports/SkFontMgr_custom_directory_factory.cpp
"fontmgr_factory": [
"custom_directory_fontmgr_factory",
],
},
deps = [
"//:skia_public",
"//tools/sk_app",
],
)
cc_binary_with_flags(
name = "vulkan_basic",
testonly = True,
srcs = [
"VulkanBasic.cpp",
],
# These flags are defined in //bazel/common_config_settings/BUILD.bazel
set_flags = {
"gpu_backend": [
"vulkan_backend",
],
},
deps = [
"//:skia_public",
"//include/third_party/vulkan",
# This DEPS is for the utility in the demo for creating a vulkan context.
# Outside clients would not need it.
"//tools/gpu/vk:testutils",
],
)