Add checks for debug flags for android

This commit is contained in:
Maciej Sroczyński 2020-02-15 19:05:49 +01:00
parent bbd69d646f
commit e6baf9cee8

View File

@ -348,6 +348,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)
@ -466,7 +467,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)