[Bf-blender-cvs] [15e224dca3f] master: Build: disable RTTI for the entire Cycles module, not only the kernel

Brecht Van Lommel noreply at git.blender.org
Fri Aug 2 19:04:14 CEST 2019


Commit: 15e224dca3f6b7d77b2503edd2764399bce1e79d
Author: Brecht Van Lommel
Date:   Fri Aug 2 17:07:44 2019 +0200
Branches: master
https://developer.blender.org/rB15e224dca3f6b7d77b2503edd2764399bce1e79d

Build: disable RTTI for the entire Cycles module, not only the kernel

The partial disabling was causing issues with Clang and ASAN, and it seems we
don't need to restrict it to the kernel anymore now that we are no longer using
boost directly.

===================================================================

M	intern/cycles/CMakeLists.txt
M	intern/cycles/kernel/osl/CMakeLists.txt
M	intern/cycles/render/CMakeLists.txt

===================================================================

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index 87f88f7ed34..6a3ebd85378 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -178,11 +178,13 @@ if(CXX_HAS_AVX2)
 endif()
 
 if(WITH_CYCLES_OSL)
+  # LLVM and OSL need to build without RTTI
   if(WIN32 AND MSVC)
     set(RTTI_DISABLE_FLAGS "/GR- -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
   elseif(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
     set(RTTI_DISABLE_FLAGS "-fno-rtti -DBOOST_NO_RTTI -DBOOST_NO_TYPEID")
   endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
 endif()
 
 # Definitions and Includes
diff --git a/intern/cycles/kernel/osl/CMakeLists.txt b/intern/cycles/kernel/osl/CMakeLists.txt
index 28d9ca854db..35cca2da8ad 100644
--- a/intern/cycles/kernel/osl/CMakeLists.txt
+++ b/intern/cycles/kernel/osl/CMakeLists.txt
@@ -29,8 +29,6 @@ set(LIB
   cycles_render
 )
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
-
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
 
diff --git a/intern/cycles/render/CMakeLists.txt b/intern/cycles/render/CMakeLists.txt
index c79e5a23ea1..53196b013f6 100644
--- a/intern/cycles/render/CMakeLists.txt
+++ b/intern/cycles/render/CMakeLists.txt
@@ -85,8 +85,6 @@ if(WITH_CYCLES_OSL)
   )
 endif()
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${RTTI_DISABLE_FLAGS}")
-
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})



More information about the Bf-blender-cvs mailing list