Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-04-28 11:37:28 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-28 11:59:52 +0300
commiteee666583fe0d863a9243d0a650a5d1b63d010b2 (patch)
tree89890794c9dcec6c393e66a04fe0258b4bd11b4b
parent2edb342ffad63aa6ff37b852a0d40366254639ff (diff)
Use gnu89 for GCC
GCC5 defaults to gnu11, which we may switch to later but disable for now to prevent accidental use.
-rw-r--r--CMakeLists.txt6
-rw-r--r--build_files/scons/config/linux-config.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bdaefb0d590..4724e101603 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1156,6 +1156,12 @@ if(UNIX AND NOT APPLE)
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
+
+ if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "5.0")
+ # GCC5 uses gnu11, until we update, force c89
+ # though some c11 features can still be used.
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89")
+ endif()
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
diff --git a/build_files/scons/config/linux-config.py b/build_files/scons/config/linux-config.py
index 455dd23cdb3..c3f0c434081 100644
--- a/build_files/scons/config/linux-config.py
+++ b/build_files/scons/config/linux-config.py
@@ -230,7 +230,7 @@ WITH_BF_FREESTYLE = True
CC = 'gcc'
CXX = 'g++'
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-std=gnu89', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
CXXFLAGS = []
CPPFLAGS = []