mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
split platform cmake
This commit is contained in:
parent
3187a07181
commit
9d4de1bf22
2 changed files with 20 additions and 19 deletions
|
@ -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)
|
||||
|
|
19
cmake/PlatformDetect.cmake
Normal file
19
cmake/PlatformDetect.cmake
Normal 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()
|
Loading…
Reference in a new issue