From a5fe10f70c18a2fb12275294bbf10115737f9576 Mon Sep 17 00:00:00 2001 From: dcnieho Date: Wed, 26 Feb 2020 16:29:10 +0000 Subject: [PATCH 1/2] set default FREEGLUT_GLES=ON on android (cherry picked from commit 0a464e7d6ede859c9f155a5f9fb8cf49fd258374) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1864 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/CMakeLists.txt b/freeglut/freeglut/CMakeLists.txt index 6f403af..d3d1d83 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/freeglut/freeglut/CMakeLists.txt @@ -51,7 +51,11 @@ ELSE() ENDIF() # OpenGL ES support -OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" OFF) +IF(ANDROID) + OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" ON) +ELSE() + OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" OFF) +ENDIF() # option to build either as "glut" (ON) or "freeglut" (OFF) IF(WIN32) From 578b0d795e82aede6da9874d1fb4c5f031c22528 Mon Sep 17 00:00:00 2001 From: dcnieho Date: Wed, 26 Feb 2020 16:29:18 +0000 Subject: [PATCH 2/2] Add checks for debug flags for android (cherry picked from commit e6baf9cee837345edc5063832c9025a6b1629a95) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1865 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/CMakeLists.txt b/freeglut/freeglut/CMakeLists.txt index d3d1d83..ec360e8 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/freeglut/freeglut/CMakeLists.txt @@ -352,6 +352,7 @@ ENDIF() INCLUDE(CheckFunctionExists) INCLUDE(CheckTypeSize) +INCLUDE(CheckCCompilerFlag) CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) @@ -470,7 +471,14 @@ ELSE() IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mandroid") ENDIF() - SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -gstabs+") + CHECK_C_COMPILER_FLAG(-O0 HAVE_O0_FLAG) + IF(HAVE_O0_FLAG) + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0") + ENDIF() + CHECK_C_COMPILER_FLAG(-gstabs+ HAVE_GSTABSP_FLAG) + IF(HAVE_gstabsp_FLAG) + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -gstabs+") + ENDIF() ENDIF() ENDIF() IF(FREEGLUT_BUILD_SHARED_LIBS)