handle custom platform

removed unecessary section

removed external
This commit is contained in:
Yan Pujante 2023-12-01 11:24:37 -08:00
commit 0cc7828d97
3 changed files with 48 additions and 10 deletions

View file

@ -11,7 +11,7 @@ endif()
# This helps support the case where emsdk toolchain file is used
# either by setting it with -DCMAKE_TOOLCHAIN_FILE=<path_to_emsdk>/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
# or by using "emcmake cmake -B build -S ." as described in https://emscripten.org/docs/compiling/Building-Projects.html
if(EMSCRIPTEN)
if(EMSCRIPTEN AND NOT ${PLATFORM} MATCHES "Custom")
SET(PLATFORM Web CACHE STRING "Forcing PLATFORM_WEB because EMSCRIPTEN was detected")
endif()

View file

@ -0,0 +1,9 @@
macro(custom_platform_include_if_exists file)
if("${PLATFORM}" MATCHES "Custom")
if (EXISTS "${PLATFORM_CUSTOM_ROOT_DIR}/cmake/${file}.cmake")
include("${PLATFORM_CUSTOM_ROOT_DIR}/cmake/${file}.cmake")
else ()
message(STATUS "No file ${PLATFORM_CUSTOM_ROOT_DIR}/cmake/${file}.cmake detected... skipped")
endif ()
endif()
endmacro()

View file

@ -91,6 +91,8 @@ elseif ("${PLATFORM}" MATCHES "DRM")
endif ()
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread m dl)
elseif ("${PLATFORM}" MATCHES "Custom")
set(PLATFORM_CPP "PLATFORM_CUSTOM")
endif ()
if (NOT ${OPENGL_VERSION} MATCHES "OFF")