You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CMakeLists.txt
+47-5Lines changed: 47 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3,19 +3,27 @@ include(FetchContent)
3
3
# 2025-02-15: based on https://github.com/raysan5/raylib/blob/master/src/external/glfw/CMakeLists.txt, make sure the CMake version are between 3.4 and 3.28 or the whole raylib lib will face fatal errors
# 2025-02-15: based on @link: https://learn.microsoft.com/en-us/cpp/build/reference/o-options-optimize-code?view=msvc-170. MSVC only accept O2 and don't have O3 optimization flag
18
+
19
+
# MSVC-specific flags
16
20
if ( MSVC )
17
21
set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} /w")
18
-
set(CMAKE_CXX_FLAGS_RELEASE"-O2")
22
+
set(CMAKE_CXX_FLAGS_RELEASE"/O2")
23
+
# Enable security features but suppress CRT warnings
24
+
set(CMAKE_CXX_FLAGS"${CMAKE_CXX_FLAGS} /GS")
25
+
# Define _CRT_SECURE_NO_WARNINGS to suppress deprecated function warnings
26
+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
19
27
else()
20
28
set(CMAKE_CXX_FLAGS_RELEASE"-O3")
21
29
endif()
@@ -26,6 +34,13 @@ endif()
26
34
27
35
set(CMAKE_CXX_FLAGS_DEBUG"-g")
28
36
37
+
# Configure raylib platform settings
38
+
if(DEFINED PLATFORM AND PLATFORM STREQUAL"DRM")
39
+
set(PLATFORM_DRM ONCACHEBOOL""FORCE)
40
+
set(GRAPHICS_API_OPENGL_ES2 ONCACHEBOOL""FORCE)
41
+
message(STATUS"Building for DRM platform with OpenGL ES 2.0")
0 commit comments