Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenGL_ES support on GNU/Linux. #415

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(GLEW REQUIRED)
target_link_libraries(ImGui PUBLIC ${OPENGL_glx_LIBRARY} ${OPENGL_opengl_LIBRARY} GLEW::GLEW)
if (DEFINED USE_OPENGLES)
target_link_libraries(ImGui PUBLIC ${OPENGL_GLESv2_LIBRARY} GLEW::GLEW)
add_compile_definitions(IMGUI_IMPL_OPENGL_ES3)
else()
target_link_libraries(ImGui PUBLIC ${OPENGL_glx_LIBRARY} ${OPENGL_opengl_LIBRARY} GLEW::GLEW)
endif()
endif()

#=================== tinyxml2 ===================
Expand Down
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,13 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()

if (USE_OPENGLES)
find_library(OPENGLES_LIBRARY GLESv3)
target_link_libraries(libultraship PRIVATE GLESv3)
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
find_library(OPENGLES_LIBRARY GLESv3)
target_link_libraries(libultraship PRIVATE GLESv3)
else()
find_library(OPENGLES_LIBRARY GLESv2)
target_link_libraries(libultraship PRIVATE GLESv2)
endif()
endif()

#=================== Compile Options & Defs ===================
Expand Down
Loading