Build: fix Android is incorrectly detected as Linux

This commit is contained in:
李通洲
2022-11-25 19:17:37 +08:00
parent c57417e834
commit 34d3021b80
+4 -3
View File
@@ -12,12 +12,13 @@ set(PROJECT_LICENSE "MIT license")
###################
# Target Platform #
###################
if("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Ll]inux.*")
if(ANDROID)
set(LINUX FALSE)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Ll]inux.*")
set(LINUX TRUE CACHE BOOL "..." FORCE) # LINUX means GNU/Linux, not just the kernel
elseif("${CMAKE_SYSTEM_NAME}" MATCHES ".*[Bb][Ss][Dd].*")
set(BSD TRUE CACHE BOOL "..." FORCE)
elseif(NOT APPLE AND NOT ANDROID AND NOT WIN32)
elseif(NOT APPLE AND NOT WIN32)
message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()