Skip to content

Commit dceff55

Browse files
authored
Handle Android environments that identify as Linux (#1898)
* Handle Android environments that identify as Linux termux terminal emulator does this, causing build failures through missed defines in common.h
1 parent 6c7b691 commit dceff55

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmake/system_check.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ if (${HOST_OS} STREQUAL "WINDOWS")
1010
set(HOST_OS WINNT)
1111
endif ()
1212

13+
if (${HOST_OS} STREQUAL "LINUX")
14+
# check if we're building natively on Android (TERMUX)
15+
EXECUTE_PROCESS( COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM)
16+
if(${OPERATING_SYSTEM} MATCHES "Android")
17+
set(HOST_OS ANDROID)
18+
endif(${OPERATING_SYSTEM} MATCHES "Android")
19+
endif()
20+
21+
22+
1323
if(CMAKE_COMPILER_IS_GNUCC AND WIN32)
1424
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine
1525
OUTPUT_VARIABLE OPENBLAS_GCC_TARGET_MACHINE

0 commit comments

Comments
 (0)