split platform cmake

This commit is contained in:
mat 2024-01-04 09:46:08 -03:00
parent 3187a07181
commit 9d4de1bf22
2 changed files with 20 additions and 19 deletions

View file

@ -1,22 +1,4 @@
if (NOT DEFINED GEODE_TARGET_PLATFORM)
if(APPLE)
if(IOS)
set(GEODE_TARGET_PLATFORM "iOS")
else()
set(GEODE_TARGET_PLATFORM "MacOS")
endif()
elseif(WIN32)
set(GEODE_TARGET_PLATFORM "Win32")
elseif(ANDROID)
if (ANDROID_ABI STREQUAL "arm64-v8a")
set(GEODE_TARGET_PLATFORM "Android64")
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
set(GEODE_TARGET_PLATFORM "Android32")
endif()
else()
message(FATAL_ERROR "Unable to detect platform, please set GEODE_TARGET_PLATFORM in the root CMake file.")
endif()
endif()
include(PlatformDetect.cmake)
if (NOT ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME})
set(GEODE_TARGET_PLATFORM GEODE_TARGET_PLATFORM PARENT_SCOPE)

View file

@ -0,0 +1,19 @@
if (NOT DEFINED GEODE_TARGET_PLATFORM)
if(APPLE)
if(IOS)
set(GEODE_TARGET_PLATFORM "iOS")
else()
set(GEODE_TARGET_PLATFORM "MacOS")
endif()
elseif(WIN32)
set(GEODE_TARGET_PLATFORM "Win32")
elseif(ANDROID)
if (ANDROID_ABI STREQUAL "arm64-v8a")
set(GEODE_TARGET_PLATFORM "Android64")
elseif(ANDROID_ABI STREQUAL "armeabi-v7a")
set(GEODE_TARGET_PLATFORM "Android32")
endif()
else()
message(FATAL_ERROR "Unable to detect platform, please set GEODE_TARGET_PLATFORM in the root CMake file.")
endif()
endif()