Skip to content

Commit

Permalink
Android build fix (pytorch#2753)
Browse files Browse the repository at this point in the history
Summary:
Should use selective build for optimized.

Pull Request resolved: pytorch#2753

Reviewed By: cccclai

Differential Revision: D55501322

Pulled By: kirklandsign

fbshipit-source-id: 242c94159a939811358114d161f082c77b818a70
  • Loading branch information
kirklandsign authored and facebook-github-bot committed Mar 29, 2024
1 parent 95b0daa commit cd7d5c3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions extension/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,18 @@ add_subdirectory(${EXECUTORCH_ROOT}/examples/third-party/fbjni
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../lib/cmake/ExecuTorch)
find_package(executorch CONFIG REQUIRED)
target_link_options_shared_lib(executorch)
target_link_options_shared_lib(portable_ops_lib)

set(link_libraries)
list(APPEND link_libraries extension_data_loader extension_module executorch
portable_ops_lib portable_kernels fbjni)
fbjni)

if(TARGET optimized_native_cpu_ops_lib)
list(APPEND link_libraries optimized_native_cpu_ops_lib optimized_kernels
cpublas eigen_blas)
portable_kernels cpublas eigen_blas)
target_link_options_shared_lib(optimized_native_cpu_ops_lib)
else()
list(APPEND link_libraries portable_ops_lib portable_kernels)
target_link_options_shared_lib(portable_ops_lib)
endif()
if(TARGET qnn_executorch_backend)
list(APPEND link_libraries qnn_executorch_backend)
Expand Down

0 comments on commit cd7d5c3

Please sign in to comment.