From 36c90d8d0257ed1e078f64708d6fb2408361ca5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Maciej=20Sroczy=C5=84ski?= Date: Wed, 26 Feb 2020 16:29:18 +0000 Subject: [PATCH] Add checks for debug flags for android (cherry picked from commit e6baf9cee837345edc5063832c9025a6b1629a95) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1865 7f0cb862-5218-0410-a997-914c9d46530a --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3d1d83..ec360e8 100644 --- a/CMakeLists.txt +++ b/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) -- 1.7.10.4