Skip to content

Commit 0de1c01

Browse files
authored
Enable ABSL_FLAGS flag registration for onnxruntime_perf_test for mobile build (microsoft#25849)
### Description `ABSL_FLAGS_STRIP_NAMES `is set to 1 by default to disable flag registration when building for Android, iPhone, and "embedded devices". So, running onnxruntime_perf_test on Android will see that flags are not registered. <img width="872" height="182" alt="image (2)" src="https://github.com/user-attachments/assets/eb6a6772-cdff-4d60-a3c7-4352477e956c" /> Set `ABSL_FLAGS_STRIP_NAMES ` to 0 by default for all builds.
1 parent db4b0f4 commit 0de1c01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmake/onnxruntime_unittests.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,12 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
12321232
${onnxruntime_perf_test_src_patterns}
12331233
)
12341234
onnxruntime_add_executable(onnxruntime_perf_test ${onnxruntime_perf_test_src} ${ONNXRUNTIME_ROOT}/core/platform/path_lib.cc)
1235+
1236+
# ABSL_FLAGS_STRIP_NAMES is set to 1 by default to disable flag registration when building for Android, iPhone, and "embedded devices".
1237+
# See the issue: https://github.com/abseil/abseil-cpp/issues/1875
1238+
# We set it to 0 for all builds to be able to use ABSL flags for onnxruntime_perf_test.
1239+
target_compile_definitions(onnxruntime_perf_test PRIVATE ABSL_FLAGS_STRIP_NAMES=0)
1240+
12351241
if(MSVC)
12361242
target_compile_options(onnxruntime_perf_test PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--compiler-options /utf-8>"
12371243
"$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:/utf-8>")

0 commit comments

Comments
 (0)