summaryrefslogtreecommitdiffhomepage
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorkernelkinetic <[email protected]>2020-09-27 10:18:43 +0200
committerGitHub <[email protected]>2020-09-27 10:18:43 +0200
commite90b4d8915d593ab57cedfe988da8fbbd18b4408 (patch)
treecb2822cbb3d08bad58da93d6049e8e2c797fba0e /src/CMakeLists.txt
parentc2e56f2604f2cbbce37561fe49be40fd884d23ad (diff)
downloadraylib-e90b4d8915d593ab57cedfe988da8fbbd18b4408.tar.gz
raylib-e90b4d8915d593ab57cedfe988da8fbbd18b4408.zip
Platform DRM (#1388)
* updated README.md * fixed CMakeLists.txt to allow building and debugging with Visual Studio Code and CMAKE Tools extension * added PLATFORM_DRM contains mouse pointer code from https://github.com/chriscamacho * removed redundant cleanup in InitGraphicsDevice * fixed DRM connector mode selection * added choosen DRM connected mode to log output * added respecting TargetFPS on DRM mode selection, default to 60 * added support for GetMonitorRefreshRate * changed SUPPORT_MOUSE_CURSOR_RPI to SUPPORT_MOUSE_CURSOR_NATIVE * changed avoidProgressive to allowInterlaced * cleanup, function extraction and improved mode selection * README reverted to original for PR * line endings fixed for core.c * removed old code * mouse pointer reverted to small square * replaced SetGraphicDeviceName() by DEFAULT_GRAPHIC_DEVICE_DRM Co-authored-by: kernelkinetic <[email protected]>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4cfc80f7..c8da0a21 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -127,6 +127,22 @@ elseif(${PLATFORM} MATCHES "Raspberry Pi")
link_directories(/opt/vc/lib)
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl)
+ elseif(${PLATFORM} MATCHES "DRM")
+ set(PLATFORM_CPP "PLATFORM_DRM")
+ set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
+
+ add_definitions(-D_DEFAULT_SOURCE)
+ add_definitions(-DEGL_NO_X11)
+ add_definitions(-DPLATFORM_DRM)
+
+ find_library(GLESV2 GLESv2)
+ find_library(EGL EGL)
+ find_library(DRM drm)
+ find_library(GBM gbm)
+
+ include_directories(/usr/include/libdrm)
+ set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} pthread m dl)
+
endif()
if (${OPENGL_VERSION})
@@ -164,7 +180,13 @@ if(STATIC)
target_compile_definitions(raylib_static
PUBLIC ${PLATFORM_CPP}
+ PUBLIC PLATFORM=${PLATFORM_CPP}
PUBLIC ${GRAPHICS}
+ PUBLIC GRAPHICS=${GRAPHICS}
+ )
+
+ target_link_libraries(raylib_static
+ PUBLIC ${LIBS_PRIVATE}
)
set(PKG_CONFIG_LIBS_PRIVATE ${__PKG_CONFIG_LIBS_PRIVATE} ${GLFW_PKG_LIBS})