1+ load ("@fbcode//target_determinator/macros:ci.bzl" , "ci" )
12load ("@fbcode_macros//build_defs:native_rules.bzl" , "buck_genrule" )
23load ("@fbsource//xplat/executorch/build:runtime_wrapper.bzl" , "runtime" )
4+ load ("@fbsource//tools/build_defs:platform_defs.bzl" , "ANDROID" , "CXX" , "FBCODE" )
5+
36
47def get_vulkan_compiler_flags ():
58 return ["-Wno-missing-prototypes" , "-Wno-global-constructors" ]
@@ -43,12 +46,21 @@ def vulkan_spv_shader_lib(name, spv_filegroups, is_fbcode = False, no_volk = Fal
4346 )
4447
4548 suffix = "_no_volk" if no_volk else ""
49+ platforms = [ANDROID , CXX ]
50+ labels = []
51+ if no_volk :
52+ platforms = [ANDROID ]
53+ labels = ci .labels (ci .linux (ci .mode ("fbsource//arvr/mode/android/mac/dbg" )))
54+
55+
4656 runtime .cxx_library (
4757 name = name ,
4858 srcs = [
4959 ":{}[{}.cpp]" .format (genrule_name , name ),
5060 ],
5161 compiler_flags = get_vulkan_compiler_flags (),
62+ labels = labels ,
63+ platforms = platforms ,
5264 define_static_target = False ,
5365 # Static initialization is used to register shaders to the global shader registry,
5466 # therefore link_whole must be True to make sure unused symbols are not discarded.
@@ -91,8 +103,18 @@ def define_common_targets(is_fbcode = False):
91103 )
92104
93105 for no_volk in [True , False ]:
106+ # No volk not available for FBCode
107+ if no_volk and is_fbcode :
108+ continue
109+
94110 suffix = "_no_volk" if no_volk else ""
95111
112+ platforms = [ANDROID , CXX ]
113+ labels = []
114+ if no_volk :
115+ platforms = [ANDROID ]
116+ labels = ci .labels (ci .linux (ci .mode ("fbsource//arvr/mode/android/mac/dbg" )))
117+
96118 VK_API_PREPROCESSOR_FLAGS = []
97119 VK_API_DEPS = [
98120 "fbsource//third-party/VulkanMemoryAllocator/3.0.1:VulkanMemoryAllocator_xplat" ,
@@ -148,6 +170,8 @@ def define_common_targets(is_fbcode = False):
148170 "runtime/utils/**/*.h" ,
149171 "runtime/vk_api/**/*.h" ,
150172 ]),
173+ labels = labels ,
174+ platforms = platforms ,
151175 visibility = [
152176 "//executorch/backends/vulkan/..." ,
153177 "@EXECUTORCH_CLIENTS" ,
@@ -165,6 +189,8 @@ def define_common_targets(is_fbcode = False):
165189 exported_headers = native .glob ([
166190 "runtime/graph/**/*.h" ,
167191 ]),
192+ labels = labels ,
193+ platforms = platforms ,
168194 visibility = [
169195 "//executorch/backends/..." ,
170196 "//executorch/extension/pybindings/..." ,
@@ -202,6 +228,8 @@ def define_common_targets(is_fbcode = False):
202228 headers = native .glob ([
203229 "runtime/*.h" ,
204230 ]),
231+ labels = labels ,
232+ platforms = platforms ,
205233 visibility = [
206234 "//executorch/backends/..." ,
207235 "//executorch/extension/pybindings/..." ,
0 commit comments