diff --git a/runtime/platform/targets.bzl b/runtime/platform/targets.bzl index 42bb851e2cf..abb64b9bfd3 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") @@ -69,12 +70,7 @@ def define_common_targets(): "profiler.h", "runtime.h", ], - srcs = [ - "abort.cpp", - "log.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 d35ed0846ce..e44b124e133 100644 --- a/shim_et/xplat/executorch/build/build_variables.bzl +++ b/shim_et/xplat/executorch/build/build_variables.bzl @@ -39,6 +39,13 @@ PROGRAM_NO_PRIM_OPS_SRCS = [ "tensor_parser_exec_aten.cpp", ] +PLATFORM_SRCS = [ + "abort.cpp", + "log.cpp", + "profiler.cpp", + "runtime.cpp", +] + EXECUTORCH_CORE_SRCS = sorted([ "runtime/backend/interface.cpp", "runtime/core/evalue.cpp", @@ -49,13 +56,9 @@ EXECUTORCH_CORE_SRCS = sorted([ "runtime/core/tensor_layout.cpp", "runtime/executor/tensor_parser_portable.cpp", "runtime/kernel/operator_registry.cpp", - "runtime/platform/abort.cpp", "runtime/platform/default/posix.cpp", - "runtime/platform/log.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__empty_dim_order.cpp",