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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-04-23 21:59:10 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-04-23 22:00:40 +0300
commitec57ff28005469c5985037e3bf9122762d354d2b (patch)
tree8c88abee4a7d53b85700b40e6483f242aee6f42b /CMakeLists.txt
parent148c0aa0faa66b44ad26f2c4703d59e9a133ff71 (diff)
Fix building with asan option and OSL.
When OSL is enabled, Cycles disables RTTI in some of its modules, which then breaks vptr sanitizer (part of the 'undefined' sanitizer). thanks to @brecht for helping tracking down the issue.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 052222b36b4..1cb20142281 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -811,6 +811,12 @@ if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
+ if(WITH_CYCLES_OSL)
+ # With OSL, Cycles disables rtti in some modules, wich then breaks at linking
+ # when trying to use vptr sanitizer (included into 'undefined' general option).
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr")
+ endif()
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()