mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 16:53:40 +01:00
CMake: Fix UBSAN link error
This commit is contained in:
1 parent
0fb42e07a6
commit
08dbec532a
1 file changed
+8
@@ -283,6 +283,14 @@ if(NOT MSVC)
|
||||
message("Undefined behaviour sanitizer enabled (DEBUG only)")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined")
|
||||
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=undefined")
|
||||
|
||||
# UBSAN is a collection of sanitizers, including vtpr, which reqiuires RTTI.
|
||||
# ext/glslang disables RTTI by default using the `ENABLE_RTTI` option.
|
||||
# If RTTI is disabled, we must also disable the vtpr sanitizer.
|
||||
if(NOT ENABLE_RTTI)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
|
||||
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-sanitize=vptr")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -D_DEBUG")
|
||||
|
||||
Reference in new issue
Block a user