Skip to content

Commit 0013a6f

Browse files
committed
cmake: default to c99 on android
1 parent 7db3320 commit 0013a6f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ option(SONAME "Set the (SO)VERSION of the target"
5353
option(DEPRECATE_HARD "Do not include deprecated functions in the library" OFF)
5454

5555
# Compilation options
56+
# Default to c99 on Android Studio for compatibility; c90 everywhere else
57+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
58+
set(CMAKE_C_STANDARD "99" CACHE STRING "The C standard to compile against")
59+
else()
5660
set(CMAKE_C_STANDARD "90" CACHE STRING "The C standard to compile against")
61+
endif()
5762
option(CMAKE_C_EXTENSIONS "Whether compiler extensions are supported" OFF)
5863
option(ENABLE_WERROR "Enable compilation with -Werror" OFF)
5964

0 commit comments

Comments
 (0)