Skip to content

Commit

Permalink
Android NDK compile patch (marian-nmt#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerinphilip authored May 3, 2023
1 parent 3ffdc00 commit 60c17dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ find_package(Threads REQUIRED)

set(SPM_LIBS ${PROTOBUF_LITE_LIBRARY} Threads::Threads)

if(ANDROID)
# SentencePiece throws compilation errors when attempted to compile for ARM
# via android ndk, about missing libraries of android and log. Solution
# adapted from OpenCV.
# - https://github.com/opencv/opencv/issues/17282
# - https://github.com/opencv/opencv/pull/19049
set(SPM_LIBS ${SPM_LIBS} android log)
endif(ANDROID)


if (SPM_ENABLE_NFKC_COMPILE)
find_package(ICU 4.4 COMPONENTS i18n data uc REQUIRED)
include_directories(${ICU_INCLUDE_DIRS})
Expand Down

0 comments on commit 60c17dd

Please sign in to comment.