cmake: disable GNU extensions

This commit is contained in:
Sebastian Krzyszkowiak 2019-05-13 23:47:16 +02:00
parent 8c228aa9e0
commit b0bf4f13be
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

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