patch [#33331] Time To Start Moving To Stdbool
[blender.git] / CMakeLists.txt
index 674e532ff2c8248cb8dd04d16d9a251c45b74b27..a87c3e2d96d08cae0ab609625aea94a81b5af823 100644 (file)
@@ -149,6 +149,9 @@ mark_as_advanced(WITH_HEADLESS)
 option(WITH_AUDASPACE    "Build with blenders audio library (only disable if you know what you're doing!)" ON)
 mark_as_advanced(WITH_AUDASPACE)
 
+option(WITH_BOOL_COMPAT "Continue defining \"TRUE\" and \"FALSE\" until these can be replaced with \"true\" and \"false\" from stdbool.h" ON)
+mark_as_advanced(WITH_BOOL_COMPAT)
+
 
 # (unix defaults to OpenMP On)
 if((UNIX AND NOT APPLE) OR (MINGW))
@@ -264,7 +267,6 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
 option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
 mark_as_advanced(WITH_ASSERT_ABORT)
 
-
 if(APPLE)
        cmake_minimum_required(VERSION 2.8.8)
        cmake_policy(VERSION 2.8.8)
@@ -423,6 +425,13 @@ endif()
 
 TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG)
 
+TEST_STDBOOL_SUPPORT()
+if(HAVE_STDBOOL_H)
+       add_definitions(-DHAVE_STDBOOL_H)
+endif()
+if(WITH_BOOL_COMPAT)
+       add_definitions(-DWITH_BOOL_COMPAT)
+endif()
 
 #-----------------------------------------------------------------------------
 # Check for valid directories
@@ -2137,3 +2146,8 @@ if(FIRST_RUN)
 
        message("${_config_msg}")
 endif()
+
+# debug
+message(
+    STATUS "HAVE_STDBOOL_H = ${HAVE_STDBOOL_H}"
+)