Skip to content

Commit e4718c5

Browse files
committed
[Executorch][llama] Split main in lib + binary
Pull Request resolved: #15919 Main reason to do so is to allow internal benchmarking binary to link against main_lib Differential Revision: [D87547090](https://our.internmc.facebook.com/intern/diff/D87547090/) ghstack-source-id: 325659293
1 parent 3f92668 commit e4718c5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

examples/models/llama/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ DEFINE_string(
7272
"etdump.in",
7373
"If an etdump path is provided, generate an ETDump file at the specified path for profiling purposes.");
7474

75+
std::vector<std::string> parseStringList(const std::string& input);
76+
7577
// Helper function to parse comma-separated string lists
7678
std::vector<std::string> parseStringList(const std::string& input) {
7779
std::vector<std::string> result;

examples/models/llama/targets.bzl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ def define_common_targets():
55
if not runtime.is_oss or not aten:
66
aten_suffix = "_aten" if aten else ""
77

8-
runtime.cxx_binary(
9-
name = "main" + aten_suffix,
8+
runtime.cxx_library(
9+
name = "main_lib" + aten_suffix,
1010
srcs = [
1111
"main.cpp",
1212
],
@@ -26,3 +26,11 @@ def define_common_targets():
2626
],
2727
**get_oss_build_kwargs()
2828
)
29+
30+
runtime.cxx_binary(
31+
name = "main" + aten_suffix,
32+
srcs = [],
33+
deps = [
34+
":main_lib" + aten_suffix,
35+
],
36+
)

0 commit comments

Comments
 (0)