Merge pull request #79 from Mizzrym1/ANDROID_CHECKS_FLAGS

Add checks for debug flags for android
This commit is contained in:
Diederick C. Niehorster 2020-02-26 17:20:49 +01:00 committed by GitHub
commit a23e1b6586
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)