diff --git a/runtime/platform/targets.bzl b/runtime/platform/targets.bzl index eecac8ae5db..457deed531e 100644 --- a/runtime/platform/targets.bzl +++ b/runtime/platform/targets.bzl @@ -1,3 +1,4 @@ +load("@fbsource//xplat/executorch/build:build_variables.bzl", "PLATFORM_SRCS") load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") load(":log.bzl", "get_et_logging_flags") @@ -73,13 +74,7 @@ def define_common_targets(): "runtime.h", "compat_unistd.h", ], - srcs = [ - "abort.cpp", - "log.cpp", - "platform.cpp", - "profiler.cpp", - "runtime.cpp", - ], + srcs = PLATFORM_SRCS, exported_preprocessor_flags = get_profiling_flags() + get_et_logging_flags(), exported_deps = [ "//executorch/runtime/platform:pal_interface", diff --git a/shim_et/xplat/executorch/build/build_variables.bzl b/shim_et/xplat/executorch/build/build_variables.bzl index a511beccfc4..4bd6c83c289 100644 --- a/shim_et/xplat/executorch/build/build_variables.bzl +++ b/shim_et/xplat/executorch/build/build_variables.bzl @@ -39,6 +39,14 @@ PROGRAM_NO_PRIM_OPS_SRCS = [ "tensor_parser_exec_aten.cpp", ] +PLATFORM_SRCS = [ + "abort.cpp", + "log.cpp", + "platform.cpp", + "profiler.cpp", + "runtime.cpp", +] + EXECUTORCH_CORE_SRCS = sorted([ "runtime/backend/interface.cpp", "runtime/core/evalue.cpp", @@ -50,13 +58,8 @@ EXECUTORCH_CORE_SRCS = sorted([ "runtime/executor/tensor_parser_portable.cpp", "runtime/executor/pte_data_map.cpp", "runtime/kernel/operator_registry.cpp", - "runtime/platform/abort.cpp", - "runtime/platform/log.cpp", - "runtime/platform/platform.cpp", - "runtime/platform/profiler.cpp", - "runtime/platform/runtime.cpp", "schema/extended_header.cpp", -] + ["runtime/executor/" + x for x in PROGRAM_NO_PRIM_OPS_SRCS]) +] + ["runtime/executor/" + x for x in PROGRAM_NO_PRIM_OPS_SRCS] + ["runtime/platform/" + x for x in PLATFORM_SRCS]) PORTABLE_KERNELS_SRCS = [ "kernels/portable/cpu/op__clone_dim_order.cpp",