cmake: nx toolchain has FindOpenGL module
This commit is contained in:
@ -3,19 +3,17 @@ include("${CMAKE_CURRENT_LIST_DIR}/librw-targets.cmake")
|
||||
set(LIBRW_PLATFORM "@LIBRW_PLATFORM@")
|
||||
set(LIBRW_PLATFORMS "@LIBRW_PLATFORMS@")
|
||||
set(LIBRW_PLATFORM_@LIBRW_PLATFORM@ ON)
|
||||
set(LIBRW_PLATFORM_GL3_REQUIRES_OPENGL @LIBRW_PLATFORM_GL3_REQUIRES_OPENGL@)
|
||||
|
||||
if(LIBRW_PLATFORM_GL3)
|
||||
set(LIBRW_GL3_GFXLIB "@LIBRW_GL3_GFXLIB@")
|
||||
set(LIBRW_GL3_GFXLIBS "@LIBRW_GL3_GFXLIBS@")
|
||||
|
||||
if(LIBRW_PLATFORM_GL3_REQUIRES_OPENGL)
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL REQUIRED)
|
||||
endif()
|
||||
if(NINTENDO_SWITCH)
|
||||
find_package(NXGL REQUIRED)
|
||||
set(OpenGL_GL_PREFERENCE GLVND)
|
||||
find_package(OpenGL)
|
||||
if(NOT TARGET TARGET OpenGL::OpenGL AND NOT TARGET OpenGL::EGL AND NOT TARGET OpenGL::GL)
|
||||
message(FATAL_ERROR )
|
||||
endif()
|
||||
|
||||
if(LIBRW_GL3_GFXLIB STREQUAL "GLFW")
|
||||
find_package(glfw3 REQUIRED)
|
||||
elseif(LIBRW_GL3_GFXLIB STREQUAL "SDL2")
|
||||
|
@ -1,38 +0,0 @@
|
||||
find_library(NXGL_EGL_LIBRARY EGL)
|
||||
find_library(NXGL_GLAPI_LIBRARY glapi)
|
||||
find_library(NXGL_DRM_NOUVEAU_LIBRARY drm_nouveau)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(NXGL
|
||||
REQUIRED_VARS NXGL_EGL_LIBRARY NXGL_GLAPI_LIBRARY NXGL_DRM_NOUVEAU_LIBRARY
|
||||
)
|
||||
|
||||
if(NXGL_FOUND)
|
||||
if(NOT TARGET NXGL::EGL)
|
||||
add_library(NXGL::EGL UNKNOWN IMPORTED)
|
||||
set_target_properties(NXGL::EGL PROPERTIES
|
||||
IMPORTED_LOCATION "${NXGL_EGL_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET NXGL::glapi)
|
||||
add_library(NXGL::glapi UNKNOWN IMPORTED)
|
||||
set_target_properties(NXGL::glapi PROPERTIES
|
||||
IMPORTED_LOCATION "${NXGL_GLAPI_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET NXGL::drm_nouveau)
|
||||
add_library(NXGL::drm_nouveau UNKNOWN IMPORTED)
|
||||
set_target_properties(NXGL::drm_nouveau PROPERTIES
|
||||
IMPORTED_LOCATION "${NXGL_DRM_NOUVEAU_LIBRARY}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET NXGL::OpenGL)
|
||||
add_library(NXGL::OpenGL INTERFACE IMPORTED)
|
||||
set_target_properties(NXGL::OpenGL PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "NXGL::EGL;NXGL::glapi;NXGL::drm_nouveau"
|
||||
)
|
||||
endif()
|
||||
endif()
|
Reference in New Issue
Block a user