1*523fa7a6SAndroid Build Coastguard Workerload("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") 2*523fa7a6SAndroid Build Coastguard Worker 3*523fa7a6SAndroid Build Coastguard Workerdef define_common_targets(): 4*523fa7a6SAndroid Build Coastguard Worker """Defines targets that should be shared between fbcode and xplat. 5*523fa7a6SAndroid Build Coastguard Worker 6*523fa7a6SAndroid Build Coastguard Worker The directory containing this targets.bzl file should also contain both 7*523fa7a6SAndroid Build Coastguard Worker TARGETS and BUCK files that call this function. 8*523fa7a6SAndroid Build Coastguard Worker """ 9*523fa7a6SAndroid Build Coastguard Worker 10*523fa7a6SAndroid Build Coastguard Worker for aten_mode in (True, False): 11*523fa7a6SAndroid Build Coastguard Worker aten_suffix = ("_aten" if aten_mode else "") 12*523fa7a6SAndroid Build Coastguard Worker runtime.cxx_library( 13*523fa7a6SAndroid Build Coastguard Worker name = "interface" + aten_suffix, 14*523fa7a6SAndroid Build Coastguard Worker srcs = [ 15*523fa7a6SAndroid Build Coastguard Worker "interface.cpp", 16*523fa7a6SAndroid Build Coastguard Worker ], 17*523fa7a6SAndroid Build Coastguard Worker exported_headers = [ 18*523fa7a6SAndroid Build Coastguard Worker "backend_execution_context.h", 19*523fa7a6SAndroid Build Coastguard Worker "backend_init_context.h", 20*523fa7a6SAndroid Build Coastguard Worker "interface.h", 21*523fa7a6SAndroid Build Coastguard Worker ], 22*523fa7a6SAndroid Build Coastguard Worker preprocessor_flags = ["-DUSE_ATEN_LIB"] if aten_mode else [], 23*523fa7a6SAndroid Build Coastguard Worker visibility = [ 24*523fa7a6SAndroid Build Coastguard Worker "//executorch/...", 25*523fa7a6SAndroid Build Coastguard Worker "@EXECUTORCH_CLIENTS", 26*523fa7a6SAndroid Build Coastguard Worker ], 27*523fa7a6SAndroid Build Coastguard Worker exported_deps = [ 28*523fa7a6SAndroid Build Coastguard Worker "//executorch/runtime/core:core", 29*523fa7a6SAndroid Build Coastguard Worker "//executorch/runtime/core:evalue" + aten_suffix, 30*523fa7a6SAndroid Build Coastguard Worker "//executorch/runtime/core:event_tracer" + aten_suffix, 31*523fa7a6SAndroid Build Coastguard Worker "//executorch/runtime/core:memory_allocator", 32*523fa7a6SAndroid Build Coastguard Worker ], 33*523fa7a6SAndroid Build Coastguard Worker ) 34