Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions backends/qualcomm/runtime/targets.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,29 @@ def define_common_targets():
],
)

# Platform Abstraction Layer. The headers are included as <pal/...> (matching
# the CMake build's `include_directories(runtime/pal/include)`). They are
# exposed through a header map (dict `exported_headers` with an empty
# namespace) instead of an `-I` flag, so the short <pal/...> include resolves
# identically under both the fbcode (`cpp_library`) and xplat
# (`fb_xplat_cxx_library`) rules, which do not share an include-dir attribute.
# Kept in their own library so the mapping does not disturb the runtime
# target's namespaced <executorch/...> exported headers.
runtime.cxx_library(
name = "pal",
srcs = glob([
"pal/src/linux/*.cpp",
]),
exported_headers = {
"pal/DynamicLoading.h": "pal/include/pal/DynamicLoading.h",
"pal/Path.h": "pal/include/pal/Path.h",
},
header_namespace = "",
define_static_target = True,
platforms = [ANDROID],
visibility = ["PUBLIC"],
)

# "runtime" target is used for offline compile, can be renamed to runtime_aot_build as a BE.
for include_aot_qnn_lib in (True, False):
qnn_build_suffix = ("" if include_aot_qnn_lib else "_android_build")
Expand All @@ -43,8 +66,6 @@ def define_common_targets():
srcs = glob(
[
"*.cpp",
"pal/src/linux/DynamicLoading.cpp",
"pal/src/linux/Path.cpp",
"backends/*.cpp",
"backends/gpu/*.cpp",
"backends/htp/*.cpp",
Expand All @@ -60,8 +81,6 @@ def define_common_targets():
exported_headers = glob(
[
"*.h",
"pal/include/pal/DynamicLoading.h",
"pal/include/pal/Path.h",
"backends/*.h",
"backends/gpu/*.h",
"backends/htp/*.h",
Expand All @@ -70,9 +89,6 @@ def define_common_targets():
],
exclude = ["Logging.h"],
),
exported_preprocessor_flags = [
"-Ibackends/qualcomm/runtime/pal/include",
],
define_static_target = True,
link_whole = True, # needed for executorch/examples/models/llama:main to register QnnBackend
platforms = [ANDROID],
Expand All @@ -91,6 +107,7 @@ def define_common_targets():
"//executorch/extension/tensor:tensor",
],
exported_deps = [
":pal",
"//executorch/runtime/backend:interface",
"//executorch/runtime/core/exec_aten/util:scalar_type_util",
"//executorch/runtime/core:event_tracer",
Expand Down
Loading