Added checks to fix compat with switch homebrew
Make file will need some changes
if PLATFORM=Switch(May need to change to Switch_HB)
Check if ENV:DEVKITPRO exists
// This is due to switch not liking miniaudio
Disable raudio.c
// Switch homebrew compiling does not like dynamic linking
compile as static
// The switch uses most of the code from the desktop platform core
// And has precompiler flags setup to block the code that breaks
// on switch
define both PLATFORM_SWITCH and PLATFORM_DESKTOP
// Make sure -lGL is not being assigned anywhere as devkitpro does
// not supply a direct OpenGL library
Use external GLFW3 from devkitpro
Add linking flags:
-lnx -lm -lpthread -lEGL -lglfw3 -ldrm_nouveau -lglapi
-lGLESv1_CM -lGLESv2 -lnxd -ldeko3dd -ldeko3d
endif
This commit is contained in:
parent
ce2e48af52
commit
81c8d7bf2e
1 changed files with 27 additions and 4 deletions
|
|
@ -45,6 +45,10 @@ endif()
|
|||
|
||||
add_definitions("-DRAYLIB_CMAKE=1")
|
||||
|
||||
if(${PLATFORM} MATCHES "Switch")
|
||||
set(USE_AUDIO FALSE)
|
||||
endif()
|
||||
|
||||
if(USE_AUDIO)
|
||||
MESSAGE(STATUS "Audio Backend: miniaudio")
|
||||
set(sources ${raylib_sources})
|
||||
|
|
@ -57,8 +61,13 @@ endif()
|
|||
|
||||
### Config options ###
|
||||
# Translate the config options to what raylib wants
|
||||
if(${PLATFORM} MATCHES "Desktop")
|
||||
set(PLATFORM_CPP "PLATFORM_DESKTOP")
|
||||
if(${PLATFORM} MATCHES "Desktop" OR ${PLATFORM} MATCHES "Switch")
|
||||
if (${PLATFORM} MATCHES "Desktop")
|
||||
set(PLATFORM_CPP "PLATFORM_DESKTOP")
|
||||
else()
|
||||
set(PLATFORM_CPP "PLATFORM_SWITCH")
|
||||
add_compile_definitions(PLATFORM_DESKTOP PLATFORM_SWITCH)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
# Need to force OpenGL 3.3 on OS X
|
||||
|
|
@ -119,7 +128,7 @@ elseif(${PLATFORM} MATCHES "Raspberry Pi")
|
|||
|
||||
endif()
|
||||
|
||||
if (${OPENGL_VERSION})
|
||||
if (OPENGL_VERSION)
|
||||
set(${SUGGESTED_GRAPHICS} "${GRAPHICS}")
|
||||
if (${OPENGL_VERSION} MATCHES "3.3")
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_33")
|
||||
|
|
@ -162,6 +171,10 @@ if(STATIC)
|
|||
if (${PLATFORM} MATCHES "Desktop")
|
||||
target_link_libraries(raylib_static glfw ${GLFW_LIBRARIES} ${LIBS_PRIVATE})
|
||||
endif()
|
||||
if (${PLATFORM} MATCHES "Switch")
|
||||
target_link_libraries(raylib_static glfw3 EGL drm_nouveau glapi GLESv1_CM GLESv2 nxd deko3dd deko3d nx m pthread)
|
||||
endif()
|
||||
|
||||
|
||||
if (WITH_PIC)
|
||||
set_property(TARGET raylib_static PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
|
|
|||
Loading…
Reference in a new issue