CMake: add ENABLE_RTTI option (#4382)
Fixes $ CXX=clang++ cmake -H. -Bout -DSPIRV_USE_SANITIZER=vptr $ make -C out ... clang: error: invalid argument '-fsanitize=vptr' not allowed with '-fno-rtti'
This commit is contained in:
Родитель
8966cc2b27
Коммит
3a68a72740
|
@ -33,6 +33,7 @@ include(GNUInstallDirs)
|
|||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
option(ENABLE_RTTI "Enables RTTI" OFF)
|
||||
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
|
||||
|
||||
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
|
@ -178,11 +179,14 @@ function(spvtools_default_compile_options TARGET)
|
|||
target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS})
|
||||
|
||||
if (${COMPILER_IS_LIKE_GNU})
|
||||
target_compile_options(${TARGET} PRIVATE
|
||||
-std=c++11 -fno-exceptions -fno-rtti)
|
||||
target_compile_options(${TARGET} PRIVATE -std=c++11 -fno-exceptions)
|
||||
target_compile_options(${TARGET} PRIVATE
|
||||
-Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion
|
||||
-Wno-sign-conversion)
|
||||
|
||||
if(NOT ENABLE_RTTI)
|
||||
add_compile_options(-fno-rtti)
|
||||
endif()
|
||||
# For good call stacks in profiles, keep the frame pointers.
|
||||
if(NOT "${SPIRV_PERF}" STREQUAL "")
|
||||
target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer)
|
||||
|
|
Загрузка…
Ссылка в новой задаче