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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-01-29 19:43:40 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-03-03 09:34:18 +0300
commita47bfe7d4083b75212d24efb43b7d07f2d696913 (patch)
tree0af397f164d56cfada5fd179da4bbfcadbcdf872 /CMakeLists.txt
parent1776ad53b9f7c27361b00bb606e927d0e75ba7e2 (diff)
Experimental option to build Blender with C11 support
It'll be nice to eventually go C11/C++11 by default, but for until then it's kinda handy to be able to build locally with C11 support, Reviewers: mont29, campbellbarton Reviewed By: mont29, campbellbarton Differential Revision: https://developer.blender.org/D1752
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 237f3612aa5..7a387be91c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -467,7 +467,9 @@ if(WIN32)
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
endif()
-# Experimental support of C++11
+# Experimental support of C11 and C++11
+option(WITH_C11 "Build with C11 standard enabled, for development use only!" OFF)
+mark_as_advanced(WITH_C11)
option(WITH_CPP11 "Build with C++11 standard enabled, for development use only!" OFF)
mark_as_advanced(WITH_CPP11)
@@ -2903,7 +2905,11 @@ endif()
# Visual Studio has all standards it supports available by default
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "Intel")
# Use C99 + GNU extensions, works with GCC, Clang, ICC
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+ if(WITH_C11)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
+ else()
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+ endif()
endif()
# Include warnings first, so its possible to disable them with user defined flags