From 9381ac2748ff972faeb745ae26ea1465da15ac03 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Tue, 5 Dec 2017 13:02:48 +0100 Subject: [PATCH] Explicitly link against libm on Android with cmake as well Patch from #1384 --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c52b2501..1bdcd52ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,6 +151,11 @@ endif() # add objects to the openblas lib add_library(${OpenBLAS_LIBNAME} ${LA_SOURCES} ${LAPACKE_SOURCES} ${RELA_SOURCES} ${TARGET_OBJS} ${OpenBLAS_DEF_FILE}) +# Android needs to explicitly link against libm +if(ANDROID) + target_link_libraries(${OpenBLAS_LIBNAME} m) +endif() + # Handle MSVC exports if(MSVC AND BUILD_SHARED_LIBS) if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 3.4)