diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-03-11 15:46:06 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-03-11 16:42:46 +0300 |
commit | c4beb518de5382a23a2d1cd7b7688f24b5f36c4d (patch) | |
tree | 218abee1779c299f637a173cbb89ebb37685d94b /intern/cycles | |
parent | c8acb6dd6c58c6a85ab18d26f02973437cb2f700 (diff) |
Cycles: disable RTTI only for OSL files, other libraries like OpenVDB need it
This is a bit weak since it's not entirely clear where the boundary is, but
tested to build and pass tests on all platforms.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/CMakeLists.txt | 13 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/CMakeLists.txt | 3 | ||||
-rw-r--r-- | intern/cycles/render/CMakeLists.txt | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 1014831c403..6d4d2e38e82 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -177,14 +177,11 @@ if(CXX_HAS_AVX2) add_definitions(-DWITH_KERNEL_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}") +# 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() # Definitions and Includes diff --git a/intern/cycles/kernel/osl/CMakeLists.txt b/intern/cycles/kernel/osl/CMakeLists.txt index 5be5bd181ec..fc0c845fd4f 100644 --- a/intern/cycles/kernel/osl/CMakeLists.txt +++ b/intern/cycles/kernel/osl/CMakeLists.txt @@ -33,6 +33,9 @@ set(LIB ${LLVM_LIBRARY} ) +# OSL and LLVM are built without RTTI +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 2a077f486fa..6cde52bb89d 100644 --- a/intern/cycles/render/CMakeLists.txt +++ b/intern/cycles/render/CMakeLists.txt @@ -92,6 +92,8 @@ if(WITH_CYCLES_OSL) list(APPEND LIB cycles_kernel_osl ) + + SET_PROPERTY(SOURCE osl.cpp PROPERTY COMPILE_FLAGS ${RTTI_DISABLE_FLAGS}) endif() include_directories(${INC}) |