cmake: set -std=gnu99 when the compiler default is C90

Fixes compilation on the Pocket C.H.I.P
This commit is contained in:
Sebastian Krzyszkowiak 2019-05-12 22:35:51 +02:00
parent 5b8df3c180
commit 8c228aa9e0
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -47,9 +47,9 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
endif (LIBSUPERDERPY_IMGUI)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED true)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 98)
set(CMAKE_CXX_STANDARD_REQUIRED true)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# TODO: add -fvisibility=hidden, but only to libsuperderpy target
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -ffast-math")
@ -65,10 +65,9 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage")
endif()
if(MAEMO5)
if(CMAKE_C_STANDARD_COMPUTED_DEFAULT EQUAL 90)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
endif(MAEMO5)
endif(CMAKE_C_STANDARD_COMPUTED_DEFAULT EQUAL 90)
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mwindows -municode")