diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index d0e931e11..2bab4b3f6 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -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 =================== diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85d8b43fd..02c826e50 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 ===================